KVM: x86/xen: allow vcpu_info to be mapped by fixed HVA
authorPaul Durrant <pdurrant@amazon.com>
Thu, 15 Feb 2024 15:29:08 +0000 (15:29 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 22 Feb 2024 15:01:17 +0000 (07:01 -0800)
commit3991f35805d0f1ad84c3259dc1435021ccf63f16
tree3d4cd345f0a554247d651fac0915231fec4e7103
parentb9220d32799a62c634f7b0b3618da52772626952
KVM: x86/xen: allow vcpu_info to be mapped by fixed HVA

If the guest does not explicitly set the GPA of vcpu_info structure in
memory then, for guests with 32 vCPUs or fewer, the vcpu_info embedded
in the shared_info page may be used. As described in a previous commit,
the shared_info page is an overlay at a fixed HVA within the VMM, so in
this case it also more optimal to activate the vcpu_info cache with a
fixed HVA to avoid unnecessary invalidation if the guest memory layout
is modified.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Link: https://lore.kernel.org/r/20240215152916.1158-14-paul@xen.org
[sean: use kvm_gpc_is_{gpa,hva}_active()]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Documentation/virt/kvm/api.rst
arch/x86/include/uapi/asm/kvm.h
arch/x86/kvm/xen.c