From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/6] MMU: don't bail on PAT bits in PTE Date: Sun, 17 May 2009 12:51:40 +0300 Message-ID: <4A0FDE2C.5020305@redhat.com> References: <1242375740-31222-1-git-send-email-agraf@suse.de> <1242375740-31222-2-git-send-email-agraf@suse.de> <1242375740-31222-3-git-send-email-agraf@suse.de> <20090515102507.GA4933@redhat.com> <44CC74E2-96C3-45C6-9412-A252A53C966A@suse.de> <20090515131943.GT9835@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexander Graf , "Michael S. Tsirkin" , kvm@vger.kernel.org To: Joerg Roedel Return-path: Received: from mx2.redhat.com ([66.187.237.31]:48089 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750804AbZEQJvo (ORCPT ); Sun, 17 May 2009 05:51:44 -0400 In-Reply-To: <20090515131943.GT9835@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: Joerg Roedel wrote: > Subject: [PATCH] kvm/mmu: fix reserved bit checking on 4kb pte level > > The reserved bits checking code looks at bit 7 of the pte to determine > if it has to use the mask for a large pte or a normal pde. This does not > work on 4kb pte level because bit 7 is used there for PAT. Account this > in the checking function. > > > static bool is_rsvd_bits_set(struct kvm_vcpu *vcpu, u64 gpte, int level) > { > - int bit7; > + int bit7 = 0; > + > + if (level != PT_PAGE_TABLE_LEVEL) > + bit7 = (gpte >> 7) & 1; > > - bit7 = (gpte >> 7) & 1; > return (gpte & vcpu->arch.mmu.rsvd_bits_mask[bit7][level-1]) != 0; > } > > If we make rsvd_bits_mask[1][0] == rsvd_bits_mask[0][0], we don't need the extra check. That's why it is named bit7 and not pse (need to make sure bit 7 is not reserved in this case). -- error compiling committee.c: too many arguments to function