KVM: VMX: Skip filter updates for MSRs that KVM is already intercepting
authorSean Christopherson <seanjc@google.com>
Fri, 10 Jun 2022 21:41:40 +0000 (21:41 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 15 Jun 2022 12:10:21 +0000 (08:10 -0400)
commitd895f28ed6da96d7b922bd79977e2b732b103a99
treecced00d4ebf7c268403074200b20353bcfb89e7c
parent007a369fba3c120d9a343bb2e8f04cf64c988183
KVM: VMX: Skip filter updates for MSRs that KVM is already intercepting

When handling userspace MSR filter updates, recompute interception for
possible passthrough MSRs if and only if KVM wants to disabled
interception.  If KVM wants to intercept accesses, i.e. the associated
bit is set in vmx->shadow_msr_intercept, then there's no need to set the
intercept again as KVM will intercept the MSR regardless of userspace's
wants.

No functional change intended, the call to vmx_enable_intercept_for_msr()
really is just a gigantic nop.

Suggested-by: Aaron Lewis <aaronlewis@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220610214140.612025-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c