From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v2 7/9] KVM: MMU: Optimize is_last_gpte() Date: Wed, 19 Sep 2012 20:17:43 +0300 Message-ID: <5059FE37.1010205@redhat.com> References: <1347797235-20732-1-git-send-email-avi@redhat.com> <1347797235-20732-8-git-send-email-avi@redhat.com> <50582467.9080706@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Xiao Guangrong Return-path: Received: from mx1.redhat.com ([209.132.183.28]:6426 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756570Ab2ISRRr (ORCPT ); Wed, 19 Sep 2012 13:17:47 -0400 In-Reply-To: <50582467.9080706@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 09/18/2012 10:36 AM, Xiao Guangrong wrote: > On 09/16/2012 08:07 PM, Avi Kivity wrote: >> Instead of branchy code depending on level, gpte.ps, and mmu configuration, >> prepare everything in a bitmap during mode changes and look it up during >> runtime. >> > > Avi, > > Can we introduce ignore_bits_mask[] (like rsvd_bits_mask), if pse is not supported, > we can set PTE_PSE in this ignore_bits_mask, then the function can be simplified to > > return (level == 1) || gpte & ~vcpu->ignore_bits_mask[level] & PTE_PSE > > I think it is more readable. It's more readable, yes, but those loads do show up in profiles. So I'd like to avoid them unless they save a lot of code. -- error compiling committee.c: too many arguments to function