From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Christopherson Subject: Re: [PATCH 06/10] KVM/nVMX: Use kvm_vcpu_map when mapping the virtual APIC page Date: Thu, 12 Apr 2018 10:57:42 -0700 Message-ID: <20180412175742.GA14534@linux.intel.com> References: <1519235241-6500-1-git-send-email-karahmed@amazon.de> <1519235241-6500-7-git-send-email-karahmed@amazon.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: KarimAllah Ahmed , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, hpa@zytor.com, jmattson@google.com, mingo@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Thu, Apr 12, 2018 at 04:38:39PM +0200, Paolo Bonzini wrote: > On 21/02/2018 18:47, KarimAllah Ahmed wrote: > > + > > + if (kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->virtual_apic_page_addr), map)) > > + vmcs_write64(VIRTUAL_APIC_PAGE_ADDR, gfn_to_gpa(map->pfn)); > > This should in principle be pfn_to_hpa. However, pfn_to_hpa is unused; > let's just remove it and do "<< PAGE_SHIFT". Unlike gfn_to_gpa, where > in principle the shift could be different, pfn_to_hpa is *by definition* > a shift left by PAGE_SHIFT. Any reason not to use PFN_PHYS instead of the handcoded shift? > Paolo