diff options
author | Konrad Rzeszutek Wilk <konrad@kernel.org> | 2013-07-19 11:51:31 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-08-09 10:55:47 -0400 |
commit | 6efa20e49b9cb1db1ab66870cc37323474a75a13 (patch) | |
tree | 9ac97dbad6dc47c4b531809aff3029545847da7f /arch/x86/xen/smp.c | |
parent | c095ba7224d8edc71dcef0d655911399a8bd4a3f (diff) |
xen: Support 64-bit PV guest receiving NMIs
This is based on a patch that Zhenzhong Duan had sent - which
was missing some of the remaining pieces. The kernel has the
logic to handle Xen-type-exceptions using the paravirt interface
in the assembler code (see PARAVIRT_ADJUST_EXCEPTION_FRAME -
pv_irq_ops.adjust_exception_frame and and INTERRUPT_RETURN -
pv_cpu_ops.iret).
That means the nmi handler (and other exception handlers) use
the hypervisor iret.
The other changes that would be neccessary for this would
be to translate the NMI_VECTOR to one of the entries on the
ipi_vector and make xen_send_IPI_mask_allbutself use different
events.
Fortunately for us commit 1db01b4903639fcfaec213701a494fe3fb2c490b
(xen: Clean up apic ipi interface) implemented this and we piggyback
on the cleanup such that the apic IPI interface will pass the right
vector value for NMI.
With this patch we can trigger NMIs within a PV guest (only tested
x86_64).
For this to work with normal PV guests (not initial domain)
we need the domain to be able to use the APIC ops - they are
already implemented to use the Xen event channels. For that
to be turned on in a PV domU we need to remove the masking
of X86_FEATURE_APIC.
Incidentally that means kgdb will also now work within
a PV guest without using the 'nokgdbroundup' workaround.
Note that the 32-bit version is different and this patch
does not enable that.
CC: Lisa Nguyen <lisa@xenapiadmin.com>
CC: Ben Guthro <benjamin.guthro@citrix.com>
CC: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[v1: Fixed up per David Vrabel comments]
Reviewed-by: Ben Guthro <benjamin.guthro@citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'arch/x86/xen/smp.c')
-rw-r--r-- | arch/x86/xen/smp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index ca92754eb846..22759c6d309f 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -572,6 +572,12 @@ static inline int xen_map_vector(int vector) | |||
572 | case IRQ_WORK_VECTOR: | 572 | case IRQ_WORK_VECTOR: |
573 | xen_vector = XEN_IRQ_WORK_VECTOR; | 573 | xen_vector = XEN_IRQ_WORK_VECTOR; |
574 | break; | 574 | break; |
575 | #ifdef CONFIG_X86_64 | ||
576 | case NMI_VECTOR: | ||
577 | case APIC_DM_NMI: /* Some use that instead of NMI_VECTOR */ | ||
578 | xen_vector = XEN_NMI_VECTOR; | ||
579 | break; | ||
580 | #endif | ||
575 | default: | 581 | default: |
576 | xen_vector = -1; | 582 | xen_vector = -1; |
577 | printk(KERN_ERR "xen: vector 0x%x is not implemented\n", | 583 | printk(KERN_ERR "xen: vector 0x%x is not implemented\n", |