diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-03-30 11:55:30 +0200 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2017-04-07 16:49:00 +0200 |
commit | ae1e2d1082ae6969ff8c626ef80804d950bf256b (patch) | |
tree | 221bc3b5c7e8352cf07c56418ed61d42a558923c /arch/x86/include/asm/kvm_host.h | |
parent | 86407bcb5c8320add17b57dc6af1586ff8e14bc0 (diff) | |
download | linux-stable-ae1e2d1082ae6969ff8c626ef80804d950bf256b.tar.gz linux-stable-ae1e2d1082ae6969ff8c626ef80804d950bf256b.tar.bz2 linux-stable-ae1e2d1082ae6969ff8c626ef80804d950bf256b.zip |
kvm: nVMX: support EPT accessed/dirty bits
Now use bit 6 of EPTP to optionally enable A/D bits for EPTP. Another
thing to change is that, when EPT accessed and dirty bits are not in use,
VMX treats accesses to guest paging structures as data reads. When they
are in use (bit 6 of EPTP is set), they are treated as writes and the
corresponding EPT dirty bit is set. The MMU didn't know this detail,
so this patch adds it.
We also have to fix up the exit qualification. It may be wrong because
KVM sets bit 6 but the guest might not.
L1 emulates EPT A/D bits using write permissions, so in principle it may
be possible for EPT A/D bits to be used by L1 even though not available
in hardware. The problem is that guest page-table walks will be treated
as reads rather than writes, so they would not cause an EPT violation.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[Fixed typo in walk_addr_generic() comment and changed bit clear +
conditional-set pattern in handle_ept_violation() to conditional-clear]
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_host.h')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 74ef58c8ff53..7dbb8d622683 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -343,9 +343,10 @@ struct kvm_mmu { void (*update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp, u64 *spte, const void *pte); hpa_t root_hpa; - int root_level; - int shadow_root_level; union kvm_mmu_page_role base_role; + u8 root_level; + u8 shadow_root_level; + u8 ept_ad; bool direct_map; /* |