diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2014-02-24 11:59:32 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-02-26 11:23:32 -0500 |
commit | 404381c5839d67aa0c275ad1da96ef3d3928ca2c (patch) | |
tree | 428dc29ebd433849b621e6238e93e33f9cfca0e2 /arch | |
parent | 6d0abeca3242a88cab8232e4acd7e2bf088f3bc2 (diff) |
KVM: MMU: drop read-only large sptes when creating lower level sptes
Read-only large sptes can be created due to read-only faults as
follows:
- QEMU pagetable entry that maps guest memory is read-only
due to COW.
- Guest read faults such memory, COW is not broken, because
it is a read-only fault.
- Enable dirty logging, large spte not nuked because it is read-only.
- Write-fault on such memory causes guest to loop endlessly
(which must go down to level 1 because dirty logging is enabled).
Fix by dropping large spte when necessary.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/mmu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index e50425d0f5f7..9b531351a587 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -2672,6 +2672,7 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write, | |||
2672 | break; | 2672 | break; |
2673 | } | 2673 | } |
2674 | 2674 | ||
2675 | drop_large_spte(vcpu, iterator.sptep); | ||
2675 | if (!is_shadow_present_pte(*iterator.sptep)) { | 2676 | if (!is_shadow_present_pte(*iterator.sptep)) { |
2676 | u64 base_addr = iterator.addr; | 2677 | u64 base_addr = iterator.addr; |
2677 | 2678 | ||