WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] merge with linux-2.6.18-xen.hg (stagi

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] merge with linux-2.6.18-xen.hg (staging)
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Jan 2008 01:11:39 -0800
Delivery-date: Wed, 23 Jan 2008 01:18:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1201015906 25200
# Node ID c779f9e01072a95ded3edb2b5ec3d5a915b07828
# Parent  71a415f9179bbd2bf630520949fd5da24187c119
# Parent  346ab9d4d2acd135630c316e8d244c63066900ca
merge with linux-2.6.18-xen.hg (staging)
---
 arch/i386/kernel/cpu/mtrr/main-xen.c        |    3 -
 arch/i386/kernel/fixup.c                    |    8 +--
 arch/i386/kernel/io_apic-xen.c              |    4 -
 arch/i386/kernel/ioport-xen.c               |    3 -
 arch/i386/kernel/process-xen.c              |   10 ++--
 arch/i386/kernel/quirks-xen.c               |    2 
 arch/i386/kernel/setup-xen.c                |    9 ++-
 arch/i386/kernel/time-xen.c                 |   42 ++++++++++++++----
 arch/i386/kernel/traps-xen.c                |    6 ++
 arch/i386/mm/hypervisor.c                   |    6 +-
 arch/i386/oprofile/xenoprof.c               |    4 -
 arch/x86_64/kernel/io_apic-xen.c            |    2 
 arch/x86_64/kernel/ioport-xen.c             |    5 +-
 arch/x86_64/kernel/process-xen.c            |   17 ++++---
 arch/x86_64/kernel/setup-xen.c              |    6 +-
 arch/x86_64/kernel/setup64-xen.c            |    4 +
 arch/x86_64/kernel/traps-xen.c              |    4 -
 arch/x86_64/mm/init-xen.c                   |   10 ++--
 drivers/xen/blkback/blkback.c               |   10 +++-
 drivers/xen/blktap/blktap.c                 |   15 ++++++
 drivers/xen/core/evtchn.c                   |   12 +++--
 drivers/xen/core/machine_kexec.c            |    4 -
 drivers/xen/core/machine_reboot.c           |   10 ++--
 drivers/xen/netback/netback.c               |   26 +++++++----
 drivers/xen/netfront/netfront.c             |   11 +++-
 drivers/xen/xenoprof/xenoprofile.c          |   12 +++--
 include/asm-i386/mach-xen/asm/desc.h        |    8 ++-
 include/asm-i386/mach-xen/asm/hypercall.h   |   62 ++++++++++++++-------------
 include/asm-i386/mach-xen/asm/hypervisor.h  |   25 +++++-----
 include/asm-i386/mach-xen/asm/processor.h   |   10 ++--
 include/asm-x86_64/mach-xen/asm/desc.h      |    8 ++-
 include/asm-x86_64/mach-xen/asm/hypercall.h |   64 ++++++++++++++--------------
 include/asm-x86_64/mach-xen/asm/processor.h |    6 +-
 include/xen/evtchn.h                        |    2 
 include/xen/hypercall.h                     |    7 ++-
 35 files changed, 264 insertions(+), 173 deletions(-)

diff -r 71a415f9179b -r c779f9e01072 arch/i386/kernel/cpu/mtrr/main-xen.c
--- a/arch/i386/kernel/cpu/mtrr/main-xen.c      Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/kernel/cpu/mtrr/main-xen.c      Tue Jan 22 08:31:46 2008 -0700
@@ -18,7 +18,8 @@ void generic_get_mtrr(unsigned int reg, 
 
        op.cmd = XENPF_read_memtype;
        op.u.read_memtype.reg = reg;
-       (void)HYPERVISOR_platform_op(&op);
+       if (unlikely(HYPERVISOR_platform_op(&op)))
+               memset(&op.u.read_memtype, 0, sizeof(op.u.read_memtype));
 
        *size = op.u.read_memtype.nr_mfns;
        *base = op.u.read_memtype.mfn;
diff -r 71a415f9179b -r c779f9e01072 arch/i386/kernel/fixup.c
--- a/arch/i386/kernel/fixup.c  Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/kernel/fixup.c  Tue Jan 22 08:31:46 2008 -0700
@@ -46,8 +46,8 @@ fastcall void do_fixup_4gb_segment(struc
        if (current->tgid == 1)
                return;
             
-       HYPERVISOR_vm_assist(
-               VMASST_CMD_disable, VMASST_TYPE_4gb_segments_notify);
+       VOID(HYPERVISOR_vm_assist(VMASST_CMD_disable,
+                                 VMASST_TYPE_4gb_segments_notify));
 
        if (test_and_set_bit(0, &printed))
                return;
@@ -81,8 +81,8 @@ fastcall void do_fixup_4gb_segment(struc
 
 static int __init fixup_init(void)
 {
-       HYPERVISOR_vm_assist(
-               VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify);
+       WARN_ON(HYPERVISOR_vm_assist(VMASST_CMD_enable,
+                                    VMASST_TYPE_4gb_segments_notify));
        return 0;
 }
 __initcall(fixup_init);
diff -r 71a415f9179b -r c779f9e01072 arch/i386/kernel/io_apic-xen.c
--- a/arch/i386/kernel/io_apic-xen.c    Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/kernel/io_apic-xen.c    Tue Jan 22 08:31:46 2008 -0700
@@ -75,7 +75,7 @@ static inline void xen_io_apic_write(uns
        apic_op.apic_physbase = mp_ioapics[apic].mpc_apicaddr;
        apic_op.reg = reg;
        apic_op.value = value;
-       HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op);
+       WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op));
 }
 
 #define io_apic_read(a,r)    xen_io_apic_read(a,r)
@@ -2506,7 +2506,7 @@ static int __init io_apic_bug_finalize(v
                struct xen_platform_op op = { .cmd = XENPF_platform_quirk };
                op.u.platform_quirk.quirk_id = sis_apic_bug ?
                        QUIRK_IOAPIC_BAD_REGSEL : QUIRK_IOAPIC_GOOD_REGSEL;
-               HYPERVISOR_platform_op(&op);
+               VOID(HYPERVISOR_platform_op(&op));
        }
        return 0;
 }
diff -r 71a415f9179b -r c779f9e01072 arch/i386/kernel/ioport-xen.c
--- a/arch/i386/kernel/ioport-xen.c     Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/kernel/ioport-xen.c     Tue Jan 22 08:31:46 2008 -0700
@@ -83,7 +83,8 @@ asmlinkage long sys_ioperm(unsigned long
 
                set_xen_guest_handle(set_iobitmap.bitmap, (char *)bitmap);
                set_iobitmap.nr_ports = IO_BITMAP_BITS;
-               HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &set_iobitmap);
+               WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap,
+                                             &set_iobitmap));
        }
 
        set_bitmap(t->io_bitmap_ptr, from, num, !turn_on);
diff -r 71a415f9179b -r c779f9e01072 arch/i386/kernel/process-xen.c
--- a/arch/i386/kernel/process-xen.c    Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/kernel/process-xen.c    Tue Jan 22 08:31:46 2008 -0700
@@ -137,8 +137,7 @@ static inline void play_dead(void)
        idle_task_exit();
        local_irq_disable();
        cpu_clear(smp_processor_id(), cpu_initialized);
-       preempt_enable_no_resched();
-       HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
+       xen_halt();
        cpu_bringup();
 }
 #else
