]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
kvm: mmu: track read permission explicitly for shadow EPT page tables
authorBandan Das <bsd@redhat.com>
Tue, 12 Jul 2016 22:18:51 +0000 (18:18 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 14 Jul 2016 07:03:50 +0000 (09:03 +0200)
commitd95c55687e11febe3ab1aacfe82b58b1822c52c4
treeef950c000f877fbbc19181bfcfa2f590cecc37ba
parentffb128c89b77b44da18ccf51844a8e750e2c427a
kvm: mmu: track read permission explicitly for shadow EPT page tables

To support execute only mappings on behalf of L1 hypervisors,
reuse ACC_USER_MASK to signify if the L1 hypervisor has the R bit
set.

For the nested EPT case, we assumed that the U bit was always set
since there was no equivalent in EPT page tables.  Strictly
speaking, this was not necessary because handle_ept_violation
never set PFERR_USER_MASK in the error code (uf=0 in the
parlance of update_permission_bitmask).  We now have to set
both U and UF correctly, respectively in FNAME(gpte_access)
and in handle_ept_violation.

Also in handle_ept_violation bit 3 of the exit qualification is
not enough to detect a present PTE; all three bits 3-5 have to
be checked.

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/vmx.c