]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86/mmu: Use high bits for host/mmu writable masks for EPT SPTEs
authorSean Christopherson <seanjc@google.com>
Thu, 25 Feb 2021 20:47:44 +0000 (12:47 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Feb 2021 13:36:17 +0000 (08:36 -0500)
commita674b9ac0b7766fc4dd3b5980ff175b4188ba1f6
tree08258e4682233457e55bbdbf19556f0593887f37
parentd35673c4e7082758380e17be495ef0463927942a
KVM: x86/mmu: Use high bits for host/mmu writable masks for EPT SPTEs

Use bits 57 and 58 for HOST_WRITABLE and MMU_WRITABLE when using EPT.
This will allow using bit 11 as a constant MMU_PRESENT, which is
desirable as checking for a shadow-present SPTE is one of the most
common SPTE operations in KVM, particular in hot paths such as page
faults.

EPT is short on low available bits; currently only bit 11 is the only
always-available bit.  Bit 10 is also available, but only while KVM
doesn't support mode-based execution.  On the other hand, PAE paging
doesn't have _any_ high available bits.  Thus, using bit 11 is the only
feasible option for MMU_PRESENT.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210225204749.1512652-20-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/spte.c
arch/x86/kvm/mmu/spte.h