xref: /openbmc/qemu/target/i386/kvm/xen-emu.h (revision ddf0fd9a)
1 /*
2  * Xen HVM emulation support in KVM
3  *
4  * Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
5  * Copyright © 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
6  *
7  * This work is licensed under the terms of the GNU GPL, version 2 or later.
8  * See the COPYING file in the top-level directory.
9  *
10  */
11 
12 #ifndef QEMU_I386_KVM_XEN_EMU_H
13 #define QEMU_I386_KVM_XEN_EMU_H
14 
15 #define XEN_HYPERCALL_MSR               0x40000000
16 #define XEN_HYPERCALL_MSR_HYPERV        0x40000200
17 
18 #define XEN_CPUID_SIGNATURE        0
19 #define XEN_CPUID_VENDOR           1
20 #define XEN_CPUID_HVM_MSR          2
21 #define XEN_CPUID_TIME             3
22 #define XEN_CPUID_HVM              4
23 
24 #define XEN_VERSION(maj, min) ((maj) << 16 | (min))
25 
26 int kvm_xen_init(KVMState *s, uint32_t hypercall_msr);
27 int kvm_xen_init_vcpu(CPUState *cs);
28 int kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit);
29 int kvm_put_xen_state(CPUState *cs);
30 int kvm_get_xen_state(CPUState *cs);
31 void kvm_xen_maybe_deassert_callback(CPUState *cs);
32 
33 #endif /* QEMU_I386_KVM_XEN_EMU_H */
34