From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] Move translate_gpa() initialization for the nested context into init_kvm_nested_mmu() Date: Wed, 8 Jan 2014 19:09:08 -0200 Message-ID: <20140108210908.GC20624@amt.cnet> References: <1388452941-32178-1-git-send-email-zzhsuny@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: gleb@redhat.com, pbonzini@redhat.com, hpa@zytor.com, kvm@vger.kernel.org To: Zhihui Zhang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48644 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757470AbaAHVSd (ORCPT ); Wed, 8 Jan 2014 16:18:33 -0500 Content-Disposition: inline In-Reply-To: <1388452941-32178-1-git-send-email-zzhsuny@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 30, 2013 at 08:22:21PM -0500, Zhihui Zhang wrote: > This is the right place to set the function pointer. In addition, change function name > from translate_nested_gpa() to translate_gpa_nested() to match the naming convention of > other functions (e.g., paging64_gva_to_gpa_nested()). > > Signed-off-by: Zhihui Zhang Why is it the right place? The assignment was executed once per VM-creation, now its executed once per kvm_mmu_reset_context (which is a downside). Another downside is that vcpu->arch.mmu.translate_gpa = translate_gpa; vcpu->arch.nested_mmu.translate_gpa = translate_nested_gpa; You lose this proximity.