mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
KVM: x86/mmu: use kvm_page_format to test SPTEs
is_access_allowed(), and is_executable_pte() within it, are effectively a special version of permission_fault() that only supports a subset of roles. In particular it does not allow SMEP, SMAP and PKE; while SMAP and PKE are not a problem (they are not supported by EPT/NPT and is_access_allowed() is only used for either EPT/NPT or CR0.PG=0), lack of ring-0 execution checks support means that KVM can only use MBEC and GMET with shadow paging. Replace is_access_allowed() with a modified version of permission_fault(), looking at the same bitmasks but using the struct kvm_mmu's fmt member; the new version supports MBEC/GMET for free, just by virtue of filling in the ACC_* masks from the SPTE. This prepares for a possible future where TDP entries could have XS!=XU, for example as part of implementing Hyper-V VSM natively inside KVM. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6bb13c2eb7
commit
216b1a47e8
3 changed files with 47 additions and 25 deletions
Loading…
Add table
Add a link
Reference in a new issue