From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 05/13] KVM: MMU: do not write-protect large mappings Date: Sun, 07 Sep 2008 12:04:59 +0300 Message-ID: <48C3993B.3040809@qumranet.com> References: <20080906184822.560099087@localhost.localdomain> <20080906192430.876413489@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from il.qumranet.com ([212.179.150.194]:58622 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752887AbYIGJFB (ORCPT ); Sun, 7 Sep 2008 05:05:01 -0400 In-Reply-To: <20080906192430.876413489@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: 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? -- error compiling committee.c: too many arguments to function