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 fac5e4f9607c..115016347806 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> |
@@ -1357,6 +1359,21 @@ static const struct machine_ops xen_machine_ops __initconst = { | |||
1357 | .emergency_restart = xen_emergency_restart, | 1359 | .emergency_restart = xen_emergency_restart, |
1358 | }; | 1360 | }; |
1359 | 1361 | ||
1362 | static unsigned char xen_get_nmi_reason(void) | ||
1363 | { | ||
1364 | unsigned char reason = 0; | ||
1365 | |||
1366 | /* Construct a value which looks like it came from port 0x61. */ | ||
1367 | if (test_bit(_XEN_NMIREASON_io_error, | ||
1368 | &HYPERVISOR_shared_info->arch.nmi_reason)) | ||
1369 | reason |= NMI_REASON_IOCHK; | ||
1370 | if (test_bit(_XEN_NMIREASON_pci_serr, | ||
1371 | &HYPERVISOR_shared_info->arch.nmi_reason)) | ||
1372 | reason |= NMI_REASON_SERR; | ||
1373 | |||
1374 | return reason; | ||
1375 | } | ||
1376 | |||
1360 | static void __init xen_boot_params_init_edd(void) | 1377 | static void __init xen_boot_params_init_edd(void) |
1361 | { | 1378 | { |
1362 | #if IS_ENABLED(CONFIG_EDD) | 1379 | #if IS_ENABLED(CONFIG_EDD) |
@@ -1541,9 +1558,12 @@ asmlinkage __visible void __init xen_start_kernel(void) | |||
1541 | pv_info = xen_info; | 1558 | pv_info = xen_info; |
1542 | pv_init_ops = xen_init_ops; | 1559 | pv_init_ops = xen_init_ops; |
1543 | pv_apic_ops = xen_apic_ops; | 1560 | pv_apic_ops = xen_apic_ops; |
1544 | if (!xen_pvh_domain()) | 1561 | if (!xen_pvh_domain()) { |
1545 | pv_cpu_ops = xen_cpu_ops; | 1562 | pv_cpu_ops = xen_cpu_ops; |
1546 | 1563 | ||
1564 | x86_platform.get_nmi_reason = xen_get_nmi_reason; | ||
1565 | } | ||
1566 | |||
1547 | if (xen_feature(XENFEAT_auto_translated_physmap)) | 1567 | if (xen_feature(XENFEAT_auto_translated_physmap)) |
1548 | x86_init.resources.memory_setup = xen_auto_xlated_memory_setup; | 1568 | x86_init.resources.memory_setup = xen_auto_xlated_memory_setup; |
1549 | else | 1569 | else |