diff options
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r-- | arch/x86/xen/enlighten.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 6bf3a13e3e0f..78a881b7fc41 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <xen/interface/physdev.h> | 40 | #include <xen/interface/physdev.h> |
41 | #include <xen/interface/vcpu.h> | 41 | #include <xen/interface/vcpu.h> |
42 | #include <xen/interface/memory.h> | 42 | #include <xen/interface/memory.h> |
43 | #include <xen/interface/nmi.h> | ||
43 | #include <xen/interface/xen-mca.h> | 44 | #include <xen/interface/xen-mca.h> |
44 | #include <xen/features.h> | 45 | #include <xen/features.h> |
45 | #include <xen/page.h> | 46 | #include <xen/page.h> |
@@ -66,6 +67,7 @@ | |||
66 | #include <asm/reboot.h> | 67 | #include <asm/reboot.h> |
67 | #include <asm/stackprotector.h> | 68 | #include <asm/stackprotector.h> |
68 | #include <asm/hypervisor.h> | 69 | #include <asm/hypervisor.h> |
70 | #include <asm/mach_traps.h> | ||
69 | #include <asm/mwait.h> | 71 | #include <asm/mwait.h> |
70 | #include <asm/pci_x86.h> | 72 | #include <asm/pci_x86.h> |
71 | #include <asm/pat.h> | 73 | #include <asm/pat.h> |
@@ -1351,6 +1353,21 @@ static const struct machine_ops xen_machine_ops __initconst = { | |||
1351 | .emergency_restart = xen_emergency_restart, | 1353 | .emergency_restart = xen_emergency_restart, |
1352 | }; | 1354 | }; |
1353 | 1355 | ||
1356 | static unsigned char xen_get_nmi_reason(void) | ||
1357 | { | ||
1358 | unsigned char reason = 0; | ||
1359 | |||
1360 | /* Construct a value which looks like it came from port 0x61. */ | ||
1361 | if (test_bit(_XEN_NMIREASON_io_error, | ||
1362 | &HYPERVISOR_shared_info->arch.nmi_reason)) | ||
1363 | reason |= NMI_REASON_IOCHK; | ||
1364 | if (test_bit(_XEN_NMIREASON_pci_serr, | ||
1365 | &HYPERVISOR_shared_info->arch.nmi_reason)) | ||
1366 | reason |= NMI_REASON_SERR; | ||
1367 | |||
1368 | return reason; | ||
1369 | } | ||
1370 | |||
1354 | static void __init xen_boot_params_init_edd(void) | 1371 | static void __init xen_boot_params_init_edd(void) |
1355 | { | 1372 | { |
1356 | #if IS_ENABLED(CONFIG_EDD) | 1373 | #if IS_ENABLED(CONFIG_EDD) |
@@ -1535,9 +1552,12 @@ asmlinkage __visible void __init xen_start_kernel(void) | |||
1535 | pv_info = xen_info; | 1552 | pv_info = xen_info; |
1536 | pv_init_ops = xen_init_ops; | 1553 | pv_init_ops = xen_init_ops; |
1537 | pv_apic_ops = xen_apic_ops; | 1554 | pv_apic_ops = xen_apic_ops; |
1538 | if (!xen_pvh_domain()) | 1555 | if (!xen_pvh_domain()) { |
1539 | pv_cpu_ops = xen_cpu_ops; | 1556 | pv_cpu_ops = xen_cpu_ops; |
1540 | 1557 | ||
1558 | x86_platform.get_nmi_reason = xen_get_nmi_reason; | ||
1559 | } | ||
1560 | |||
1541 | if (xen_feature(XENFEAT_auto_translated_physmap)) | 1561 | if (xen_feature(XENFEAT_auto_translated_physmap)) |
1542 | x86_init.resources.memory_setup = xen_auto_xlated_memory_setup; | 1562 | x86_init.resources.memory_setup = xen_auto_xlated_memory_setup; |
1543 | else | 1563 | else |