KVM: x86/xen: Fix coexistence of Xen and Hyper-V hypercalls
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:19:24 +0000 (14:19 +0000)
commit79033bebf6fa3045bfa9bbe543c0eb7b43a0f4a3
tree7b1eebd8240021a79f43d43161f69667a1a72863
parent23200b7a30de315d0e9a40663c905869d29d833c
KVM: x86/xen: Fix coexistence of Xen and Hyper-V hypercalls

Disambiguate Xen vs. Hyper-V calls by adding 'orl $0x80000000, %eax'
at the start of the Hyper-V hypercall page when Xen hypercalls are
also enabled.

That bit is reserved in the Hyper-V ABI, and those hypercall numbers
will never be used by Xen (because it does precisely the same trick).

Switch to using kvm_vcpu_write_guest() while we're at it, instead of
open-coding it.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/kvm/hyperv.c
arch/x86/kvm/xen.c
tools/testing/selftests/kvm/x86_64/xen_vmcall_test.c