@@ -309,7 +308,8 @@ void exit_thread(void)
                struct thread_struct *t = &tsk->thread;
                struct physdev_set_iobitmap set_iobitmap;
                memset(&set_iobitmap, 0, sizeof(set_iobitmap));
-               HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &set_iobitmap);
+               WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap,
+                                             &set_iobitmap));
                kfree(t->io_bitmap_ptr);
                t->io_bitmap_ptr = NULL;
                clear_thread_flag(TIF_IO_BITMAP);
@@ -616,7 +616,9 @@ struct task_struct fastcall * __switch_t
                mcl++;
        }
 
-       (void)HYPERVISOR_multicall(_mcl, mcl - _mcl);
+       BUG_ON(mcl > _mcl + ARRAY_SIZE(_mcl));
+       if (unlikely(HYPERVISOR_multicall_check(_mcl, mcl - _mcl, NULL)))
+               BUG();
 
        /*
         * Restore %fs and %gs if needed.
diff -r 71a415f9179b -r c779f9e01072 arch/i386/kernel/quirks-xen.c
--- a/arch/i386/kernel/quirks-xen.c     Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/kernel/quirks-xen.c     Tue Jan 22 08:31:46 2008 -0700
@@ -34,7 +34,7 @@ static void __devinit quirk_intel_irqbal
                printk(KERN_INFO "Disabling irq balancing and affinity\n");
                op.cmd = XENPF_platform_quirk;
                op.u.platform_quirk.quirk_id = QUIRK_NOIRQBALANCING;
-               (void)HYPERVISOR_platform_op(&op);
+               WARN_ON(HYPERVISOR_platform_op(&op));
        }
 
        /* put back the original value for config space*/
diff -r 71a415f9179b -r c779f9e01072 arch/i386/kernel/setup-xen.c
--- a/arch/i386/kernel/setup-xen.c      Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/kernel/setup-xen.c      Tue Jan 22 08:31:46 2008 -0700
@@ -1621,9 +1621,10 @@ void __init setup_arch(char **cmdline_p)
        /* Register a call for panic conditions. */
        atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block);
 
-       HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments);
-       HYPERVISOR_vm_assist(VMASST_CMD_enable,
-                            VMASST_TYPE_writable_pagetables);
+       WARN_ON(HYPERVISOR_vm_assist(VMASST_CMD_enable,
+                                    VMASST_TYPE_4gb_segments));
+       WARN_ON(HYPERVISOR_vm_assist(VMASST_CMD_enable,
+                                    VMASST_TYPE_writable_pagetables));
 
        memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
        early_cpu_init();
@@ -1827,7 +1828,7 @@ void __init setup_arch(char **cmdline_p)
                efi_map_memmap();
 
        set_iopl.iopl = 1;
-       HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl);
+       WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl));
 
 #ifdef CONFIG_ACPI
        if (!is_initial_xendomain()) {
diff -r 71a415f9179b -r c779f9e01072 arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c       Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/kernel/time-xen.c       Tue Jan 22 08:31:46 2008 -0700
@@ -519,7 +519,7 @@ static void sync_xen_wallclock(unsigned 
        op.u.settime.secs        = sec;
        op.u.settime.nsecs       = nsec;
        op.u.settime.system_time = processed_system_time;
-       HYPERVISOR_platform_op(&op);
+       WARN_ON(HYPERVISOR_platform_op(&op));
 
        update_wallclock();
 
@@ -914,8 +914,16 @@ void __init time_init(void)
        }
 #endif
 
-       HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, 0,
-                          &xen_set_periodic_tick);
+       switch (HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, 0,
+                                  &xen_set_periodic_tick)) {
+       case 0:
+#if CONFIG_XEN_COMPAT <= 0x030004
+       case -ENOSYS:
+#endif
+               break;
+       default:
+               BUG();
+       }
 
        get_time_values_from_xen(0);
 
@@ -1026,7 +1034,7 @@ void halt(void)
 void halt(void)
 {
        if (irqs_disabled())
-               HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
+               VOID(HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL));
 }
 EXPORT_SYMBOL(halt);
 
@@ -1038,8 +1046,16 @@ void time_resume(void)
        init_cpu_khz();
 
        for_each_online_cpu(cpu) {
-               HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu,
-                                  &xen_set_periodic_tick);
+               switch (HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu,
+                                          &xen_set_periodic_tick)) {
+               case 0:
+#if CONFIG_XEN_COMPAT <= 0x030004
+               case -ENOSYS:
+#endif
+                       break;
+               default:
+                       BUG();
+               }
                get_time_values_from_xen(cpu);
                per_cpu(processed_system_time, cpu) =
                        per_cpu(shadow_time, 0).system_timestamp;
@@ -1060,8 +1076,16 @@ int __cpuinit local_setup_timer(unsigned
 
        BUG_ON(cpu == 0);
 
-       HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu,
-                          &xen_set_periodic_tick);
+       switch (HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu,
+                          &xen_set_periodic_tick)) {
+       case 0:
+#if CONFIG_XEN_COMPAT <= 0x030004
+       case -ENOSYS:
+#endif
+               break;
+       default:
+               BUG();
+       }
 
        do {
                seq = read_seqbegin(&xtime_lock);
@@ -1109,7 +1133,7 @@ static int time_cpufreq_notifier(struct 
        op.u.change_freq.flags = 0;
        op.u.change_freq.cpu = freq->cpu;
        op.u.change_freq.freq = (u64)freq->new * 1000;
-       HYPERVISOR_platform_op(&op);
+       WARN_ON(HYPERVISOR_platform_op(&op));
 
        return 0;
 }
diff -r 71a415f9179b -r c779f9e01072 arch/i386/kernel/traps-xen.c
--- a/arch/i386/kernel/traps-xen.c      Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/kernel/traps-xen.c      Tue Jan 22 08:31:46 2008 -0700
@@ -1121,7 +1121,11 @@ static trap_info_t trap_table[] = {
 
 void __init trap_init(void)
 {
-       HYPERVISOR_set_trap_table(trap_table);
+       int ret;
+
+       ret = HYPERVISOR_set_trap_table(trap_table);
+       if (ret)
+               printk("HYPERVISOR_set_trap_table failed: error %d\n", ret);
 
        if (cpu_has_fxsr) {
                /*
diff -r 71a415f9179b -r c779f9e01072 arch/i386/mm/hypervisor.c
--- a/arch/i386/mm/hypervisor.c Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/mm/hypervisor.c Tue Jan 22 08:31:46 2008 -0700
@@ -181,12 +181,12 @@ void xen_pgd_unpin(unsigned long ptr)
        BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 }
 
-void xen_set_ldt(unsigned long ptr, unsigned long len)
+void xen_set_ldt(const void *ptr, unsigned int ents)
 {
        struct mmuext_op op;
        op.cmd = MMUEXT_SET_LDT;
-       op.arg1.linear_addr = ptr;
-       op.arg2.nr_ents     = len;
+       op.arg1.linear_addr = (unsigned long)ptr;
+       op.arg2.nr_ents     = ents;
        BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 }
 
diff -r 71a415f9179b -r c779f9e01072 arch/i386/oprofile/xenoprof.c
--- a/arch/i386/oprofile/xenoprof.c     Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/i386/oprofile/xenoprof.c     Tue Jan 22 08:31:46 2008 -0700
@@ -52,8 +52,8 @@ void xenoprof_arch_counter(void)
                counter.kernel    = (uint32_t)counter_config[i].kernel;
                counter.user      = (uint32_t)counter_config[i].user;
                counter.unit_mask = (uint64_t)counter_config[i].unit_mask;
-               HYPERVISOR_xenoprof_op(XENOPROF_counter, 
-                                      &counter);
+               WARN_ON(HYPERVISOR_xenoprof_op(XENOPROF_counter,
+                                              &counter));
        }
 }
 
diff -r 71a415f9179b -r c779f9e01072 arch/x86_64/kernel/io_apic-xen.c
--- a/arch/x86_64/kernel/io_apic-xen.c  Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/x86_64/kernel/io_apic-xen.c  Tue Jan 22 08:31:46 2008 -0700
@@ -123,7 +123,7 @@ static inline void xen_io_apic_write(uns
        apic_op.apic_physbase = mp_ioapics[apic].mpc_apicaddr;
        apic_op.reg = reg;
        apic_op.value = value;
-       HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op);
+       WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op));
 }
 
 #define io_apic_read(a,r)    xen_io_apic_read(a,r)
diff -r 71a415f9179b -r c779f9e01072 arch/x86_64/kernel/ioport-xen.c
--- a/arch/x86_64/kernel/ioport-xen.c   Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/x86_64/kernel/ioport-xen.c   Tue Jan 22 08:31:46 2008 -0700
@@ -61,7 +61,8 @@ asmlinkage long sys_ioperm(unsigned long
 
                set_xen_guest_handle(set_iobitmap.bitmap, (char *)bitmap);
                set_iobitmap.nr_ports = IO_BITMAP_BITS;
-               HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &set_iobitmap);
+               WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap,
+                                             &set_iobitmap));
        }
 
        set_bitmap(t->io_bitmap_ptr, from, num, !turn_on);
@@ -93,7 +94,7 @@ asmlinkage long sys_iopl(unsigned int ne
 
        /* Force the change at ring 0. */
        set_iopl.iopl = (new_iopl == 0) ? 1 : new_iopl;
-       HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl);
+       WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl));
 
        return 0;
 }
