]> git.proxmox.com Git - mirror_qemu.git/blame - include/sysemu/kvm_xen.h
Merge tag 'pull-request-2023-11-14' of https://gitlab.com/thuth/qemu into staging
[mirror_qemu.git] / include / sysemu / kvm_xen.h
CommitLineData
61491cf4
DW
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_SYSEMU_KVM_XEN_H
13#define QEMU_SYSEMU_KVM_XEN_H
14
d40ddd52
DW
15/* The KVM API uses these to indicate "no GPA" or "no GFN" */
16#define INVALID_GPA UINT64_MAX
17#define INVALID_GFN UINT64_MAX
18
19/* QEMU plays the rôle of dom0 for "interdomain" communication. */
20#define DOMID_QEMU 0
21
79b7067d 22int kvm_xen_soft_reset(void);
61491cf4 23uint32_t kvm_xen_get_caps(void);
27d4075d 24void *kvm_xen_get_vcpu_info_hva(uint32_t vcpu_id);
18e83f28 25bool kvm_xen_has_vcpu_callback_vector(void);
27d4075d 26void kvm_xen_inject_vcpu_callback_vector(uint32_t vcpu_id, int type);
ddf0fd9a 27void kvm_xen_set_callback_asserted(void);
c723d4c1 28int kvm_xen_set_vcpu_virq(uint32_t vcpu_id, uint16_t virq, uint16_t port);
6f43f2ee 29uint16_t kvm_xen_get_gnttab_max_frames(void);
e16aff4c 30uint16_t kvm_xen_get_evtchn_max_pirq(void);
61491cf4
DW
31
32#define kvm_xen_has_cap(cap) (!!(kvm_xen_get_caps() & \
33 KVM_XEN_HVM_CONFIG_ ## cap))
34
8b57d5c5
DW
35#define XEN_SPECIAL_AREA_ADDR 0xfeff8000UL
36#define XEN_SPECIAL_AREA_SIZE 0x4000UL
37
38#define XEN_SPECIALPAGE_CONSOLE 0
39#define XEN_SPECIALPAGE_XENSTORE 1
40
41#define XEN_SPECIAL_PFN(x) ((XEN_SPECIAL_AREA_ADDR >> TARGET_PAGE_BITS) + \
42 XEN_SPECIALPAGE_##x)
43
61491cf4 44#endif /* QEMU_SYSEMU_KVM_XEN_H */