From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/2] KVM: MMU: handle 'map_writable' in set_spte() function Date: Sun, 26 Dec 2010 14:20:42 +0200 Message-ID: <4D17331A.6090802@redhat.com> References: <4D130383.30406@cn.fujitsu.com> <4D1303B9.3080801@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , KVM , LKML To: Xiao Guangrong Return-path: In-Reply-To: <4D1303B9.3080801@cn.fujitsu.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 12/23/2010 10:09 AM, Xiao Guangrong wrote: > Move the operation of 'writable' to set_spte() to clean up code > Thanks, applied. > @@ -809,12 +806,8 @@ static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp) > > nr_present++; > pte_access = sp->role.access& FNAME(gpte_access)(vcpu, gpte); > - if (!(sp->spt[i]& SPTE_HOST_WRITEABLE)) { > - pte_access&= ~ACC_WRITE_MASK; > - host_writable = 0; > - } else { > - host_writable = 1; > - } > + host_writable = !!(sp->spt[i]& SPTE_HOST_WRITEABLE); > + Note, !! is unneeded when assigning to a boolean variable. I removed it. -- error compiling committee.c: too many arguments to function