diff -r 71a415f9179b -r c779f9e01072 arch/x86_64/kernel/process-xen.c
--- a/arch/x86_64/kernel/process-xen.c  Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/x86_64/kernel/process-xen.c  Tue Jan 22 08:31:46 2008 -0700
@@ -151,8 +151,7 @@ static inline void play_dead(void)
        idle_task_exit();
        local_irq_disable();
        cpu_clear(smp_processor_id(), cpu_initialized);
-       preempt_enable_no_resched();
-       HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
+       xen_halt();
        cpu_bringup();
 }
 #else
@@ -318,7 +317,8 @@ void exit_thread(void)
                put_cpu();
 #endif
 #ifdef CONFIG_XEN
-               HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &iobmp_op);
+               WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap,
+                                             &iobmp_op));
 #endif
                t->io_bitmap_max = 0;
        }
@@ -326,7 +326,7 @@ void exit_thread(void)
 
 void load_gs_index(unsigned gs)
 {
-       HYPERVISOR_set_segment_base(SEGBASE_GS_USER_SEL, gs);
+       WARN_ON(HYPERVISOR_set_segment_base(SEGBASE_GS_USER_SEL, gs));
 }
 
 void flush_thread(void)
@@ -550,7 +550,10 @@ __switch_to(struct task_struct *prev_p, 
                mcl++;
        }
 
-       (void)HYPERVISOR_multicall(_mcl, mcl - _mcl);
+       BUG_ON(mcl > _mcl + ARRAY_SIZE(_mcl));
+       if (unlikely(HYPERVISOR_multicall_check(_mcl, mcl - _mcl, NULL)))
+               BUG();
+
        /* 
         * Switch DS and ES.
         * This won't pick up thread selector changes, but I guess that is ok.
@@ -568,13 +571,13 @@ __switch_to(struct task_struct *prev_p, 
                loadsegment(fs, next->fsindex);
 
        if (next->fs)
-               HYPERVISOR_set_segment_base(SEGBASE_FS, next->fs); 
+               WARN_ON(HYPERVISOR_set_segment_base(SEGBASE_FS, next->fs));
        
        if (unlikely(next->gsindex))
                load_gs_index(next->gsindex);
 
        if (next->gs)
-               HYPERVISOR_set_segment_base(SEGBASE_GS_USER, next->gs); 
+               WARN_ON(HYPERVISOR_set_segment_base(SEGBASE_GS_USER, next->gs));
 
        /* 
         * Switch the PDA context.
diff -r 71a415f9179b -r c779f9e01072 arch/x86_64/kernel/setup-xen.c
--- a/arch/x86_64/kernel/setup-xen.c    Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/x86_64/kernel/setup-xen.c    Tue Jan 22 08:31:46 2008 -0700
@@ -607,8 +607,8 @@ void __init setup_arch(char **cmdline_p)
 
        copy_edid();
 
-       HYPERVISOR_vm_assist(VMASST_CMD_enable,
-                            VMASST_TYPE_writable_pagetables);
+       WARN_ON(HYPERVISOR_vm_assist(VMASST_CMD_enable,
+                                    VMASST_TYPE_writable_pagetables));
 
        ARCH_SETUP
 #else
@@ -940,7 +940,7 @@ void __init setup_arch(char **cmdline_p)
                struct physdev_set_iopl set_iopl;
 
                set_iopl.iopl = 1;
-               HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl);
+               WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl));
 
                if (is_initial_xendomain()) {
 #ifdef CONFIG_VT
diff -r 71a415f9179b -r c779f9e01072 arch/x86_64/kernel/setup64-xen.c
--- a/arch/x86_64/kernel/setup64-xen.c  Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/x86_64/kernel/setup64-xen.c  Tue Jan 22 08:31:46 2008 -0700
@@ -171,7 +171,9 @@ void pda_init(int cpu)
 #ifndef CONFIG_XEN
        wrmsrl(MSR_GS_BASE, pda);
 #else
-       HYPERVISOR_set_segment_base(SEGBASE_GS_KERNEL, (unsigned long)pda);
+       if (HYPERVISOR_set_segment_base(SEGBASE_GS_KERNEL,
+                                       (unsigned long)pda))
+               BUG();
 #endif
        pda->cpunumber = cpu; 
        pda->irqcount = -1;
diff -r 71a415f9179b -r c779f9e01072 arch/x86_64/kernel/traps-xen.c
--- a/arch/x86_64/kernel/traps-xen.c    Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/x86_64/kernel/traps-xen.c    Tue Jan 22 08:31:46 2008 -0700
@@ -1120,10 +1120,8 @@ void __init trap_init(void)
         int ret;
 
         ret = HYPERVISOR_set_trap_table(trap_table);
-        
         if (ret) 
-                printk("HYPERVISOR_set_trap_table faild: error %d\n",
-                       ret);
+               printk("HYPERVISOR_set_trap_table failed: error %d\n", ret);
 
        /*
         * Should be a barrier for any external CPU state.
diff -r 71a415f9179b -r c779f9e01072 arch/x86_64/mm/init-xen.c
--- a/arch/x86_64/mm/init-xen.c Fri Jan 18 14:20:59 2008 -0700
+++ b/arch/x86_64/mm/init-xen.c Tue Jan 22 08:31:46 2008 -0700
@@ -593,7 +593,8 @@ static void __init extend_init_mapping(u
 
        /* Kill mapping of low 1MB. */
        while (va < (unsigned long)&_text) {
-               HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0);
+               if (HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0))
+                       BUG();
                va += PAGE_SIZE;
        }
 
