From: Joerg Roedel Subject: [PATCH 09/18] KVM: MMU: Let is_rsvd_bits_set take mmu context instead of vcpu Date: Wed, 3 Mar 2010 20:12:12 +0100 Message-ID: <1267643541-451-10-git-send-email-joerg.roedel@amd.com> References: <1267643541-451-1-git-send-email-joerg.roedel@amd.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Alexander Graf , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Joerg Roedel To: Avi Kivity , Marcelo Tosatti Return-path: Received: from va3ehsobe001.messaging.microsoft.com ([216.32.180.11]:38763 "EHLO VA3EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753935Ab0CCTND (ORCPT ); Wed, 3 Mar 2010 14:13:03 -0500 In-Reply-To: <1267643541-451-1-git-send-email-joerg.roedel@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: This patch changes is_rsvd_bits_set() function prototype to take only a kvm_mmu context instead of a full vcpu. Signed-off-by: Joerg Roedel --- arch/x86/kvm/mmu.c | 4 ++-- arch/x86/kvm/paging_tmpl.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 560ecb6..647353d 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2270,12 +2270,12 @@ static void paging_free(struct kvm_vcpu *vcpu) nonpaging_free(vcpu); } -static bool is_rsvd_bits_set(struct kvm_vcpu *vcpu, u64 gpte, int level) +static bool is_rsvd_bits_set(struct kvm_mmu *mmu, u64 gpte, int level) { int bit7; bit7 = (gpte >> 7) & 1; - return (gpte & vcpu->arch.mmu.rsvd_bits_mask[bit7][level-1]) != 0; + return (gpte & mmu->rsvd_bits_mask[bit7][level-1]) != 0; } #define PTTYPE 64 diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 1149daa..8608439 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -158,7 +158,8 @@ walk: if (!is_present_gpte(pte)) goto not_present; - rsvd_fault = is_rsvd_bits_set(vcpu, pte, walker->level); + rsvd_fault = is_rsvd_bits_set(&vcpu->arch.mmu, pte, + walker->level); if (rsvd_fault) goto access_error; -- 1.7.0