Skip to content

Commit 2f89888

Browse files
committed
KVM: SVM: Drop explicit check on MSRPM offset when emulating SEV-ES accesses
Now that msr_write_intercepted() defaults to true, i.e. accurately reflects hardware behavior for out-of-range MSRs, and doesn't WARN (or BUG) on an out-of-range MSR, drop sev_es_prevent_msr_access()'s svm_msrpm_offset() check that guarded against calling msr_write_intercepted() with a "bad" index. Opportunistically clean up the helper's formatting. Link: https://lore.kernel.org/r/20250610225737.156318-25-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 4880919 commit 2f89888

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

arch/x86/kvm/svm/svm.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,12 +2754,11 @@ static int svm_get_feature_msr(u32 msr, u64 *data)
27542754
return 0;
27552755
}
27562756

2757-
static bool
2758-
sev_es_prevent_msr_access(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
2757+
static bool sev_es_prevent_msr_access(struct kvm_vcpu *vcpu,
2758+
struct msr_data *msr_info)
27592759
{
27602760
return sev_es_guest(vcpu->kvm) &&
27612761
vcpu->arch.guest_state_protected &&
2762-
svm_msrpm_offset(msr_info->index) != MSR_INVALID &&
27632762
!msr_write_intercepted(vcpu, msr_info->index);
27642763
}
27652764

0 commit comments

Comments
 (0)