KVM: x86: Fully re-initialize supported_mce_cap on vendor module load
authorSean Christopherson <seanjc@google.com>
Tue, 23 Apr 2024 16:53:27 +0000 (09:53 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 May 2024 17:07:34 +0000 (13:07 -0400)
commit555485bd86e344b20f3a6582fdbeeab207d08757
tree001b88810c08e22aeb8f1174c9ac2c5ee4317e07
parentc43ad19045d5b7bd3aaf20d9b1f5acb22bdd6a38
KVM: x86: Fully re-initialize supported_mce_cap on vendor module load

Effectively reset supported_mce_cap on vendor module load to ensure that
capabilities aren't unintentionally preserved across module reload, e.g.
if kvm-intel.ko added a module param to control LMCE support, or if
someone somehow managed to load a vendor module that doesn't support LMCE
after loading and unloading kvm-intel.ko.

Practically speaking, this bug is a non-issue as kvm-intel.ko doesn't have
a module param for LMCE, and there is no system in the world that supports
both kvm-intel.ko and kvm-amd.ko.

Fixes: c45dcc71b794 ("KVM: VMX: enable guest access to LMCE related MSRs")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-ID: <20240423165328.2853870-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c