From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: KVM: MMU: drop read-only large sptes when creating lower level sptes Date: Tue, 25 Feb 2014 09:23:51 +0100 Message-ID: <530C5317.5060406@redhat.com> References: <20140224165932.GA15971@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Xiao Guangrong To: Marcelo Tosatti , kvm-devel Return-path: Received: from mx1.redhat.com ([209.132.183.28]:3782 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751599AbaBYIYB (ORCPT ); Tue, 25 Feb 2014 03:24:01 -0500 In-Reply-To: <20140224165932.GA15971@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Il 24/02/2014 17:59, Marcelo Tosatti ha scritto: > > 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 > > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > index e50425d..9b53135 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, > break; > } > > + drop_large_spte(vcpu, iterator.sptep); > if (!is_shadow_present_pte(*iterator.sptep)) { > u64 base_addr = iterator.addr; > > > Queued for kvm/master, will push as soon as I test it. Thanks, Paolo