blob: 41a7d6ad74e0d4a11fcbefa307c68b18371cc9ba [file] [log] [blame]
Maran Wilson4df73632018-12-10 11:08:44 -08001// SPDX-License-Identifier: GPL-2.0
Maran Wilson8cee3972018-12-10 11:08:45 -08002#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 Wilson4df73632018-12-10 11:08:44 -080010
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 */
17bool xen_pvh __attribute__((section(".data"))) = 0;
Maran Wilson8cee3972018-12-10 11:08:45 -080018
19void __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}