Maran Wilson | 4df7363 | 2018-12-10 11:08:44 -0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Maran Wilson | 8cee397 | 2018-12-10 11:08:45 -0800 | [diff] [blame^] | 2 | #include <linux/acpi.h> |
| 3 | |
| 4 | #include <asm/io_apic.h> |
| 5 | #include <asm/hypervisor.h> |
| 6 | |
| 7 | #include <xen/xen.h> |
| 8 | #include <asm/xen/interface.h> |
| 9 | #include <asm/xen/hypercall.h> |
Maran Wilson | 4df7363 | 2018-12-10 11:08:44 -0800 | [diff] [blame] | 10 | |
| 11 | /* |
| 12 | * PVH variables. |
| 13 | * |
| 14 | * The variable xen_pvh needs to live in the data segment since it is used |
| 15 | * after startup_{32|64} is invoked, which will clear the .bss segment. |
| 16 | */ |
| 17 | bool xen_pvh __attribute__((section(".data"))) = 0; |
Maran Wilson | 8cee397 | 2018-12-10 11:08:45 -0800 | [diff] [blame^] | 18 | |
| 19 | void __init xen_pvh_init(void) |
| 20 | { |
| 21 | u32 msr; |
| 22 | u64 pfn; |
| 23 | |
| 24 | xen_pvh = 1; |
| 25 | xen_start_flags = pvh_start_info.flags; |
| 26 | |
| 27 | msr = cpuid_ebx(xen_cpuid_base() + 2); |
| 28 | pfn = __pa(hypercall_page); |
| 29 | wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32)); |
| 30 | } |