From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [patch 06/10] KVM: x86: trap invlpg Date: Sat, 20 Sep 2008 21:43:55 -0300 Message-ID: <20080921004355.GA10120@dmt.cnet> References: <20080918212749.800177179@localhost.localdomain> <20080918213336.890811059@localhost.localdomain> <48D44982.1000209@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org, "David S. Ahern" To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:40230 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbYIUApI (ORCPT ); Sat, 20 Sep 2008 20:45:08 -0400 Content-Disposition: inline In-Reply-To: <48D44982.1000209@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Sep 19, 2008 at 05:53:22PM -0700, Avi Kivity wrote: > Marcelo Tosatti wrote: >> +static int FNAME(shadow_invlpg_entry)(struct kvm_shadow_walk *_sw, >> + struct kvm_vcpu *vcpu, u64 addr, >> + u64 *sptep, int level) >> +{ >> + >> + if (level == PT_PAGE_TABLE_LEVEL) { >> + if (is_shadow_present_pte(*sptep)) >> + rmap_remove(vcpu->kvm, sptep); >> + set_shadow_pte(sptep, shadow_trap_nonpresent_pte); >> > > Need to flush the real tlb as well. The local TLB you mean? +void kvm_mmu_invlpg(struct kvm_vcpu *vcpu, gva_t gva) +{ + spin_lock(&vcpu->kvm->mmu_lock); + vcpu->arch.mmu.invlpg(vcpu, gva); + spin_unlock(&vcpu->kvm->mmu_lock); + kvm_mmu_flush_tlb(vcpu); +} +EXPORT_SYMBOL_GPL(kvm_mmu_invlpg);