From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [patch 05/13] KVM: MMU: do not write-protect large mappings Date: Sun, 7 Sep 2008 17:54:36 -0300 Message-ID: <20080907205436.GB14479@dmt.cnet> References: <20080906184822.560099087@localhost.localdomain> <20080906192430.876413489@localhost.localdomain> <48C3993B.3040809@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([66.187.233.31]:37646 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754840AbYIGUzi (ORCPT ); Sun, 7 Sep 2008 16:55:38 -0400 Content-Disposition: inline In-Reply-To: <48C3993B.3040809@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Sep 07, 2008 at 12:04:59PM +0300, Avi Kivity wrote: > Marcelo Tosatti wrote: >> There is not much point in write protecting large mappings. This >> can only happen when a page is shadowed during the window between >> is_largepage_backed and mmu_lock acquision. Zap the entry instead, so >> the next pagefault will find a shadowed page via is_largepage_backed and >> fallback to 4k translations. >> >> Simplifies out of sync shadow. >> >> @@ -1222,6 +1221,14 @@ static void mmu_set_spte(struct kvm_vcpu >> if (write_fault) >> *ptwrite = 1; >> } >> + /* >> + * Do not create write protected large translations. >> + */ >> + if (largepage && has_wrprotected_page(vcpu->kvm, gfn)) { >> + spte = shadow_trap_nonpresent_pte; >> + was_writeble = 0; >> + *ptwrite = 0; >> + } >> } >> > > Why are you clearing was_writable? No idea. Its wrong.