]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: nSVM: Only copy SVM_MISC_ENABLE_NP from VMCB01's misc_ctl
authorYosry Ahmed <yosry@kernel.org>
Tue, 3 Mar 2026 00:34:19 +0000 (00:34 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 5 Mar 2026 00:09:08 +0000 (16:09 -0800)
commitb6dc21d896a02b5fd305f505a4ec4dad50ecd8fb
tree5497dc050a27d457eace728e72d6652b845a82b8
parentc8123e82725648b1b13103ce3d8066ce13ab81b7
KVM: nSVM: Only copy SVM_MISC_ENABLE_NP from VMCB01's misc_ctl

The 'misc_ctl' field in VMCB02 is taken as-is from VMCB01. However, the
only bit that needs to copied is SVM_MISC_ENABLE_NP, as all other known
bits in misc_ctl are related to SEV guests, and KVM doesn't support
nested virtualization for SEV guests.

Only copy SVM_MISC_ENABLE_NP to harden against future bugs if/when other
bits are set for L1 but should not be set for L2.

Opportunistically add a comment explaining why SVM_MISC_ENABLE_NP is
taken from VMCB01 and not VMCB02.

Suggested-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Yosry Ahmed <yosry@kernel.org>
Link: https://patch.msgid.link/20260303003421.2185681-26-yosry@kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/nested.c