Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: x86/mmu: Ignore CR0 and CR4 bits in nested EPT MMU role

Do not incorporate CR0/CR4 bits into the role for the nested EPT MMU, as
EPT behavior is not influenced by CR0/CR4. Note, this is the guest_mmu,
(L1's EPT), not nested_mmu (L2's IA32 paging); the nested_mmu does need
CR0/CR4, and is initialized in a separate flow.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210622175739.3610207-23-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Sean Christopherson and committed by
Paolo Bonzini
cd6767c3 af098972

+3 -1
+3 -1
arch/x86/kvm/mmu/mmu.c
··· 4767 4767 role.base.guest_mode = true; 4768 4768 role.base.access = ACC_ALL; 4769 4769 4770 - role.ext = kvm_calc_mmu_role_ext(vcpu); 4770 + /* EPT, and thus nested EPT, does not consume CR0, CR4, nor EFER. */ 4771 + role.ext.word = 0; 4771 4772 role.ext.execonly = execonly; 4773 + role.ext.valid = 1; 4772 4774 4773 4775 return role; 4774 4776 }