From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: Re: [PATCH v3 16/32] arm64: KVM: hypervisor initialization code Date: Thu, 02 May 2013 14:28:42 +0100 Message-ID: <51826A0A.5040403@arm.com> References: <1365437854-30214-1-git-send-email-marc.zyngier@arm.com> <1365437854-30214-17-git-send-email-marc.zyngier@arm.com> <20130502110356.GA10418@localhost.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Cc: "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , "kvm@vger.kernel.org" , Will Deacon To: Catalin Marinas Return-path: Received: from service87.mimecast.com ([91.220.42.44]:35763 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757877Ab3EBN2r convert rfc822-to-8bit (ORCPT ); Thu, 2 May 2013 09:28:47 -0400 In-Reply-To: <20130502110356.GA10418@localhost.cambridge.arm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 02/05/13 12:03, Catalin Marinas wrote: > On Mon, Apr 08, 2013 at 05:17:18PM +0100, Marc Zyngier wrote: >> Provide EL2 with page tables and stack, and set the vectors >> to point to the full blown world-switch code. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/include/asm/kvm_host.h | 13 +++++ >> arch/arm64/kvm/hyp-init.S | 112 ++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 125 insertions(+) >> create mode 100644 arch/arm64/kvm/hyp-init.S >> >> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h >> index a0279ff..8655de4 100644 >> --- a/arch/arm64/include/asm/kvm_host.h >> +++ b/arch/arm64/include/asm/kvm_host.h >> @@ -183,4 +183,17 @@ int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run, >> int kvm_perf_init(void); >> int kvm_perf_teardown(void); >> >> +static inline void __cpu_init_hyp_mode(unsigned long long boot_pgd_ptr, >> + unsigned long long pgd_ptr, >> + unsigned long hyp_stack_ptr, >> + unsigned long vector_ptr) > > Why some types are long long other others just long? Is it called from > arch/arm/ code? I would rather use phys_addr_t where relevant and > unsigned long where it means a virtual address. Indeed. This is my fault for not pushing the idmap rework far enough. kvm_mmu_get_[boot_]httbr() already return a phys_addr_t, and that should be propagated to __cpu_init_hyp_mode(). I'll cook a patch for 32bit, and update the 64bit code. Thanks for noticing this. M. -- Jazz is not dead. It just smells funny...