]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: x86/mmu: Exempt nested EPT page tables from !USER, CR0.WP=0 logic
authorSean Christopherson <seanjc@google.com>
Mon, 2 Jun 2025 23:48:51 +0000 (16:48 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 20 Jun 2025 20:08:22 +0000 (13:08 -0700)
commitffced89220502faab44ca61e23e6196d09f5f2d4
tree09eb0fe84ca4acc93844f8ec7e2ce5cc635a31fb
parent28224ef02b56fceee2c161fe2a49a0bb197e44f5
KVM: x86/mmu: Exempt nested EPT page tables from !USER, CR0.WP=0 logic

Exempt nested EPT shadow pages tables from the CR0.WP=0 handling of
supervisor writes, as EPT doesn't have a U/S bit and isn't affected by
CR0.WP (or CR4.SMEP in the exception to the exception).

Opportunistically refresh the comment to explain what KVM is doing, as
the only record of why KVM shoves in WRITE and drops USER is buried in
years-old changelogs.

Cc: Jon Kohler <jon@nutanix.com>
Cc: Sergey Dyasli <sergey.dyasli@nutanix.com>
Reviewed-by: Jon Kohler <jon@nutanix.com>
Reviewed-by: Sergey Dyasli <sergey.dyasli@nutanix.com>
Link: https://lore.kernel.org/r/20250602234851.54573-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/mmu/paging_tmpl.h