KVM: x86/xen: Drop RAX[63:32] when processing hypercall
authorSean Christopherson <seanjc@google.com>
Thu, 22 Apr 2021 02:21:26 +0000 (19:21 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 26 Apr 2021 09:27:12 +0000 (05:27 -0400)
commit6b48fd4cb206485c357420d91ea766ef81b20dc3
tree0b659aa59f2b32e3b336e1601d08671b6461d218
parent82277eeed65eed6c6ee5b8f97bd978763eab148f
KVM: x86/xen: Drop RAX[63:32] when processing hypercall

Truncate RAX to 32 bits, i.e. consume EAX, when retrieving the hypecall
index for a Xen hypercall.  Per Xen documentation[*], the index is EAX
when the vCPU is not in 64-bit mode.

[*] http://xenbits.xenproject.org/docs/sphinx-unstable/guest-guide/x86/hypercall-abi.html

Fixes: 23200b7a30de ("KVM: x86/xen: intercept xen hypercalls if enabled")
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210422022128.3464144-8-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/xen.c