[PATCH v3 16/32] arm64: KVM: hypervisor initialization code

Marc Zyngier marc.zyngier at arm.com
Thu May 2 09:28:42 EDT 2013


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 <marc.zyngier at arm.com>
>> ---
>>  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...




More information about the linux-arm-kernel mailing list