ia64/xen-unstable
changeset 17967:d711529e3de1
Revert incorrectly checked-in changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Jul 04 12:17:33 2008 +0100 (2008-07-04) |
parents | 2922c423a1aa |
children | 9353f9931d96 |
files | xen/arch/x86/traps.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/compat/traps.c xen/arch/x86/x86_64/traps.c |
line diff
1.1 --- a/xen/arch/x86/traps.c Fri Jul 04 12:00:38 2008 +0100 1.2 +++ b/xen/arch/x86/traps.c Fri Jul 04 12:17:33 2008 +0100 1.3 @@ -61,7 +61,6 @@ 1.4 #include <asm/msr.h> 1.5 #include <asm/shared.h> 1.6 #include <asm/x86_emulate.h> 1.7 -#include <asm/traps.h> 1.8 #include <asm/hvm/vpt.h> 1.9 #include <public/arch-x86/cpuid.h> 1.10 1.11 @@ -2679,51 +2678,25 @@ asmlinkage void do_general_protection(st 1.12 panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code); 1.13 } 1.14 1.15 -static DEFINE_PER_CPU(struct softirq_trap, softirq_trap); 1.16 - 1.17 static void nmi_mce_softirq(void) 1.18 { 1.19 - int cpu = smp_processor_id(); 1.20 - struct softirq_trap *st = &per_cpu(softirq_trap, cpu); 1.21 - cpumask_t affinity; 1.22 - 1.23 - BUG_ON(st == NULL); 1.24 - BUG_ON(st->vcpu == NULL); 1.25 - 1.26 - /* Set the tmp value unconditionally, so that 1.27 - * the check in the iret hypercall works. */ 1.28 - st->vcpu->cpu_affinity_tmp = st->vcpu->cpu_affinity; 1.29 - 1.30 - if ((cpu != st->processor) 1.31 - || (st->processor != st->vcpu->processor)) 1.32 - { 1.33 - /* We are on a different physical cpu. 1.34 - * Make sure to wakeup the vcpu on the 1.35 - * specified processor. 1.36 - */ 1.37 - cpus_clear(affinity); 1.38 - cpu_set(st->processor, affinity); 1.39 - vcpu_set_affinity(st->vcpu, &affinity); 1.40 - 1.41 - /* Affinity is restored in the iret hypercall. */ 1.42 - } 1.43 - 1.44 - /* Only used to defer wakeup of domain/vcpu to 1.45 - * a safe (non-NMI/MCE) context. 1.46 - */ 1.47 - vcpu_kick(st->vcpu); 1.48 + /* Only used to defer wakeup of dom0,vcpu0 to a safe (non-NMI) context. */ 1.49 + vcpu_kick(dom0->vcpu[0]); 1.50 } 1.51 1.52 static void nmi_dom0_report(unsigned int reason_idx) 1.53 { 1.54 - struct domain *d = dom0; 1.55 - 1.56 - if ( (d == NULL) || (d->vcpu[0] == NULL) ) 1.57 + struct domain *d; 1.58 + struct vcpu *v; 1.59 + 1.60 + if ( ((d = dom0) == NULL) || ((v = d->vcpu[0]) == NULL) ) 1.61 return; 1.62 1.63 set_bit(reason_idx, nmi_reason(d)); 1.64 1.65 - send_guest_trap(d, 0, TRAP_nmi); 1.66 + /* Not safe to wake a vcpu here, or even to schedule a tasklet! */ 1.67 + if ( !test_and_set_bool(v->nmi_pending) ) 1.68 + raise_softirq(NMI_MCE_SOFTIRQ); 1.69 } 1.70 1.71 asmlinkage void mem_parity_error(struct cpu_user_regs *regs) 1.72 @@ -3037,35 +3010,6 @@ long unregister_guest_nmi_callback(void) 1.73 return 0; 1.74 } 1.75 1.76 -int send_guest_trap(struct domain *d, uint16_t vcpuid, unsigned int trap_nr) 1.77 -{ 1.78 - struct vcpu *v; 1.79 - struct softirq_trap *st; 1.80 - 1.81 - BUG_ON(d == NULL); 1.82 - BUG_ON(vcpuid >= MAX_VIRT_CPUS); 1.83 - v = d->vcpu[vcpuid]; 1.84 - 1.85 - switch (trap_nr) { 1.86 - case TRAP_nmi: 1.87 - if ( !test_and_set_bool(v->nmi_pending) ) { 1.88 - st = &per_cpu(softirq_trap, smp_processor_id()); 1.89 - st->domain = dom0; 1.90 - st->vcpu = dom0->vcpu[0]; 1.91 - st->processor = st->vcpu->processor; 1.92 - 1.93 - /* not safe to wake up a vcpu here */ 1.94 - raise_softirq(NMI_MCE_SOFTIRQ); 1.95 - return 0; 1.96 - } 1.97 - break; 1.98 - } 1.99 - 1.100 - /* delivery failed */ 1.101 - return -EIO; 1.102 -} 1.103 - 1.104 - 1.105 long do_set_trap_table(XEN_GUEST_HANDLE(const_trap_info_t) traps) 1.106 { 1.107 struct trap_info cur;
2.1 --- a/xen/arch/x86/x86_32/traps.c Fri Jul 04 12:00:38 2008 +0100 2.2 +++ b/xen/arch/x86/x86_32/traps.c Fri Jul 04 12:17:33 2008 +0100 2.3 @@ -255,10 +255,6 @@ unsigned long do_iret(void) 2.4 goto exit_and_crash; 2.5 } 2.6 2.7 - /* Restore affinity. */ 2.8 - if (!cpus_equal(v->cpu_affinity_tmp, v->cpu_affinity)) 2.9 - vcpu_set_affinity(v, &v->cpu_affinity_tmp); 2.10 - 2.11 /* No longer in NMI context. */ 2.12 v->nmi_masked = 0; 2.13
3.1 --- a/xen/arch/x86/x86_64/compat/traps.c Fri Jul 04 12:00:38 2008 +0100 3.2 +++ b/xen/arch/x86/x86_64/compat/traps.c Fri Jul 04 12:17:33 2008 +0100 3.3 @@ -121,10 +121,6 @@ unsigned int compat_iret(void) 3.4 else 3.5 regs->_esp += 16; 3.6 3.7 - /* Restore affinity. */ 3.8 - if (!cpus_equal(v->cpu_affinity_tmp, v->cpu_affinity)) 3.9 - vcpu_set_affinity(v, &v->cpu_affinity_tmp); 3.10 - 3.11 /* No longer in NMI context. */ 3.12 v->nmi_masked = 0; 3.13
4.1 --- a/xen/arch/x86/x86_64/traps.c Fri Jul 04 12:00:38 2008 +0100 4.2 +++ b/xen/arch/x86/x86_64/traps.c Fri Jul 04 12:17:33 2008 +0100 4.3 @@ -288,10 +288,6 @@ unsigned long do_iret(void) 4.4 regs->rcx = iret_saved.rcx; 4.5 } 4.6 4.7 - /* Restore affinity. */ 4.8 - if (!cpus_equal(v->cpu_affinity_tmp, v->cpu_affinity)) 4.9 - vcpu_set_affinity(v, &v->cpu_affinity_tmp); 4.10 - 4.11 /* No longer in NMI context. */ 4.12 v->nmi_masked = 0; 4.13