From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 4/4] KVM: MMU: Split out the main body of walk_addr_generic() Date: Sun, 12 Jun 2011 18:47:50 +0300 Message-ID: <4DF4DFA6.40807@redhat.com> References: <20110609225949.91cce4a0.takuya.yoshikawa@gmail.com> <20110609230524.346b3d1c.takuya.yoshikawa@gmail.com> <20110609141801.GE21100@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , mtosatti@redhat.com, kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp To: Ingo Molnar Return-path: Received: from mx1.redhat.com ([209.132.183.28]:2708 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753801Ab1FLPsB (ORCPT ); Sun, 12 Jun 2011 11:48:01 -0400 In-Reply-To: <20110609141801.GE21100@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: On 06/09/2011 05:18 PM, Ingo Molnar wrote: > * Takuya Yoshikawa wrote: > > > +/* > > + * do_walk() returns one of these. > > + * > > + * WALK_NEXT: Continue the walk loop. > > + * WALK_DONE: Break from the walk loop. > > + * WALK_RETRY: Retry walk. > > + * WALK_NOT_PRESENT: Set PFERR_PRESENT_MASK and goto error. > > + * WALK_RSVD_FAULT: Set PFERR_RSVD_MASK and goto error. > > + * WALK_ERROR: Goto error. > > + * WALK_ABORT: Return immediately. > > hm, this iterator turned out to be more complex than i thought it > would become. Avi, are you still happy with that? No - a lot of code is spent just communicating between the two functions. Best to leave it in a single function. > > + if ((walker->level == PT_PAGE_TABLE_LEVEL) || > > + ((walker->level == PT_DIRECTORY_LEVEL)&& is_large_pte(*pte)&& > > + (PTTYPE == 64 || is_pse(vcpu))) || > > + ((walker->level == PT_PDPE_LEVEL)&& is_large_pte(*pte)&& > > + (mmu->root_level == PT64_ROOT_LEVEL))) { > > This condition wants to move into a is-pte-large inline function. Better, is_last_gpte(). We already have an is_last_spte(). -- error compiling committee.c: too many arguments to function