Re: [PATCH] KVM: nSVM: Enter guest mode before initializing nested NPT MMU

From: Sean Christopherson
Date: Fri Feb 14 2025 - 19:50:43 EST


On Wed, 29 Jan 2025 17:08:25 -0800, Sean Christopherson wrote:
> When preparing vmcb02 for nested VMRUN (or state restore), "enter" guest
> mode prior to initializing the MMU for nested NPT so that guest_mode is
> set in the MMU's role. KVM's model is that all L2 MMUs are tagged with
> guest_mode, as the behavior of hypervisor MMUs tends to be significantly
> different than kernel MMUs.
>
> Practically speaking, the bug is relatively benign, as KVM only directly
> queries role.guest_mode in kvm_mmu_free_guest_mode_roots(), which SVM
> doesn't use, and in paths that are optimizations (mmu_page_zap_pte() and
> shadow_mmu_try_split_huge_pages()).
>
> [...]

Applied to kvm-x86 fixes, thanks!

[1/1] KVM: nSVM: Enter guest mode before initializing nested NPT MMU
https://github.com/kvm-x86/linux/commit/46d6c6f3ef0e

--
https://github.com/kvm-x86/linux/tree/next