x86/xen: properly retrieve NMI reason
authorJan Beulich <JBeulich@suse.com>
Tue, 13 Jan 2015 07:40:05 +0000 (07:40 +0000)
committerDavid Vrabel <david.vrabel@citrix.com>
Tue, 13 Jan 2015 09:39:50 +0000 (09:39 +0000)
commitf221b04fe07eb56c39935e31bb8e9ddacc00612f
treea0ef5e1a8124bb0b5a85e81bdce67b108dc28ec6
parent9a17ad7f3db17db0c6375de96672f16ab1aa51ae
x86/xen: properly retrieve NMI reason

Using the native code here can't work properly, as the hypervisor would
normally have cleared the two reason bits by the time Dom0 gets to see
the NMI (if passed to it at all). There's a shared info field for this,
and there's an existing hook to use - just fit the two together. This
is particularly relevant so that NMIs intended to be handled by APEI /
GHES actually make it to the respective handler.

Note that the hook can (and should) be used irrespective of whether
being in Dom0, as accessing port 0x61 in a DomU would be even worse,
while the shared info field would just hold zero all the time. Note
further that hardware NMI handling for PVH doesn't currently work
anyway due to missing code in the hypervisor (but it is expected to
work the native rather than the PV way).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
arch/x86/xen/enlighten.c
include/xen/interface/nmi.h [new file with mode: 0644]