Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754378AbbETUJb (ORCPT ); Wed, 20 May 2015 16:09:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55444 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753779AbbETUJ3 (ORCPT ); Wed, 20 May 2015 16:09:29 -0400 Date: Wed, 20 May 2015 22:09:02 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Takuya Yoshikawa , Xiao Guangrong Subject: Re: [PATCH 8/9] KVM: x86: pass kvm_mmu_page to gfn_to_rmap Message-ID: <20150520200902.GA11631@potion.brq.redhat.com> References: <1432056313-36100-1-git-send-email-pbonzini@redhat.com> <1432056313-36100-9-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432056313-36100-9-git-send-email-pbonzini@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1104 Lines: 31 2015-05-19 19:25+0200, Paolo Bonzini: > This is always available, and later we could also use the role to look > up the right memslots array. > > Signed-off-by: Paolo Bonzini > --- > diff --git a/arch/x86/kvm/mmu_audit.c b/arch/x86/kvm/mmu_audit.c > @@ -192,10 +192,11 @@ static void audit_write_protection(struct kvm *kvm, struct kvm_mmu_page *sp) > u64 *sptep; > struct rmap_iterator iter; > > - if (sp->role.direct || sp->unsync || sp->role.invalid) > + if (sp->role.direct || sp->unsync || sp->role.invalid || > + sp->role.level != PT_PAGE_TABLE_LEVEL) > return; > > - rmapp = gfn_to_rmap(kvm, sp->gfn, PT_PAGE_TABLE_LEVEL); Why were we forcing PT_PAGE_TABLE_LEVEL for all levels? Thanks. > + rmapp = gfn_to_rmap(kvm, sp->gfn, sp); > > for_each_rmap_spte(rmapp, &iter, sptep) > if (is_writable_pte(*sptep)) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/