@@ -626,7 +627,8 @@ static void __init extend_init_mapping(u
                pmd = (pmd_t *)&page[pmd_index(va)];
                if (pmd_none(*pmd))
                        break;
-               HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0);
+               if (HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0))
+                       BUG();
                va += PAGE_SIZE;
        }
 }
@@ -679,8 +681,8 @@ static void xen_finish_init_mapping(void
        start = PAGE_ALIGN((unsigned long)_end);
        end   = __START_KERNEL_map + (table_end << PAGE_SHIFT);
        for (; start < end; start += PAGE_SIZE)
-               WARN_ON(HYPERVISOR_update_va_mapping(
-                       start, __pte_ma(0), 0));
+               if (HYPERVISOR_update_va_mapping(start, __pte_ma(0), 0))
+                       BUG();
 
        /* Allocate pte's for initial fixmaps from 'start_pfn' allocator. */
        table_end = ~0UL;
diff -r 71a415f9179b -r c779f9e01072 drivers/xen/blkback/blkback.c
--- a/drivers/xen/blkback/blkback.c     Fri Jan 18 14:20:59 2008 -0700
+++ b/drivers/xen/blkback/blkback.c     Tue Jan 22 08:31:46 2008 -0700
@@ -312,7 +312,7 @@ static int do_block_io_op(blkif_t *blkif
        rp = blk_rings->common.sring->req_prod;
        rmb(); /* Ensure we see queued requests up to 'rp'. */
 
-       while ((rc != rp)) {
+       while (rc != rp) {
 
                if (RING_REQUEST_CONS_OVERFLOW(&blk_rings->common, rc))
                        break;
@@ -320,6 +320,11 @@ static int do_block_io_op(blkif_t *blkif
                pending_req = alloc_req();
                if (NULL == pending_req) {
                        blkif->st_oo_req++;
+                       more_to_do = 1;
+                       break;
+               }
+
+               if (kthread_should_stop()) {
                        more_to_do = 1;
                        break;
                }
@@ -354,7 +359,7 @@ static int do_block_io_op(blkif_t *blkif
                default:
                        /* A good sign something is wrong: sleep for a while to
                         * avoid excessive CPU consumption by a bad guest. */
-                       mdelay(1);
+                       msleep(1);
                        DPRINTK("error: unknown block io operation [%d]\n",
                                req.operation);
                        make_response(blkif, req.id, req.operation,
@@ -517,6 +522,7 @@ static void dispatch_rw_block_io(blkif_t
  fail_response:
        make_response(blkif, req->id, req->operation, BLKIF_RSP_ERROR);
        free_req(pending_req);
+       msleep(1); /* back off a bit */
 } 
 
 
diff -r 71a415f9179b -r c779f9e01072 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c       Fri Jan 18 14:20:59 2008 -0700
+++ b/drivers/xen/blktap/blktap.c       Tue Jan 22 08:31:46 2008 -0700
@@ -52,6 +52,7 @@
 #include <linux/major.h>
 #include <linux/gfp.h>
 #include <linux/poll.h>
+#include <linux/delay.h>
 #include <asm/tlbflush.h>
 
 #define MAX_TAP_DEV 256     /*the maximum number of tapdisk ring devices    */
@@ -1242,6 +1243,11 @@ static int do_block_io_op(blkif_t *blkif
                        break;
                }
 
+               if (kthread_should_stop()) {
+                       more_to_do = 1;
+                       break;
+               }
+
                switch (blkif->blk_protocol) {
                case BLKIF_PROTOCOL_NATIVE:
                        memcpy(&req, RING_GET_REQUEST(&blk_rings->native, rc),
@@ -1270,6 +1276,9 @@ static int do_block_io_op(blkif_t *blkif
                        break;
 
                default:
+                       /* A good sign something is wrong: sleep for a while to
+                        * avoid excessive CPU consumption by a bad guest. */
+                       msleep(1);
                        WPRINTK("unknown operation [%d]\n",
                                req.operation);
                        make_response(blkif, req.id, req.operation,
@@ -1277,6 +1286,9 @@ static int do_block_io_op(blkif_t *blkif
                        free_req(pending_req);
                        break;
                }
+
+               /* Yield point for this unbounded loop. */
+               cond_resched();
        }
                
        blktap_kick_user(blkif->dev_num);
@@ -1503,7 +1515,8 @@ static void dispatch_rw_block_io(blkif_t
  fail_response:
        make_response(blkif, req->id, req->operation, BLKIF_RSP_ERROR);
        free_req(pending_req);
-} 
+       msleep(1); /* back off a bit */
+}
 
 
 
diff -r 71a415f9179b -r c779f9e01072 drivers/xen/core/evtchn.c
--- a/drivers/xen/core/evtchn.c Fri Jan 18 14:20:59 2008 -0700
+++ b/drivers/xen/core/evtchn.c Tue Jan 22 08:31:46 2008 -0700
@@ -215,7 +215,7 @@ static inline void exit_idle(void) {}
  */
 void force_evtchn_callback(void)
 {
-       (void)HYPERVISOR_xen_version(0, NULL);
+       VOID(HYPERVISOR_xen_version(0, NULL));
 }
 /* Not a GPL symbol: used in ubiquitous macros, so too restrictive. */
 EXPORT_SYMBOL(force_evtchn_callback);
@@ -749,14 +749,15 @@ static inline void pirq_unmask_notify(in
 {
        struct physdev_eoi eoi = { .irq = pirq };
        if (unlikely(test_bit(pirq, pirq_needs_eoi)))
-               (void)HYPERVISOR_physdev_op(PHYSDEVOP_eoi, &eoi);
+               VOID(HYPERVISOR_physdev_op(PHYSDEVOP_eoi, &eoi));
 }
 
 static inline void pirq_query_unmask(int pirq)
 {
        struct physdev_irq_status_query irq_status;
        irq_status.irq = pirq;
-       (void)HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status);
+       if (HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status))
+               irq_status.flags = 0;
        clear_bit(pirq, pirq_needs_eoi);
        if (irq_status.flags & XENIRQSTAT_needs_eoi)
                set_bit(pirq, pirq_needs_eoi);
@@ -874,7 +875,8 @@ int irq_ignore_unhandled(unsigned int ir
        if (!is_running_on_xen())
                return 0;
 
-       (void)HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status);
+       if (HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status))
+               return 0;
        return !!(irq_status.flags & XENIRQSTAT_shared);
 }
 
@@ -911,7 +913,7 @@ void unmask_evtchn(int port)
        /* Slow path (hypercall) if this is a non-local port. */
        if (unlikely(cpu != cpu_from_evtchn(port))) {
                struct evtchn_unmask unmask = { .port = port };
-               (void)HYPERVISOR_event_channel_op(EVTCHNOP_unmask, &unmask);
+               VOID(HYPERVISOR_event_channel_op(EVTCHNOP_unmask, &unmask));
                return;
        }
 
diff -r 71a415f9179b -r c779f9e01072 drivers/xen/core/machine_kexec.c
--- a/drivers/xen/core/machine_kexec.c  Fri Jan 18 14:20:59 2008 -0700
+++ b/drivers/xen/core/machine_kexec.c  Tue Jan 22 08:31:46 2008 -0700
@@ -151,7 +151,7 @@ void xen_machine_kexec_unload(struct kim
 
        memset(&xkl, 0, sizeof(xkl));
        xkl.type = image->type;
-       HYPERVISOR_kexec_op(KEXEC_CMD_kexec_unload, &xkl);
+       WARN_ON(HYPERVISOR_kexec_op(KEXEC_CMD_kexec_unload, &xkl));
 }
 
 /*
@@ -168,7 +168,7 @@ NORET_TYPE void machine_kexec(struct kim
 
        memset(&xke, 0, sizeof(xke));
        xke.type = image->type;
-       HYPERVISOR_kexec_op(KEXEC_CMD_kexec, &xke);
+       VOID(HYPERVISOR_kexec_op(KEXEC_CMD_kexec, &xke));
        panic("KEXEC_CMD_kexec hypercall should not return\n");
 }
 
diff -r 71a415f9179b -r c779f9e01072 drivers/xen/core/machine_reboot.c
--- a/drivers/xen/core/machine_reboot.c Fri Jan 18 14:20:59 2008 -0700
+++ b/drivers/xen/core/machine_reboot.c Tue Jan 22 08:31:46 2008 -0700
@@ -60,8 +60,8 @@ static void pre_suspend(void)
 static void pre_suspend(void)
 {
        HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
-       HYPERVISOR_update_va_mapping(fix_to_virt(FIX_SHARED_INFO),
-                                    __pte_ma(0), 0);
+       WARN_ON(HYPERVISOR_update_va_mapping(fix_to_virt(FIX_SHARED_INFO),
+                                            __pte_ma(0), 0));
 
        xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
        xen_start_info->console.domU.mfn =
@@ -88,8 +88,10 @@ static void post_suspend(int suspend_can
        }
 
        shinfo_mfn = xen_start_info->shared_info >> PAGE_SHIFT;
-       HYPERVISOR_update_va_mapping(fix_to_virt(FIX_SHARED_INFO),
-                                    pfn_pte_ma(shinfo_mfn, PAGE_KERNEL), 0);
+       if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_SHARED_INFO),
+                                        pfn_pte_ma(shinfo_mfn, PAGE_KERNEL),
+                                        0))
+               BUG();
        HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
 
        memset(empty_zero_page, 0, PAGE_SIZE);
diff -r 71a415f9179b -r c779f9e01072 drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c     Fri Jan 18 14:20:59 2008 -0700
+++ b/drivers/xen/netback/netback.c     Tue Jan 22 08:31:46 2008 -0700
@@ -142,14 +142,16 @@ static int check_mfn(int nr)
                .extent_order = 0,
                .domid        = DOMID_SELF
        };
+       int rc;
 
        if (likely(alloc_index >= nr))
                return 0;
 
        set_xen_guest_handle(reservation.extent_start, mfn_list + alloc_index);
        reservation.nr_extents = MAX_MFN_ALLOC - alloc_index;
-       alloc_index += HYPERVISOR_memory_op(XENMEM_increase_reservation,
-                                           &reservation);
+       rc = HYPERVISOR_memory_op(XENMEM_increase_reservation, &reservation);
+       if (likely(rc > 0))
+               alloc_index += rc;
 
        return alloc_index >= nr ? 0 : -ENOMEM;
 }
@@ -345,7 +347,7 @@ int xen_network_done(void)
 
 struct netrx_pending_operations {
        unsigned trans_prod, trans_cons;
-       unsigned mmu_prod, mmu_cons;
+       unsigned mmu_prod, mmu_mcl;
        unsigned mcl_prod, mcl_cons;
        unsigned copy_prod, copy_cons;
        unsigned meta_prod, meta_cons;
@@ -601,8 +603,12 @@ static void net_rx_action(unsigned long 
                        break;
        }
 
-       if (npo.mcl_prod &&
-           !xen_feature(XENFEAT_auto_translated_physmap)) {
+       BUG_ON(npo.meta_prod > ARRAY_SIZE(meta));
+
+       npo.mmu_mcl = npo.mcl_prod;
+       if (npo.mcl_prod) {
+               BUG_ON(!xen_feature(XENFEAT_auto_translated_physmap));
+               BUG_ON(npo.mmu_prod > ARRAY_SIZE(rx_mmu));
                mcl = npo.mcl + npo.mcl_prod++;
 
                BUG_ON(mcl[-1].op != __HYPERVISOR_update_va_mapping);
@@ -616,6 +622,7 @@ static void net_rx_action(unsigned long 
        }
 
        if (npo.trans_prod) {
+               BUG_ON(npo.trans_prod > ARRAY_SIZE(grant_trans_op));
                mcl = npo.mcl + npo.mcl_prod++;
                mcl->op = __HYPERVISOR_grant_table_op;
                mcl->args[0] = GNTTABOP_transfer;
@@ -624,6 +631,7 @@ static void net_rx_action(unsigned long 
        }
 
        if (npo.copy_prod) {
+               BUG_ON(npo.copy_prod > ARRAY_SIZE(grant_copy_op));
                mcl = npo.mcl + npo.mcl_prod++;
                mcl->op = __HYPERVISOR_grant_table_op;
                mcl->args[0] = GNTTABOP_copy;
@@ -635,14 +643,12 @@ static void net_rx_action(unsigned long 
        if (!npo.mcl_prod)
                return;
 
-       BUG_ON(npo.copy_prod > NET_RX_RING_SIZE);
-       BUG_ON(npo.mmu_prod > NET_RX_RING_SIZE);
-       BUG_ON(npo.trans_prod > NET_RX_RING_SIZE);
-       BUG_ON(npo.mcl_prod > NET_RX_RING_SIZE+3);
-       BUG_ON(npo.meta_prod > NET_RX_RING_SIZE);
+       BUG_ON(npo.mcl_prod > ARRAY_SIZE(rx_mcl));
 
        ret = HYPERVISOR_multicall(npo.mcl, npo.mcl_prod);
        BUG_ON(ret != 0);
+       /* The mmu_machphys_update() must not fail. */
+       BUG_ON(npo.mmu_mcl && npo.mcl[npo.mmu_mcl].result != 0);
 
        while ((skb = __skb_dequeue(&rxq)) != NULL) {
                nr_frags = *(int *)skb->cb;
diff -r 71a415f9179b -r c779f9e01072 drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Fri Jan 18 14:20:59 2008 -0700
+++ b/drivers/xen/netfront/netfront.c   Tue Jan 22 08:31:46 2008 -0700
@@ -840,11 +840,14 @@ no_skb:
 
                        /* Zap PTEs and give away pages in one big
                         * multicall. */
-                       (void)HYPERVISOR_multicall(np->rx_mcl, i+1);
+                       if (unlikely(HYPERVISOR_multicall(np->rx_mcl, i+1)))
+                               BUG();
 
                        /* Check return status of HYPERVISOR_memory_op(). */
                        if (unlikely(np->rx_mcl[i].result != i))
                                panic("Unable to reduce memory reservation\n");
+                       while (i--)
+                               BUG_ON(np->rx_mcl[i].result);
                } else {
                        if (HYPERVISOR_memory_op(XENMEM_decrease_reservation,
                                                 &reservation) != i)
@@ -1447,8 +1450,10 @@ err:
                        mcl->args[1] = pages_flipped;
                        mcl->args[2] = 0;
                        mcl->args[3] = DOMID_SELF;
-                       (void)HYPERVISOR_multicall(np->rx_mcl,
-                                                  pages_flipped + 1);
+                       err = HYPERVISOR_multicall_check(np->rx_mcl,
+                                                        pages_flipped + 1,
+                                                        NULL);
+                       BUG_ON(err);
                }
        }
 
diff -r 71a415f9179b -r c779f9e01072 drivers/xen/xenoprof/xenoprofile.c
--- a/drivers/xen/xenoprof/xenoprofile.c        Fri Jan 18 14:20:59 2008 -0700
+++ b/drivers/xen/xenoprof/xenoprofile.c        Tue Jan 22 08:31:46 2008 -0700
@@ -346,10 +346,11 @@ static void xenoprof_shutdown(void)
 {
        xenoprof_enabled = 0;
 
-       HYPERVISOR_xenoprof_op(XENOPROF_disable_virq, NULL);
+       WARN_ON(HYPERVISOR_xenoprof_op(XENOPROF_disable_virq, NULL));
 
        if (xenoprof_is_primary) {
-               HYPERVISOR_xenoprof_op(XENOPROF_release_counters, NULL);
+               WARN_ON(HYPERVISOR_xenoprof_op(XENOPROF_release_counters,
+                                              NULL));
                active_defined = 0;
        }
 
@@ -376,7 +377,7 @@ static void xenoprof_stop(void)
 static void xenoprof_stop(void)
 {
        if (xenoprof_is_primary)
-               HYPERVISOR_xenoprof_op(XENOPROF_stop, NULL);
+               WARN_ON(HYPERVISOR_xenoprof_op(XENOPROF_stop, NULL));
        xenoprof_arch_stop();
 }
 
@@ -419,7 +420,8 @@ static int xenoprof_set_active(int * act
 
 out:
        if (ret)
-               HYPERVISOR_xenoprof_op(XENOPROF_reset_active_list, NULL);
+               WARN_ON(HYPERVISOR_xenoprof_op(XENOPROF_reset_active_list,
+                                              NULL));
        active_defined = !ret;
        return ret;
 }
@@ -539,6 +541,6 @@ void xenoprofile_exit(void)
        xenoprof_arch_unmap_shared_buffer(&shared_buffer);
        if (xenoprof_is_primary) {
                unmap_passive_list();
-               HYPERVISOR_xenoprof_op(XENOPROF_shutdown, NULL);
+               WARN_ON(HYPERVISOR_xenoprof_op(XENOPROF_shutdown, NULL));
         }
 }
diff -r 71a415f9179b -r c779f9e01072 include/asm-i386/mach-xen/asm/desc.h
--- a/include/asm-i386/mach-xen/asm/desc.h      Fri Jan 18 14:20:59 2008 -0700
+++ b/include/asm-i386/mach-xen/asm/desc.h      Tue Jan 22 08:31:46 2008 -0700
@@ -111,7 +111,9 @@ extern int write_ldt_entry(void *ldt, in
 
 static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
 {
-#define C(i) 
HYPERVISOR_update_descriptor(virt_to_machine(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN
 + i]), *(u64 *)&t->tls_array[i])
+#define C(i) if 
(HYPERVISOR_update_descriptor(virt_to_machine(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN
 + i]), \
+                                              *(u64 *)&t->tls_array[i])) \
+               BUG();
        C(0); C(1); C(2);
 #undef C
 }
@@ -125,7 +127,7 @@ static inline void clear_LDT(void)
         * it slows down context switching. Noone uses it anyway.
         */
        cpu = cpu;              /* XXX avoid compiler warning */
-       xen_set_ldt(0UL, 0);
+       xen_set_ldt(NULL, 0);
        put_cpu();
 }
 
@@ -140,7 +142,7 @@ static inline void load_LDT_nolock(mm_co
        if (likely(!count))
                segments = NULL;
 
-       xen_set_ldt((unsigned long)segments, count);
+       xen_set_ldt(segments, count);
 }
 
 static inline void load_LDT(mm_context_t *pc)
diff -r 71a415f9179b -r c779f9e01072 include/asm-i386/mach-xen/asm/hypercall.h
--- a/include/asm-i386/mach-xen/asm/hypercall.h Fri Jan 18 14:20:59 2008 -0700
+++ b/include/asm-i386/mach-xen/asm/hypercall.h Tue Jan 22 08:31:46 2008 -0700
@@ -123,14 +123,14 @@
        (type)__res;                                            \
 })
 
-static inline int
+static inline int __must_check
 HYPERVISOR_set_trap_table(
        const trap_info_t *table)
 {
        return _hypercall1(int, set_trap_table, table);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_mmu_update(
        mmu_update_t *req, unsigned int count, unsigned int *success_count,
        domid_t domid)
@@ -138,7 +138,7 @@ HYPERVISOR_mmu_update(
        return _hypercall4(int, mmu_update, req, count, success_count, domid);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_mmuext_op(
        struct mmuext_op *op, unsigned int count, unsigned int *success_count,
        domid_t domid)
@@ -146,21 +146,21 @@ HYPERVISOR_mmuext_op(
        return _hypercall4(int, mmuext_op, op, count, success_count, domid);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_set_gdt(
        unsigned long *frame_list, unsigned int entries)
 {
        return _hypercall2(int, set_gdt, frame_list, entries);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_stack_switch(
        unsigned long ss, unsigned long esp)
 {
        return _hypercall2(int, stack_switch, ss, esp);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_set_callbacks(
        unsigned long event_selector, unsigned long event_address,
        unsigned long failsafe_selector, unsigned long failsafe_address)
@@ -177,21 +177,21 @@ HYPERVISOR_fpu_taskswitch(
        return _hypercall1(int, fpu_taskswitch, set);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_sched_op_compat(
        int cmd, unsigned long arg)
 {
        return _hypercall2(int, sched_op_compat, cmd, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_sched_op(
        int cmd, void *arg)
 {
        return _hypercall2(int, sched_op, cmd, arg);
 }
 
-static inline long
+static inline long __must_check
 HYPERVISOR_set_timer_op(
        u64 timeout)
 {
@@ -200,7 +200,7 @@ HYPERVISOR_set_timer_op(
        return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_platform_op(
        struct xen_platform_op *platform_op)
 {
@@ -208,42 +208,42 @@ HYPERVISOR_platform_op(
        return _hypercall1(int, platform_op, platform_op);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_set_debugreg(
        unsigned int reg, unsigned long value)
 {
        return _hypercall2(int, set_debugreg, reg, value);
 }
 
-static inline unsigned long
+static inline unsigned long __must_check
 HYPERVISOR_get_debugreg(
        unsigned int reg)
 {
        return _hypercall1(unsigned long, get_debugreg, reg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_update_descriptor(
        u64 ma, u64 desc)
 {
        return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_memory_op(
        unsigned int cmd, void *arg)
 {
        return _hypercall2(int, memory_op, cmd, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_multicall(
        multicall_entry_t *call_list, unsigned int nr_calls)
 {
        return _hypercall2(int, multicall, call_list, nr_calls);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_update_va_mapping(
        unsigned long va, pte_t new_val, unsigned long flags)
 {
@@ -255,7 +255,7 @@ HYPERVISOR_update_va_mapping(
                           new_val.pte_low, pte_hi, flags);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_event_channel_op(
        int cmd, void *arg)
 {
@@ -274,28 +274,28 @@ HYPERVISOR_event_channel_op(
        return rc;
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_acm_op(
        int cmd, void *arg)
 {
        return _hypercall2(int, acm_op, cmd, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_xen_version(
        int cmd, void *arg)
 {
        return _hypercall2(int, xen_version, cmd, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_console_io(
        int cmd, unsigned int count, char *str)
 {
        return _hypercall3(int, console_io, cmd, count, str);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_physdev_op(
        int cmd, void *arg)
 {
@@ -314,14 +314,14 @@ HYPERVISOR_physdev_op(
        return rc;
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_grant_table_op(
        unsigned int cmd, void *uop, unsigned int count)
 {
        return _hypercall3(int, grant_table_op, cmd, uop, count);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_update_va_mapping_otherdomain(
        unsigned long va, pte_t new_val, unsigned long flags, domid_t domid)
 {
@@ -333,21 +333,21 @@ HYPERVISOR_update_va_mapping_otherdomain
                           new_val.pte_low, pte_hi, flags, domid);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_vm_assist(
        unsigned int cmd, unsigned int type)
 {
        return _hypercall2(int, vm_assist, cmd, type);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_vcpu_op(
        int cmd, unsigned int vcpuid, void *extra_args)
 {
        return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_suspend(
        unsigned long srec)
 {
@@ -367,15 +367,17 @@ HYPERVISOR_suspend(
        return rc;
 }
 
+#if CONFIG_XEN_COMPAT <= 0x030002
 static inline int
 HYPERVISOR_nmi_op(
        unsigned long op, void *arg)
 {
        return _hypercall2(int, nmi_op, op, arg);
 }
+#endif
 
 #ifndef CONFIG_XEN
-static inline unsigned long
+static inline unsigned long __must_check
 HYPERVISOR_hvm_op(
     int op, void *arg)
 {
@@ -383,21 +385,21 @@ HYPERVISOR_hvm_op(
 }
 #endif
 
-static inline int
+static inline int __must_check
 HYPERVISOR_callback_op(
        int cmd, const void *arg)
 {
        return _hypercall2(int, callback_op, cmd, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_xenoprof_op(
        int op, void *arg)
 {
        return _hypercall2(int, xenoprof_op, op, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_kexec_op(
        unsigned long op, void *args)
 {
diff -r 71a415f9179b -r c779f9e01072 include/asm-i386/mach-xen/asm/hypervisor.h
--- a/include/asm-i386/mach-xen/asm/hypervisor.h        Fri Jan 18 14:20:59 
2008 -0700
+++ b/include/asm-i386/mach-xen/asm/hypervisor.h        Tue Jan 22 08:31:46 
2008 -0700
@@ -105,7 +105,7 @@ void xen_pgd_pin(unsigned long ptr);
 void xen_pgd_pin(unsigned long ptr);
 void xen_pgd_unpin(unsigned long ptr);
 
-void xen_set_ldt(unsigned long ptr, unsigned long bytes);
+void xen_set_ldt(const void *ptr, unsigned int ents);
 
 #ifdef CONFIG_SMP
 #include <linux/cpumask.h>
@@ -175,7 +175,7 @@ HYPERVISOR_block(
        return rc;
 }
 
-static inline int
+static inline void __noreturn
 HYPERVISOR_shutdown(
        unsigned int reason)
 {
@@ -183,17 +183,16 @@ HYPERVISOR_shutdown(
                .reason = reason
        };
 
-       int rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
-
-#if CONFIG_XEN_COMPAT <= 0x030002
-       if (rc == -ENOSYS)
-               rc = HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason);
-#endif
-
-       return rc;
-}
-
-static inline int
+       VOID(HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown));
+#if CONFIG_XEN_COMPAT <= 0x030002
+       VOID(HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason));
+#endif
+       /* Don't recurse needlessly. */
+       BUG_ON(reason != SHUTDOWN_crash);
+       for(;;);
+}
+
+static inline int __must_check
 HYPERVISOR_poll(
        evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
 {
diff -r 71a415f9179b -r c779f9e01072 include/asm-i386/mach-xen/asm/processor.h
--- a/include/asm-i386/mach-xen/asm/processor.h Fri Jan 18 14:20:59 2008 -0700
+++ b/include/asm-i386/mach-xen/asm/processor.h Tue Jan 22 08:31:46 2008 -0700
@@ -513,8 +513,10 @@ static inline void __load_esp0(struct ts
 #define load_esp0(tss, thread) \
        __load_esp0(tss, thread)
 #else
-#define load_esp0(tss, thread) \
-       HYPERVISOR_stack_switch(__KERNEL_DS, (thread)->esp0)
+#define load_esp0(tss, thread) do { \
+       if (HYPERVISOR_stack_switch(__KERNEL_DS, (thread)->esp0)) \
+               BUG(); \
+} while (0)
 #endif
 
 #define start_thread(regs, new_eip, new_esp) do {              \
@@ -534,7 +536,7 @@ static inline void __load_esp0(struct ts
 #define get_debugreg(var, register)                            \
                (var) = HYPERVISOR_get_debugreg((register))
 #define set_debugreg(value, register)                  \
-               HYPERVISOR_set_debugreg((register), (value))
+               WARN_ON(HYPERVISOR_set_debugreg((register), (value)))
 
 /*
  * Set IOPL bits in EFLAGS from given mask
@@ -545,7 +547,7 @@ static inline void set_iopl_mask(unsigne
 
        /* Force the change at ring 0. */
        set_iopl.iopl = (mask == 0) ? 1 : (mask >> 12) & 3;
-       HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl);
+       WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl));
 }
 
 /* Forward declaration, a strange C thing */
diff -r 71a415f9179b -r c779f9e01072 include/asm-x86_64/mach-xen/asm/desc.h
--- a/include/asm-x86_64/mach-xen/asm/desc.h    Fri Jan 18 14:20:59 2008 -0700
+++ b/include/asm-x86_64/mach-xen/asm/desc.h    Tue Jan 22 08:31:46 2008 -0700
@@ -81,7 +81,7 @@ static inline void clear_LDT(void)
         * it slows down context switching. Noone uses it anyway.
         */
        cpu = cpu;              /* XXX avoid compiler warning */
-       xen_set_ldt(0UL, 0);
+       xen_set_ldt(NULL, 0);
        put_cpu();
 }
 
@@ -229,7 +229,9 @@ static inline void load_TLS(struct threa
        gdt[2] = t->tls_array[2];
 #endif
 #define C(i) \
-       
HYPERVISOR_update_descriptor(virt_to_machine(&cpu_gdt(cpu)[GDT_ENTRY_TLS_MIN + 
i]), t->tls_array[i])
+       if 
(HYPERVISOR_update_descriptor(virt_to_machine(&cpu_gdt(cpu)[GDT_ENTRY_TLS_MIN + 
i]), \
+                                                t->tls_array[i])) \
+               BUG();
 
        C(0); C(1); C(2);
 #undef C
@@ -246,7 +248,7 @@ static inline void load_LDT_nolock (mm_c
        if (likely(!count))
                segments = NULL;
 
-       xen_set_ldt((unsigned long)segments, count);
+       xen_set_ldt(segments, count);
 }
 
 static inline void load_LDT(mm_context_t *pc)
diff -r 71a415f9179b -r c779f9e01072 include/asm-x86_64/mach-xen/asm/hypercall.h
--- a/include/asm-x86_64/mach-xen/asm/hypercall.h       Fri Jan 18 14:20:59 
2008 -0700
+++ b/include/asm-x86_64/mach-xen/asm/hypercall.h       Tue Jan 22 08:31:46 
2008 -0700
@@ -129,14 +129,14 @@
        (type)__res;                                            \
 })
 
-static inline int
+static inline int __must_check
 HYPERVISOR_set_trap_table(
        const trap_info_t *table)
 {
        return _hypercall1(int, set_trap_table, table);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_mmu_update(
        mmu_update_t *req, unsigned int count, unsigned int *success_count,
        domid_t domid)
@@ -144,7 +144,7 @@ HYPERVISOR_mmu_update(
        return _hypercall4(int, mmu_update, req, count, success_count, domid);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_mmuext_op(
        struct mmuext_op *op, unsigned int count, unsigned int *success_count,
        domid_t domid)
@@ -152,21 +152,21 @@ HYPERVISOR_mmuext_op(
        return _hypercall4(int, mmuext_op, op, count, success_count, domid);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_set_gdt(
        unsigned long *frame_list, unsigned int entries)
 {
        return _hypercall2(int, set_gdt, frame_list, entries);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_stack_switch(
        unsigned long ss, unsigned long esp)
 {
        return _hypercall2(int, stack_switch, ss, esp);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_set_callbacks(
        unsigned long event_address, unsigned long failsafe_address, 
        unsigned long syscall_address)
@@ -182,28 +182,28 @@ HYPERVISOR_fpu_taskswitch(
        return _hypercall1(int, fpu_taskswitch, set);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_sched_op_compat(
        int cmd, unsigned long arg)
 {
        return _hypercall2(int, sched_op_compat, cmd, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_sched_op(
        int cmd, void *arg)
 {
        return _hypercall2(int, sched_op, cmd, arg);
 }
 
-static inline long
+static inline long __must_check
 HYPERVISOR_set_timer_op(
        u64 timeout)
 {
        return _hypercall1(long, set_timer_op, timeout);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_platform_op(
        struct xen_platform_op *platform_op)
 {
@@ -211,49 +211,49 @@ HYPERVISOR_platform_op(
        return _hypercall1(int, platform_op, platform_op);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_set_debugreg(
        unsigned int reg, unsigned long value)
 {
        return _hypercall2(int, set_debugreg, reg, value);
 }
 
-static inline unsigned long
+static inline unsigned long __must_check
 HYPERVISOR_get_debugreg(
        unsigned int reg)
 {
        return _hypercall1(unsigned long, get_debugreg, reg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_update_descriptor(
        unsigned long ma, unsigned long word)
 {
        return _hypercall2(int, update_descriptor, ma, word);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_memory_op(
        unsigned int cmd, void *arg)
 {
        return _hypercall2(int, memory_op, cmd, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_multicall(
        multicall_entry_t *call_list, unsigned int nr_calls)
 {
        return _hypercall2(int, multicall, call_list, nr_calls);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_update_va_mapping(
        unsigned long va, pte_t new_val, unsigned long flags)
 {
        return _hypercall3(int, update_va_mapping, va, new_val.pte, flags);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_event_channel_op(
        int cmd, void *arg)
 {
@@ -272,28 +272,28 @@ HYPERVISOR_event_channel_op(
        return rc;
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_acm_op(
        int cmd, void *arg)
 {
        return _hypercall2(int, acm_op, cmd, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_xen_version(
        int cmd, void *arg)
 {
        return _hypercall2(int, xen_version, cmd, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_console_io(
        int cmd, unsigned int count, char *str)
 {
        return _hypercall3(int, console_io, cmd, count, str);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_physdev_op(
        int cmd, void *arg)
 {
@@ -312,14 +312,14 @@ HYPERVISOR_physdev_op(
        return rc;
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_grant_table_op(
        unsigned int cmd, void *uop, unsigned int count)
 {
        return _hypercall3(int, grant_table_op, cmd, uop, count);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_update_va_mapping_otherdomain(
        unsigned long va, pte_t new_val, unsigned long flags, domid_t domid)
 {
@@ -327,28 +327,28 @@ HYPERVISOR_update_va_mapping_otherdomain
                           new_val.pte, flags, domid);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_vm_assist(
        unsigned int cmd, unsigned int type)
 {
        return _hypercall2(int, vm_assist, cmd, type);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_vcpu_op(
        int cmd, unsigned int vcpuid, void *extra_args)
 {
        return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_set_segment_base(
        int reg, unsigned long value)
 {
        return _hypercall2(int, set_segment_base, reg, value);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_suspend(
        unsigned long srec)
 {
@@ -368,15 +368,17 @@ HYPERVISOR_suspend(
        return rc;
 }
 
+#if CONFIG_XEN_COMPAT <= 0x030002
 static inline int
 HYPERVISOR_nmi_op(
        unsigned long op, void *arg)
 {
        return _hypercall2(int, nmi_op, op, arg);
 }
+#endif
 
 #ifndef CONFIG_XEN
-static inline unsigned long
+static inline unsigned long __must_check
 HYPERVISOR_hvm_op(
     int op, void *arg)
 {
@@ -384,21 +386,21 @@ HYPERVISOR_hvm_op(
 }
 #endif
 
-static inline int
+static inline int __must_check
 HYPERVISOR_callback_op(
        int cmd, const void *arg)
 {
        return _hypercall2(int, callback_op, cmd, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_xenoprof_op(
        int op, void *arg)
 {
        return _hypercall2(int, xenoprof_op, op, arg);
 }
 
-static inline int
+static inline int __must_check
 HYPERVISOR_kexec_op(
        unsigned long op, void *args)
 {
diff -r 71a415f9179b -r c779f9e01072 include/asm-x86_64/mach-xen/asm/processor.h
--- a/include/asm-x86_64/mach-xen/asm/processor.h       Fri Jan 18 14:20:59 
2008 -0700
+++ b/include/asm-x86_64/mach-xen/asm/processor.h       Tue Jan 22 08:31:46 
2008 -0700
@@ -317,8 +317,10 @@ struct thread_struct {
 
 #define get_debugreg(var, register)                            \
        var = HYPERVISOR_get_debugreg(register)
-#define set_debugreg(value, register)                  \
-       HYPERVISOR_set_debugreg(register, value)
+#define set_debugreg(value, register) do {                     \
+       if (HYPERVISOR_set_debugreg(register, value))           \
+               BUG();                                          \
+} while (0)
 
 struct task_struct;
 struct mm_struct;
diff -r 71a415f9179b -r c779f9e01072 include/xen/evtchn.h
--- a/include/xen/evtchn.h      Fri Jan 18 14:20:59 2008 -0700
+++ b/include/xen/evtchn.h      Tue Jan 22 08:31:46 2008 -0700
@@ -126,7 +126,7 @@ static inline void notify_remote_via_evt
 static inline void notify_remote_via_evtchn(int port)
 {
        struct evtchn_send send = { .port = port };
-       (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send);
+       VOID(HYPERVISOR_event_channel_op(EVTCHNOP_send, &send));
 }
 
 /*
diff -r 71a415f9179b -r c779f9e01072 include/xen/hypercall.h
--- a/include/xen/hypercall.h   Fri Jan 18 14:20:59 2008 -0700
+++ b/include/xen/hypercall.h   Tue Jan 22 08:31:46 2008 -0700
@@ -3,7 +3,7 @@
 
 #include <asm/hypercall.h>
 
-static inline int
+static inline int __must_check
 HYPERVISOR_multicall_check(
        multicall_entry_t *call_list, unsigned int nr_calls,
        const unsigned long *rc_list)
@@ -22,4 +22,9 @@ HYPERVISOR_multicall_check(
        return 0;
 }
 
+/* A construct to ignore the return value of hypercall wrappers in a few
+ * exceptional cases (simply casting the function result to void doesn't
+ * avoid the compiler warning): */
+#define VOID(expr) ((void)((expr)?:0))
+
 #endif /* __XEN_HYPERCALL_H__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] merge with linux-2.6.18-xen.hg (staging), Xen patchbot-linux-2.6.18-xen <=