]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: x86: Manually clear MPX state only on INIT
authorSean Christopherson <seanjc@google.com>
Tue, 12 Aug 2025 02:55:12 +0000 (19:55 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 19 Aug 2025 18:59:50 +0000 (11:59 -0700)
commit41f6710f99f4337924e3929e8e7a51c74f800b91
treeea796f4ce15a349c83c95dd245ea52625825aa23
parentc2aa58b226abf5ac6d355fb1f3b7c4284a7b5cab
KVM: x86: Manually clear MPX state only on INIT

Don't manually clear/zero MPX state on RESET, as the guest FPU state is
zero allocated and KVM only does RESET during vCPU creation, i.e. the
relevant state is guaranteed to be all zeroes.

Opportunistically move the relevant code into a helper in anticipation of
adding support for CET shadow stacks, which also has state that is zeroed
on INIT.

Signed-off-by: Yang Weijiang <weijiang.yang@intel.com>
Tested-by: Mathias Krause <minipli@grsecurity.net>
Tested-by: John Allen <john.allen@amd.com>
Signed-off-by: Chao Gao <chao.gao@intel.com>
Tested-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Link: https://lore.kernel.org/r/20250812025606.74625-5-chao.gao@intel.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/x86.c