]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: x86/mmu: introduce cpu_role bit for availability of PFEC.I/D
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Apr 2026 15:42:12 +0000 (11:42 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 10 May 2026 12:55:07 +0000 (14:55 +0200)
commit978598a230c16d40b7c8a262bd13c70d433c71bf
tree92b4bc61e2312752542ed7878b729fc70dc7773e
parent4ae0a67231b424d86384621f370730edb8c94c0e
KVM: x86/mmu: introduce cpu_role bit for availability of PFEC.I/D

While GMET looks a lot like SMEP, it has several annoying differences.
The main one is that the availability of the I/D bit in the page fault
error code still depends on the host CR4.SMEP and EFER.NXE bits.  If the
base.cr4_smep bit of the cpu_role is (ab)used to enable GMET, there needs
to be another place where the host CR4.SMEP is read from; just merge it
with EFER.NXE into a new cpu_role bit that tells paging_tmpl.h whether
to set the I/D bit at all.

Tested-by: David Riley <d.riley@proxmox.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/paging_tmpl.h