Commit b705a277 authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

KVM: x86/mmu: Drop vCPU param from reserved bits calculator

Drop the vCPU param from __reset_rsvds_bits_mask() as it's now unused,
and ideally will remain unused in the future.  Any information that's
needed by the low level helper should be explicitly provided as it's used
for both shadow/host MMUs and guest MMUs, i.e. vCPU state may be
meaningless or simply wrong.
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Message-Id: <20210622175739.3610207-32-seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 4e9c0d80
...@@ -4119,8 +4119,7 @@ static inline bool is_last_gpte(struct kvm_mmu *mmu, ...@@ -4119,8 +4119,7 @@ static inline bool is_last_gpte(struct kvm_mmu *mmu,
#undef PTTYPE #undef PTTYPE
static void static void
__reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, __reset_rsvds_bits_mask(struct rsvd_bits_validate *rsvd_check,
struct rsvd_bits_validate *rsvd_check,
u64 pa_bits_rsvd, int level, bool nx, bool gbpages, u64 pa_bits_rsvd, int level, bool nx, bool gbpages,
bool pse, bool amd) bool pse, bool amd)
{ {
...@@ -4212,7 +4211,7 @@ __reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, ...@@ -4212,7 +4211,7 @@ __reset_rsvds_bits_mask(struct kvm_vcpu *vcpu,
static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu,
struct kvm_mmu *context) struct kvm_mmu *context)
{ {
__reset_rsvds_bits_mask(vcpu, &context->guest_rsvd_check, __reset_rsvds_bits_mask(&context->guest_rsvd_check,
vcpu->arch.reserved_gpa_bits, vcpu->arch.reserved_gpa_bits,
context->root_level, context->nx, context->root_level, context->nx,
guest_cpuid_has(vcpu, X86_FEATURE_GBPAGES), guest_cpuid_has(vcpu, X86_FEATURE_GBPAGES),
...@@ -4292,8 +4291,7 @@ static void reset_shadow_zero_bits_mask(struct kvm_vcpu *vcpu, ...@@ -4292,8 +4291,7 @@ static void reset_shadow_zero_bits_mask(struct kvm_vcpu *vcpu,
WARN_ON_ONCE(context->shadow_root_level < PT32E_ROOT_LEVEL); WARN_ON_ONCE(context->shadow_root_level < PT32E_ROOT_LEVEL);
shadow_zero_check = &context->shadow_zero_check; shadow_zero_check = &context->shadow_zero_check;
__reset_rsvds_bits_mask(vcpu, shadow_zero_check, __reset_rsvds_bits_mask(shadow_zero_check, reserved_hpa_bits(),
reserved_hpa_bits(),
context->shadow_root_level, uses_nx, context->shadow_root_level, uses_nx,
guest_cpuid_has(vcpu, X86_FEATURE_GBPAGES), guest_cpuid_has(vcpu, X86_FEATURE_GBPAGES),
is_pse, is_amd); is_pse, is_amd);
...@@ -4328,8 +4326,7 @@ reset_tdp_shadow_zero_bits_mask(struct kvm_vcpu *vcpu, ...@@ -4328,8 +4326,7 @@ reset_tdp_shadow_zero_bits_mask(struct kvm_vcpu *vcpu,
shadow_zero_check = &context->shadow_zero_check; shadow_zero_check = &context->shadow_zero_check;
if (boot_cpu_is_amd()) if (boot_cpu_is_amd())
__reset_rsvds_bits_mask(vcpu, shadow_zero_check, __reset_rsvds_bits_mask(shadow_zero_check, reserved_hpa_bits(),
reserved_hpa_bits(),
context->shadow_root_level, false, context->shadow_root_level, false,
boot_cpu_has(X86_FEATURE_GBPAGES), boot_cpu_has(X86_FEATURE_GBPAGES),
false, true); false, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment