diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c index 27736142ed..89654b8945 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c @@ -15,6 +15,7 @@ #include #include #include +#include struct dma_coherent_mem { void *virt_base; diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c b/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c index 215804538c..49129dbe14 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c @@ -79,7 +79,7 @@ static ssize_t write_mem(struct file * file, const char __user * buf, if ((v = ioremap(p, count)) == NULL) return -EFAULT; - if (copy_to_user(v, buf, count)) + if (copy_from_user(v, buf, count)) goto out; written = count; diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c index 81f0f10c21..b403d1e004 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c @@ -15,6 +15,7 @@ #include #include #include +#include #define SHUTDOWN_INVALID -1 #define SHUTDOWN_POWEROFF 0 @@ -29,7 +30,6 @@ void machine_restart(char * __unused) { /* We really want to get pending console data out before we die. */ - extern void xencons_force_flush(void); xencons_force_flush(); HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_reboot); } @@ -42,7 +42,6 @@ void machine_halt(void) void machine_power_off(void) { /* We really want to get pending console data out before we die. */ - extern void xencons_force_flush(void); xencons_force_flush(); HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_poweroff); } @@ -85,8 +84,6 @@ static int __do_suspend(void *ignore) int vcpu_prepare(int vcpu); #endif - extern void xencons_resume(void); - int err = 0; BUG_ON(smp_processor_id() != 0); diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c index 1c610a48df..2367594baa 100644 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c @@ -381,9 +381,9 @@ static void watch_target(struct xenbus_watch *watch, } -int balloon_init_watcher(struct notifier_block *notifier, - unsigned long event, - void *data) +static int balloon_init_watcher(struct notifier_block *notifier, + unsigned long event, + void *data) { int err; diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c index fbcaec2c4f..667c888da7 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -679,7 +679,7 @@ static void blkif_recover(struct blkfront_info *info) int j; /* Stage 1: Make a safe copy of the shadow state. */ - copy = (struct blk_shadow *)kmalloc(sizeof(info->shadow), GFP_KERNEL); + copy = kmalloc(sizeof(info->shadow), GFP_KERNEL); BUG_ON(copy == NULL); memcpy(copy, info->shadow, sizeof(info->shadow)); diff --git a/linux-2.6-xen-sparse/drivers/xen/console/console.c b/linux-2.6-xen-sparse/drivers/xen/console/console.c index fe18653dde..a9f72453a6 100644 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c @@ -53,6 +53,7 @@ #include #include #include +#include #include "xencons_ring.h" /* diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/io.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/io.h index f3e03cd0a9..afb146d561 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/io.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/io.h @@ -228,7 +228,7 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int * used as the IO-area pointer (it can be iounmapped as well, so the * analogy with PCI is quite large): */ -#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) +#define __ISA_IO_base ((char __iomem *)(fix_to_virt(FIX_ISAMAP_BEGIN))) #define isa_readb(a) readb(__ISA_IO_base + (a)) #define isa_readw(a) readw(__ISA_IO_base + (a)) diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/io.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/io.h index 3b729ec0d7..f861c89564 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/io.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/io.h @@ -298,7 +298,7 @@ void memset_io(volatile void __iomem *a, int b, size_t c); * used as the IO-area pointer (it can be iounmapped as well, so the * analogy with PCI is quite large): */ -#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) +#define __ISA_IO_base ((char __iomem *)(fix_to_virt(FIX_ISAMAP_BEGIN))) #define isa_readb(a) readb(__ISA_IO_base + (a)) #define isa_readw(a) readw(__ISA_IO_base + (a)) diff --git a/linux-2.6-xen-sparse/include/asm-xen/xencons.h b/linux-2.6-xen-sparse/include/asm-xen/xencons.h new file mode 100644 index 0000000000..4b4909ba91 --- /dev/null +++ b/linux-2.6-xen-sparse/include/asm-xen/xencons.h @@ -0,0 +1,7 @@ +#ifndef __ASM_XENCONS_H__ +#define __ASM_XENCONS_H__ + +void xencons_force_flush(void); +void xencons_resume(void); + +#endif /* __ASM_XENCONS_H__ */ diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index fc6fc9d904..d5c784c019 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -351,7 +351,7 @@ static int setup_guest(int xc_handle, xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, page_array[0]); memset(start_info, 0, sizeof(*start_info)); rc = xc_version(xc_handle, XENVER_version, NULL); - sprintf(start_info->magic, "xen-%i.%i", rc >> 16, rc & (0xFFFF)); + sprintf(start_info->magic, "xen-%i.%i-ia64", rc >> 16, rc & (0xFFFF)); start_info->flags = flags; start_info->store_mfn = nr_pages - 2; start_info->store_evtchn = store_evtchn; @@ -628,7 +628,9 @@ static int setup_guest(int xc_handle, page_array[(vstartinfo_start-dsi.v_start)>>PAGE_SHIFT]); memset(start_info, 0, sizeof(*start_info)); rc = xc_version(xc_handle, XENVER_version, NULL); - sprintf(start_info->magic, "xen-%i.%i", rc >> 16, rc & (0xFFFF)); + sprintf(start_info->magic, "xen-%i.%i-x86_%d%s", + rc >> 16, rc & (0xFFFF), sizeof(long)*8, + dsi.pae_kernel ? "p" : ""); start_info->nr_pages = nr_pages; start_info->shared_info = shared_info_frame << PAGE_SHIFT; start_info->flags = flags; diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index e5a9c566d5..b48917ed06 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -402,11 +402,21 @@ int xc_version(int xc_handle, int cmd, void *arg) switch ( cmd ) { - case XENVER_extraversion: argsize = sizeof(xen_extraversion_t); break; - case XENVER_compile_info: argsize = sizeof(xen_compile_info_t); break; - case XENVER_capabilities: argsize = sizeof(xen_capabilities_info_t); break; - case XENVER_changeset: argsize = sizeof(xen_changeset_info_t); break; - case XENVER_parameters: argsize = sizeof(xen_parameters_info_t); break; + case XENVER_extraversion: + argsize = sizeof(xen_extraversion_t); + break; + case XENVER_compile_info: + argsize = sizeof(xen_compile_info_t); + break; + case XENVER_capabilities: + argsize = sizeof(xen_capabilities_info_t); + break; + case XENVER_changeset: + argsize = sizeof(xen_changeset_info_t); + break; + case XENVER_platform_parameters: + argsize = sizeof(xen_platform_parameters_t); + break; } if ( (argsize != 0) && (mlock(arg, argsize) != 0) ) diff --git a/tools/libxc/xg_save_restore.h b/tools/libxc/xg_save_restore.h index ca5e51d8d4..7c34fc4658 100644 --- a/tools/libxc/xg_save_restore.h +++ b/tools/libxc/xg_save_restore.h @@ -61,20 +61,20 @@ static int get_platform_info(int xc_handle, uint32_t dom, { xen_capabilities_info_t xen_caps = ""; - xen_parameters_info_t xen_parms; + xen_platform_parameters_t xen_params; xc_physinfo_t physinfo; if (xc_physinfo(xc_handle, &physinfo) != 0) return 0; - if (xc_version(xc_handle, XENVER_parameters, &xen_parms) != 0) + if (xc_version(xc_handle, XENVER_platform_parameters, &xen_params) != 0) return 0; if (xc_version(xc_handle, XENVER_capabilities, &xen_caps) != 0) return 0; *max_mfn = physinfo.total_pages; - *hvirt_start = xen_parms.virt_start; + *hvirt_start = xen_params.virt_start; if (strstr(xen_caps, "xen-3.0-x86_64")) *pt_levels = 4; diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index e2585dc5ed..3283ca74e5 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -721,7 +721,7 @@ static PyObject *pyxc_xeninfo(PyObject *self, xen_compile_info_t xen_cc; xen_changeset_info_t xen_chgset; xen_capabilities_info_t xen_caps; - xen_parameters_info_t xen_parms; + xen_platform_parameters_t p_parms; long xen_version; char str[128]; @@ -739,17 +739,17 @@ static PyObject *pyxc_xeninfo(PyObject *self, if ( xc_version(xc->xc_handle, XENVER_capabilities, &xen_caps) != 0 ) return PyErr_SetFromErrno(xc_error); - if ( xc_version(xc->xc_handle, XENVER_parameters, &xen_parms) != 0 ) + if ( xc_version(xc->xc_handle, XENVER_platform_parameters, &p_parms) != 0 ) return PyErr_SetFromErrno(xc_error); - sprintf(str,"virt_start=0x%lx",xen_parms.virt_start); + sprintf(str, "virt_start=0x%lx", p_parms.virt_start); return Py_BuildValue("{s:i,s:i,s:s,s:s,s:s,s:s,s:s,s:s,s:s,s:s}", "xen_major", xen_version >> 16, "xen_minor", (xen_version & 0xffff), "xen_extra", xen_extra, "xen_caps", xen_caps, - "xen_params", str, + "platform_params", str, "xen_changeset", xen_chgset, "cc_compiler", xen_cc.compiler, "cc_compile_by", xen_cc.compile_by, diff --git a/tools/python/xen/xend/XendNode.py b/tools/python/xen/xend/XendNode.py index a1275dc47f..fc0accd7d1 100644 --- a/tools/python/xen/xend/XendNode.py +++ b/tools/python/xen/xend/XendNode.py @@ -75,7 +75,7 @@ class XendNode: ['xen_minor', xinfo['xen_minor']], ['xen_extra', xinfo['xen_extra']], ['xen_caps', xinfo['xen_caps']], - ['xen_params',xinfo['xen_params']], + ['platform_params',xinfo['platform_params']], ['xen_changeset', xinfo['xen_changeset']], ['cc_compiler', xinfo['cc_compiler']], ['cc_compile_by', xinfo['cc_compile_by']], diff --git a/tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py b/tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py index cc6746d47d..856b7c0f57 100644 --- a/tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py +++ b/tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py @@ -11,7 +11,7 @@ eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) -elif where > 1: +elif where == -1: FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) diff --git a/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py b/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py index 930b9c1300..0d388a5bac 100644 --- a/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py +++ b/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py @@ -42,7 +42,7 @@ eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) -elif where > 1: +elif where == -1: FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) try: diff --git a/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py b/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py index 50073037be..2420fec3ba 100644 --- a/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py +++ b/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py @@ -41,7 +41,7 @@ eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) -elif where > 1: +elif where == -1: FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) try: diff --git a/tools/xm-test/tests/console/01_console_badopt_neg.py b/tools/xm-test/tests/console/01_console_badopt_neg.py index 0fa8f8384e..1c00afef4f 100644 --- a/tools/xm-test/tests/console/01_console_badopt_neg.py +++ b/tools/xm-test/tests/console/01_console_badopt_neg.py @@ -17,5 +17,5 @@ eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: FAIL("xm console returned invalid %i != 0" % status) -elif where > 1: +elif where == -1: FAIL("xm console didn't report error on bad argument") diff --git a/tools/xm-test/tests/console/02_console_baddom_neg.py b/tools/xm-test/tests/console/02_console_baddom_neg.py index 217dadfc13..56bf1a0451 100644 --- a/tools/xm-test/tests/console/02_console_baddom_neg.py +++ b/tools/xm-test/tests/console/02_console_baddom_neg.py @@ -15,7 +15,7 @@ eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: FAIL("xm console returned invalid %i != 0" % status) -elif where > 1: +elif where == -1: FAIL("xm console failed to report error on bad domid") status, output = traceCommand("xm console NON_EXIST") @@ -23,5 +23,5 @@ eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: FAIL("xm console returned invalid %i != 0" % status) -elif where > 1: +elif where == -1: FAIL("xm console failed to report error on bad domname") diff --git a/tools/xm-test/tests/create/02_create_noparm_neg.py b/tools/xm-test/tests/create/02_create_noparm_neg.py index 7d6a85a5fb..54f882853c 100644 --- a/tools/xm-test/tests/create/02_create_noparm_neg.py +++ b/tools/xm-test/tests/create/02_create_noparm_neg.py @@ -12,6 +12,6 @@ eyecatcher = "Error:" where = output.find(eyecatcher) if status == 0: FAIL("xm create returned invalid %i != 0" % status) -elif where > 1: +elif where == -1: FAIL("xm create failed to report error on missing args") diff --git a/tools/xm-test/tests/create/03_create_badparm_neg.py b/tools/xm-test/tests/create/03_create_badparm_neg.py index 68cfeb6eb9..2a64cf3305 100644 --- a/tools/xm-test/tests/create/03_create_badparm_neg.py +++ b/tools/xm-test/tests/create/03_create_badparm_neg.py @@ -15,5 +15,5 @@ from XmTestLib import * status, output = traceCommand("xm create -x") eyecatcher = "Error:" where = output.find(eyecatcher) -if where != 0: +if where == -1: FAIL("xm create failed to report error on bad arg") diff --git a/tools/xm-test/tests/create/05_create_noroot_noram_neg.py b/tools/xm-test/tests/create/05_create_noroot_noram_neg.py index 8e92a5412c..b6756c633d 100644 --- a/tools/xm-test/tests/create/05_create_noroot_noram_neg.py +++ b/tools/xm-test/tests/create/05_create_noroot_noram_neg.py @@ -22,5 +22,5 @@ time.sleep(15) eyecatcher = "NOROOT" status, output = traceCommand("xm list") where = output.find(eyecatcher) -if where != -1 : +if where != -1: FAIL("xm create test05 passed with no root and no ramdisk. Expected result: Fail.") diff --git a/tools/xm-test/tests/destroy/02_destroy_noparm_neg.py b/tools/xm-test/tests/destroy/02_destroy_noparm_neg.py index 3a634053c5..8fadb1eced 100644 --- a/tools/xm-test/tests/destroy/02_destroy_noparm_neg.py +++ b/tools/xm-test/tests/destroy/02_destroy_noparm_neg.py @@ -12,5 +12,5 @@ eyecatcher = "Error:" where = output.find(eyecatcher) if status == 0: FAIL("xm destroy returned invalid %i != 0" % status) -elif where > 1: +elif where == -1: FAIL("xm destroy failed to report error for missing arg") diff --git a/tools/xm-test/tests/destroy/03_destroy_nonexist_neg.py b/tools/xm-test/tests/destroy/03_destroy_nonexist_neg.py index 0c77347f3d..9520a65e2b 100644 --- a/tools/xm-test/tests/destroy/03_destroy_nonexist_neg.py +++ b/tools/xm-test/tests/destroy/03_destroy_nonexist_neg.py @@ -12,5 +12,5 @@ eyecatcher = "Error:" where = output.find(eyecatcher) if status == 0: FAIL("xm destroy returned invalid %i != 0" % status) -elif where > 1: +elif where == -1: FAIL("xm destroy failed to report error for bad arg") diff --git a/tools/xm-test/tests/destroy/04_destroy_badparm_neg.py b/tools/xm-test/tests/destroy/04_destroy_badparm_neg.py index 5814195c0d..179b4d0c36 100644 --- a/tools/xm-test/tests/destroy/04_destroy_badparm_neg.py +++ b/tools/xm-test/tests/destroy/04_destroy_badparm_neg.py @@ -12,5 +12,5 @@ eyecatcher = "Error:" where = output.find(eyecatcher) if status == 0: FAIL("xm destroy returned invalid %i != 0" % status) -elif where > 1: +elif where == -1: FAIL("xm destroy failed to report error for bad domid") diff --git a/tools/xm-test/tests/dmesg/02_dmesg_basic_neg.py b/tools/xm-test/tests/dmesg/02_dmesg_basic_neg.py index 10cd7a7cfd..e074c0d16a 100644 --- a/tools/xm-test/tests/dmesg/02_dmesg_basic_neg.py +++ b/tools/xm-test/tests/dmesg/02_dmesg_basic_neg.py @@ -12,6 +12,6 @@ eyecatcher = "Error:" where = output.find(eyecatcher) if status == 0: FAIL("xm dmesg returned invalid %i != 0" % status) -elif where == 1: +elif where == -1: FAIL("xm dmesg failed to report error for bad arg") diff --git a/tools/xm-test/tests/help/01_help_basic_pos.py b/tools/xm-test/tests/help/01_help_basic_pos.py index b7162a5f52..11b84f06b7 100644 --- a/tools/xm-test/tests/help/01_help_basic_pos.py +++ b/tools/xm-test/tests/help/01_help_basic_pos.py @@ -10,5 +10,5 @@ from XmTestLib import * status, output = traceCommand("xm help") eyecatcher = "Usage:" where = output.find(eyecatcher) -if where != 0: +if where == -1: FAIL("xm help: didn't see the usage string") diff --git a/tools/xm-test/tests/help/02_help_basic_neg.py b/tools/xm-test/tests/help/02_help_basic_neg.py index 28b2a07a10..09116ab2c0 100644 --- a/tools/xm-test/tests/help/02_help_basic_neg.py +++ b/tools/xm-test/tests/help/02_help_basic_neg.py @@ -10,5 +10,5 @@ from XmTestLib import * status, output = traceCommand("xm") eyecatcher = "Usage:" where = output.find(eyecatcher) -if where != 0: +if where == -1: FAIL("xm: didn't display usage when given no arguments") diff --git a/tools/xm-test/tests/help/03_help_badparm_neg.py b/tools/xm-test/tests/help/03_help_badparm_neg.py index 1c9cd62606..1064a755a3 100644 --- a/tools/xm-test/tests/help/03_help_badparm_neg.py +++ b/tools/xm-test/tests/help/03_help_badparm_neg.py @@ -10,5 +10,5 @@ from XmTestLib import * status, output = traceCommand("xm -x") eyecatcher = "Error:" where = output.find(eyecatcher) -if where != 0: +if where == -1: FAIL("xm failed to report error for bad arg") diff --git a/tools/xm-test/tests/help/05_help_nonroot_pos.py b/tools/xm-test/tests/help/05_help_nonroot_pos.py index 9798735c1e..87a395f62f 100644 --- a/tools/xm-test/tests/help/05_help_nonroot_pos.py +++ b/tools/xm-test/tests/help/05_help_nonroot_pos.py @@ -13,5 +13,5 @@ becomeNonRoot() status, output = traceCommand("xm help") eyecatcher = "Usage:" where = output.find(eyecatcher) -if where != 0: +if where == -1: FAIL("xm help: didn't see the usage string") diff --git a/tools/xm-test/tests/list/02_list_badparm_neg.py b/tools/xm-test/tests/list/02_list_badparm_neg.py index f018e5c20e..5c40694b93 100644 --- a/tools/xm-test/tests/list/02_list_badparm_neg.py +++ b/tools/xm-test/tests/list/02_list_badparm_neg.py @@ -12,5 +12,5 @@ eyecatcher = "Error:" where = output.find(eyecatcher) if status == 0: FAIL("xm list returned invalud %i != 0" % status) -elif where > 1: +elif where == -1: FAIL("xm list failed to report error for bad arg") diff --git a/tools/xm-test/tests/list/03_list_nonexist_neg.py b/tools/xm-test/tests/list/03_list_nonexist_neg.py index db3175fb87..04acbd6b9c 100644 --- a/tools/xm-test/tests/list/03_list_nonexist_neg.py +++ b/tools/xm-test/tests/list/03_list_nonexist_neg.py @@ -12,6 +12,6 @@ eyecatcher = "Error:" where = output.find(eyecatcher) if status == 0: FAIL("xm list returned invalid %i != 0" % status) -elif where > 1: +elif where == -1: FAIL("xm list failed to report error for invalid domid") diff --git a/tools/xm-test/tests/list/06_list_nonroot.py b/tools/xm-test/tests/list/06_list_nonroot.py index 7b61508cb7..c10ac56da8 100644 --- a/tools/xm-test/tests/list/06_list_nonroot.py +++ b/tools/xm-test/tests/list/06_list_nonroot.py @@ -11,5 +11,5 @@ becomeNonRoot() status, output = traceCommand("xm list") eyecatcher = "Error: Most commands need root access" where = output.find(eyecatcher) -if where != 0: +if where == -1: FAIL("xm help: didn't see the root hint, saw %s" % output) diff --git a/tools/xm-test/tests/memset/02_memset_badparm_neg.py b/tools/xm-test/tests/memset/02_memset_badparm_neg.py index f2b9e788e0..07f7e2c635 100644 --- a/tools/xm-test/tests/memset/02_memset_badparm_neg.py +++ b/tools/xm-test/tests/memset/02_memset_badparm_neg.py @@ -24,7 +24,7 @@ eyecatcher = "Error:" where = output.find(eyecatcher) if status == 0: FAIL("xm mem-set returned invalid %i == 0" % status) -elif where > 1: +elif where == -1: FAIL("xm mem-set failed to report error for missing arg") # destroy non existent parm input - negative test @@ -32,7 +32,7 @@ status, output = traceCommand("xm mem-set -x") where = output.find(eyecatcher) if status == 0: FAIL("xm mem-set returned invalid %i == 0" % status) -elif where != 0: +elif where == -1: FAIL("xm mem-set failed to report error for bad arg") # destroy non existent domain - negative test @@ -40,14 +40,14 @@ status, output = traceCommand("xm mem-set 6666") where = output.find(eyecatcher) if status == 0: FAIL("xm mem-set returned invalid %i == 0" % status) -elif where != 0: +elif where == -1: FAIL("xm mem-set failed to report error for invalid domid") # destroy non existent domain and memory - negative test status, output = traceCommand("xm mem-set 6666 64") where = output.find(eyecatcher) if status == 0: - FAIL("xm mem-set returned invalid %i != 0" % status) -elif where != 0: + FAIL("xm mem-set returned invalid %i == -1" % status) +elif where == -1: FAIL("xm mem-set failed to report error for invalid domid") diff --git a/tools/xm-test/tests/pause/02_pause_badopt_neg.py b/tools/xm-test/tests/pause/02_pause_badopt_neg.py index 4d504d1d92..18eda67641 100644 --- a/tools/xm-test/tests/pause/02_pause_badopt_neg.py +++ b/tools/xm-test/tests/pause/02_pause_badopt_neg.py @@ -25,7 +25,7 @@ where = output.find(eyecatcher) if status == 0: domain.destroy() FAIL("xm pause returned bad status, expected non 0, status is: %i" % status ) -elif where > 1: +elif where == -1: domain.destroy() FAIL("xm pause returned bad output, expected Error, output is: %s" % output ) diff --git a/tools/xm-test/tests/pause/03_pause_badname_neg.py b/tools/xm-test/tests/pause/03_pause_badname_neg.py index 7ec1bc4109..982034c66b 100644 --- a/tools/xm-test/tests/pause/03_pause_badname_neg.py +++ b/tools/xm-test/tests/pause/03_pause_badname_neg.py @@ -14,5 +14,5 @@ eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: FAIL("xm pause returned bad status, expected non 0, status is: %i" % status ) -elif where > 1: +elif where == -1: FAIL("xm pause returned bad output, expected Error, output is: %s" % output ) diff --git a/tools/xm-test/tests/pause/04_pause_badid_neg.py b/tools/xm-test/tests/pause/04_pause_badid_neg.py index c5bd578500..ffd1be2168 100644 --- a/tools/xm-test/tests/pause/04_pause_badid_neg.py +++ b/tools/xm-test/tests/pause/04_pause_badid_neg.py @@ -14,5 +14,5 @@ eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: FAIL("xm pause returned bad status, expected non 0, status is: %i" % status ) -elif where > 1: +elif where == -1: FAIL("xm pause returned bad output, expected Error, output is: %s" % output ) diff --git a/tools/xm-test/tests/reboot/02_reboot_badopt_neg.py b/tools/xm-test/tests/reboot/02_reboot_badopt_neg.py index cfcd52c021..b0a23bb4a5 100644 --- a/tools/xm-test/tests/reboot/02_reboot_badopt_neg.py +++ b/tools/xm-test/tests/reboot/02_reboot_badopt_neg.py @@ -25,7 +25,7 @@ where = output.find(eyecatcher) if status == 0: domain.destroy() FAIL("xm reboot returned invalid %i == 0" % status ) -elif where > 1: +elif where == -1: domain.destroy() FAIL("xm reboot failed to report error for bad arg") diff --git a/tools/xm-test/tests/reboot/03_reboot_badname_neg.py b/tools/xm-test/tests/reboot/03_reboot_badname_neg.py index aa1aabb6e0..480e5dd398 100644 --- a/tools/xm-test/tests/reboot/03_reboot_badname_neg.py +++ b/tools/xm-test/tests/reboot/03_reboot_badname_neg.py @@ -14,5 +14,5 @@ eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: FAIL("xm reboot returned invalid %i == 0" % status ) -elif where > 1: +elif where == -1: FAIL("xm reboot failed to report error for non-existent domain" ) diff --git a/tools/xm-test/tests/restore/02_restore_badparm_neg.py b/tools/xm-test/tests/restore/02_restore_badparm_neg.py index 6f1a5da079..aee5b5da72 100644 --- a/tools/xm-test/tests/restore/02_restore_badparm_neg.py +++ b/tools/xm-test/tests/restore/02_restore_badparm_neg.py @@ -21,5 +21,5 @@ if status == 0: FAIL("xm restore returned bad status, expected non 0, status is: %i" % status) elif where2 == 0: FAIL("xm restore returned a stack dump, expected nice error message") -elif where1 > 0: +elif where1 == -1: FAIL("xm restore returned bad output, expected Error:, output is: %s" % output) diff --git a/tools/xm-test/tests/restore/03_restore_badfilename_neg.py b/tools/xm-test/tests/restore/03_restore_badfilename_neg.py index 9a35cc3ae1..7639c4b90e 100644 --- a/tools/xm-test/tests/restore/03_restore_badfilename_neg.py +++ b/tools/xm-test/tests/restore/03_restore_badfilename_neg.py @@ -21,5 +21,5 @@ if status == 0: FAIL("xm restore returned bad status, expected non 0, status is: %i" % status) elif where2 == 0: FAIL("xm restore returned a stack dump, expected nice error message") -elif where1 > 0: +elif where1 == -1: FAIL("xm restore returned bad output, expected Error:, output is: %s" % output) diff --git a/tools/xm-test/tests/save/02_save_badparm_neg.py b/tools/xm-test/tests/save/02_save_badparm_neg.py index 5d81c75183..7966ff1ee1 100644 --- a/tools/xm-test/tests/save/02_save_badparm_neg.py +++ b/tools/xm-test/tests/save/02_save_badparm_neg.py @@ -21,5 +21,5 @@ if status == 0: FAIL("xm save returned bad status, expected non 0, status is: %i" % status) elif where2 == 0: FAIL("xm save returned a stack dump, expected nice error message") -elif where1 > 0: +elif where1 == -1: FAIL("xm save returned bad output, expected Error:, output is: %s" % output) diff --git a/tools/xm-test/tests/save/03_save_bogusfile_neg.py b/tools/xm-test/tests/save/03_save_bogusfile_neg.py index 4f1d042f42..de66e6080f 100644 --- a/tools/xm-test/tests/save/03_save_bogusfile_neg.py +++ b/tools/xm-test/tests/save/03_save_bogusfile_neg.py @@ -38,5 +38,5 @@ if status == 0: FAIL("xm save returned bad status, expected non 0, status is: %i" % status) elif where1 == 0: FAIL("xm save returned a stack dump, expected nice error message") -elif where2 > 0: +elif where2 == -1: FAIL("xm save returned bad output, expected Error:, output is: %s" % output) diff --git a/tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py b/tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py index 34e5c23d3f..8ec2a5b3c2 100644 --- a/tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py +++ b/tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py @@ -32,7 +32,7 @@ ret, output = traceCommand("xm shutdown -x %s" % domain.getName()) where = output.find(eyecatcher) if (ret == 0): FAIL("xm shutdown returned invalid %i == 0" % ret) -elif where != 0: +elif where == -1: FAIL("xm shutdown failed to report error for bad arg") # Stop the domain (nice shutdown) diff --git a/tools/xm-test/tests/shutdown/03_shutdown_nonexist_neg.py b/tools/xm-test/tests/shutdown/03_shutdown_nonexist_neg.py index 160ecdcdc2..4998911d88 100644 --- a/tools/xm-test/tests/shutdown/03_shutdown_nonexist_neg.py +++ b/tools/xm-test/tests/shutdown/03_shutdown_nonexist_neg.py @@ -18,5 +18,5 @@ ret, output = traceCommand("xm shutdown 9999") where = output.find(eyecatcher) if (ret == 0): FAIL("xm shutdown returned invalid %i == 0" % ret) -elif where != 0: +elif where == -1: FAIL("xm shutdown failed to report error for bad domid") diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c index 15920ca8a0..416c096432 100644 --- a/xen/arch/ia64/xen/domain.c +++ b/xen/arch/ia64/xen/domain.c @@ -952,7 +952,7 @@ int construct_dom0(struct domain *d, si = (start_info_t *)alloc_xenheap_page(); memset(si, 0, PAGE_SIZE); d->shared_info->arch.start_info_pfn = __pa(si) >> PAGE_SHIFT; - sprintf(si->magic, "Xen-%i.%i", XEN_VERSION, XEN_SUBVERSION); + sprintf(si->magic, "xen-%i.%i-ia64", XEN_VERSION, XEN_SUBVERSION); #if 0 si->nr_pages = d->tot_pages; diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index d3b8a7a4d0..b83ea2c47c 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -639,7 +639,8 @@ int construct_dom0(struct domain *d, si->pt_base = vpt_start; si->nr_pt_frames = nr_pt_pages; si->mfn_list = vphysmap_start; - sprintf(si->magic, "Xen-%i.%i", XEN_VERSION, XEN_SUBVERSION); + sprintf(si->magic, "xen-%i.%i-x86_%d%s", + XEN_VERSION, XEN_SUBVERSION, BITS_PER_LONG, xen_pae ? "p" : ""); /* Write the phys->machine and machine->phys table entries. */ for ( pfn = 0; pfn < d->tot_pages; pfn++ ) diff --git a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c index 19eef963c6..e336878b9e 100644 --- a/xen/arch/x86/shadow.c +++ b/xen/arch/x86/shadow.c @@ -873,7 +873,7 @@ shadow_make_snapshot( } static struct out_of_sync_entry * -mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn, +__mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn, unsigned long mfn) { struct domain *d = v->domain; @@ -909,7 +909,6 @@ mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn, entry->v = v; entry->gpfn = gpfn; entry->gmfn = mfn; - entry->snapshot_mfn = shadow_make_snapshot(d, gpfn, mfn); entry->writable_pl1e = -1; #if 0 // this code has not been updated for 32pae & 64 bit modes @@ -923,20 +922,34 @@ mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn, // get_page(page, d); + return entry; +} + +static struct out_of_sync_entry * +mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn, + unsigned long mfn) +{ + struct out_of_sync_entry *entry = + __mark_mfn_out_of_sync(v, gpfn, mfn); + struct domain *d = v->domain; + + entry->snapshot_mfn = shadow_make_snapshot(d, gpfn, mfn); // Add to the out-of-sync list // entry->next = d->arch.out_of_sync; d->arch.out_of_sync = entry; return entry; + } static void shadow_mark_va_out_of_sync( struct vcpu *v, unsigned long gpfn, unsigned long mfn, unsigned long va) { struct out_of_sync_entry *entry = - shadow_mark_mfn_out_of_sync(v, gpfn, mfn); + __mark_mfn_out_of_sync(v, gpfn, mfn); l2_pgentry_t sl2e; + struct domain *d = v->domain; #if CONFIG_PAGING_LEVELS >= 4 { @@ -971,6 +984,7 @@ static void shadow_mark_va_out_of_sync( } ASSERT(l2e_get_flags(sl2e) & _PAGE_PRESENT); + entry->snapshot_mfn = shadow_make_snapshot(d, gpfn, mfn); // NB: this is stored as a machine address. entry->writable_pl1e = l2e_get_paddr(sl2e) | (sizeof(l1_pgentry_t) * l1_table_offset(va)); @@ -983,6 +997,11 @@ static void shadow_mark_va_out_of_sync( if ( !get_shadow_ref(l2e_get_pfn(sl2e)) ) BUG(); + // Add to the out-of-sync list + // + entry->next = d->arch.out_of_sync; + d->arch.out_of_sync = entry; + FSH_LOG("mark_out_of_sync(va=%lx -> writable_pl1e=%lx)", va, entry->writable_pl1e); } diff --git a/xen/arch/x86/shadow32.c b/xen/arch/x86/shadow32.c index 629ebe16be..e3a5389843 100644 --- a/xen/arch/x86/shadow32.c +++ b/xen/arch/x86/shadow32.c @@ -1826,7 +1826,7 @@ shadow_free_snapshot(struct domain *d, struct out_of_sync_entry *entry) } struct out_of_sync_entry * -shadow_mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn, +__shadow_mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn, unsigned long mfn) { struct domain *d = v->domain; @@ -1862,7 +1862,6 @@ shadow_mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn, entry->v = v; entry->gpfn = gpfn; entry->gmfn = mfn; - entry->snapshot_mfn = shadow_make_snapshot(d, gpfn, mfn); entry->writable_pl1e = -1; #if SHADOW_DEBUG @@ -1874,6 +1873,18 @@ shadow_mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn, // get_page(page, d); + return entry; +} + +struct out_of_sync_entry * +shadow_mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn, + unsigned long mfn) +{ + struct out_of_sync_entry *entry = + __shadow_mark_mfn_out_of_sync(v, gpfn, mfn); + struct domain *d = v->domain; + + entry->snapshot_mfn = shadow_make_snapshot(d, gpfn, mfn); // Add to the out-of-sync list // entry->next = d->arch.out_of_sync; @@ -1886,8 +1897,9 @@ void shadow_mark_va_out_of_sync( struct vcpu *v, unsigned long gpfn, unsigned long mfn, unsigned long va) { struct out_of_sync_entry *entry = - shadow_mark_mfn_out_of_sync(v, gpfn, mfn); + __shadow_mark_mfn_out_of_sync(v, gpfn, mfn); l2_pgentry_t sl2e; + struct domain *d = v->domain; // We need the address of shadow PTE that maps @va. // It might not exist yet. Make sure it's there. @@ -1902,6 +1914,7 @@ void shadow_mark_va_out_of_sync( } ASSERT(l2e_get_flags(sl2e) & _PAGE_PRESENT); + entry->snapshot_mfn = shadow_make_snapshot(d, gpfn, mfn); // NB: this is stored as a machine address. entry->writable_pl1e = l2e_get_paddr(sl2e) | (sizeof(l1_pgentry_t) * l1_table_offset(va)); @@ -1914,6 +1927,11 @@ void shadow_mark_va_out_of_sync( if ( !get_shadow_ref(l2e_get_pfn(sl2e)) ) BUG(); + // Add to the out-of-sync list + // + entry->next = d->arch.out_of_sync; + d->arch.out_of_sync = entry; + FSH_LOG("mark_out_of_sync(va=%lx -> writable_pl1e=%lx)", va, entry->writable_pl1e); } diff --git a/xen/common/kernel.c b/xen/common/kernel.c index c0fee4298b..9975ee639d 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -124,10 +124,12 @@ long do_xen_version(int cmd, void *arg) return 0; } - case XENVER_parameters: + case XENVER_platform_parameters: { - xen_parameters_info_t info = { .virt_start = HYPERVISOR_VIRT_START }; - if ( copy_to_user(arg, &info, sizeof(info)) ) + xen_platform_parameters_t params = { + .virt_start = HYPERVISOR_VIRT_START + }; + if ( copy_to_user(arg, ¶ms, sizeof(params)) ) return -EFAULT; return 0; diff --git a/xen/include/public/version.h b/xen/include/public/version.h index 80489adcd1..d22566e381 100644 --- a/xen/include/public/version.h +++ b/xen/include/public/version.h @@ -34,10 +34,10 @@ typedef char xen_capabilities_info_t[1024]; #define XENVER_changeset 4 typedef char xen_changeset_info_t[64]; -#define XENVER_parameters 5 -typedef struct xen_parameters_info { +#define XENVER_platform_parameters 5 +typedef struct xen_platform_parameters { unsigned long virt_start; -} xen_parameters_info_t; +} xen_platform_parameters_t; #endif /* __XEN_PUBLIC_VERSION_H__ */ diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index 51697ef15a..2259fc3ba0 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -408,7 +408,7 @@ typedef struct shared_info { #define MAX_GUEST_CMDLINE 1024 typedef struct start_info { /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME. */ - char magic[32]; /* "Xen-.". */ + char magic[32]; /* "xen--". */ unsigned long nr_pages; /* Total pages allocated to this domain. */ unsigned long shared_info; /* MACHINE address of shared info struct. */ uint32_t flags; /* SIF_xxx flags. */