]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: x86/mmu: Snapshot shadow_phys_bits when kvm.ko is loaded
authorSean Christopherson <seanjc@google.com>
Tue, 23 Apr 2024 22:15:20 +0000 (15:15 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 3 Jun 2024 15:58:55 +0000 (08:58 -0700)
commitc043eaaa6be0858a9eb04a168cba84422369e026
tree5932e00e2313b1717113e9893703e4ace6baec8f
parent52c47f5897b69cdde0d23e5102b44eb161fa70a8
KVM: x86/mmu: Snapshot shadow_phys_bits when kvm.ko is loaded

Snapshot shadow_phys_bits when kvm.ko is loaded, not when a vendor module
is loaded, to guard against usage of shadow_phys_bits before it is
initialized.  The computation isn't vendor specific in any way, i.e. there
there is no reason to wait to snapshot the value until a vendor module is
loaded, nor is there any reason to recompute the value every time a vendor
module is loaded.

Opportunistically convert it from "read mostly" to "read-only after init".

Link: https://lore.kernel.org/r/20240423221521.2923759-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/mmu.h
arch/x86/kvm/mmu/spte.c