OSDN Git Service

KVM: SVM: Fix dead KVM_BUG() code in LBR MSR virtualization
authorSean Christopherson <seanjc@google.com>
Wed, 7 Jun 2023 20:35:17 +0000 (13:35 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 2 Aug 2023 23:41:54 +0000 (16:41 -0700)
commitd518f8cc10af7a1265595fccf553a3a5f7121e4f
tree77897fb6fafea8df7389ad1893bc293d28fac1f0
parenta6bb5709029756a6151afed0eec26ba2bfabed51
KVM: SVM: Fix dead KVM_BUG() code in LBR MSR virtualization

Refactor KVM's handling of LBR MSRs on SVM to avoid a second layer of
case statements, and thus eliminate a dead KVM_BUG() call, which (a) will
never be hit in the current code base and (b) if a future commit breaks
things, will never fire as KVM passes "false" instead "true" or '1' for
the KVM_BUG() condition.

Reported-by: Michal Luczaj <mhal@rbox.co>
Cc: Yuan Yao <yuan.yao@intel.com>
Link: https://lore.kernel.org/r/20230607203519.1570167-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c