]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: SVM: Kill the VM instead of the host if MSR interception is buggy
authorSean Christopherson <seanjc@google.com>
Tue, 10 Jun 2025 22:57:11 +0000 (15:57 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 20 Jun 2025 20:05:40 +0000 (13:05 -0700)
commit6353cd685c69f2b3e9a2833f6ff03a8f94c14c0a
tree2547ec8d6784c265559bd679c9cf959623659f4e
parentb241c50c4e30877a7b9dcf2517762748d86e5d47
KVM: SVM: Kill the VM instead of the host if MSR interception is buggy

WARN and kill the VM instead of panicking the host if KVM attempts to set
or query MSR interception for an unsupported MSR.  Accessing the MSR
interception bitmaps only meaningfully affects post-VMRUN behavior, and
KVM_BUG_ON() is guaranteed to prevent the current vCPU from doing VMRUN,
i.e. there is no need to panic the entire host.

Opportunistically move the sanity checks about their use to index into the
MSRPM, e.g. so that bugs only WARN and terminate the VM, as opposed to
doing that _and_ generating an out-of-bounds load.

Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20250610225737.156318-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c