KVM: x86/xen: intercept xen hypercalls if enabled
authorJoao Martins <joao.m.martins@oracle.com>
Wed, 13 Jun 2018 13:55:44 +0000 (09:55 -0400)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 4 Feb 2021 14:18:45 +0000 (14:18 +0000)
commit23200b7a30de315d0e9a40663c905869d29d833c
tree4b2959be8858c55698a11fb9e32a77cb397632bc
parent92f4d400a407235783afd4399fa26c4c665024b5
KVM: x86/xen: intercept xen hypercalls if enabled

Add a new exit reason for emulator to handle Xen hypercalls.

Since this means KVM owns the ABI, dispense with the facility for the
VMM to provide its own copy of the hypercall pages; just fill them in
directly using VMCALL/VMMCALL as we do for the Hyper-V hypercall page.

This behaviour is enabled by a new INTERCEPT_HCALL flag in the
KVM_XEN_HVM_CONFIG ioctl structure, and advertised by the same flag
being returned from the KVM_CAP_XEN_HVM check.

Rename xen_hvm_config() to kvm_xen_write_hypercall_page() and move it
to the nascent xen.c while we're at it, and add a test case.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/Makefile
arch/x86/kvm/trace.h
arch/x86/kvm/x86.c
arch/x86/kvm/xen.c [new file with mode: 0644]
arch/x86/kvm/xen.h [new file with mode: 0644]
include/uapi/linux/kvm.h
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/x86_64/xen_vmcall_test.c [new file with mode: 0644]