aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/x86/kvm/cpuid.h
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-09-24 12:42:49 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-28 07:57:27 -0400
commitdc46515cf838e37c602016cc905df051e06cb8ea (patch)
tree6f9e4f7c7a31dc904007435d3c182f6bcb78cb5d /arch/x86/kvm/cpuid.h
parentKVM: VMX: Replace MSR_IA32_RTIT_OUTPUT_BASE_MASK with helper function (diff)
downloadwireguard-linux-dc46515cf838e37c602016cc905df051e06cb8ea.tar.xz
wireguard-linux-dc46515cf838e37c602016cc905df051e06cb8ea.zip
KVM: x86: Move illegal GPA helper out of the MMU code
Rename kvm_mmu_is_illegal_gpa() to kvm_vcpu_is_illegal_gpa() and move it to cpuid.h so that's it's colocated with cpuid_maxphyaddr(). The helper is not MMU specific and will gain a user that is completely unrelated to the MMU in a future patch. No functional change intended. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Message-Id: <20200924194250.19137-5-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/cpuid.h')
-rw-r--r--arch/x86/kvm/cpuid.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
index 3a923ae15f2f..1d2c4f2e4bb6 100644
--- a/arch/x86/kvm/cpuid.h
+++ b/arch/x86/kvm/cpuid.h
@@ -34,6 +34,11 @@ static inline int cpuid_maxphyaddr(struct kvm_vcpu *vcpu)
return vcpu->arch.maxphyaddr;
}
+static inline bool kvm_vcpu_is_illegal_gpa(struct kvm_vcpu *vcpu, gpa_t gpa)
+{
+ return (gpa >= BIT_ULL(cpuid_maxphyaddr(vcpu)));
+}
+
struct cpuid_reg {
u32 function;
u32 index;