ARM: KVM: use phys_addr_t instead of unsigned long long for HYP PGDs
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 14 May 2013 11:11:37 +0000 (12:11 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Wed, 26 Jun 2013 17:50:03 +0000 (10:50 -0700)
HYP PGDs are passed around as phys_addr_t, except just before calling
into the hypervisor init code, where they are cast to a rather weird
unsigned long long.

Just keep them around as phys_addr_t, which is what makes the most
sense.

Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
arch/arm/include/asm/kvm_host.h
arch/arm/kvm/arm.c

index ff5aaf10e6ec6a08a5eea644462dfcb94f712c62..1f3cee2e210e6134ce2da44272fd5324ada92ae8 100644 (file)
@@ -190,8 +190,8 @@ int kvm_arm_coproc_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *);
 int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
                int exception_index);
 
-static inline void __cpu_init_hyp_mode(unsigned long long boot_pgd_ptr,
-                                      unsigned long long pgd_ptr,
+static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
+                                      phys_addr_t pgd_ptr,
                                       unsigned long hyp_stack_ptr,
                                       unsigned long vector_ptr)
 {
index 37d216d814cdd62d12040666e70192b0a33fe350..327a1fb70fc9482338bd98a1948e79077f210597 100644 (file)
@@ -789,8 +789,8 @@ long kvm_arch_vm_ioctl(struct file *filp,
 
 static void cpu_init_hyp_mode(void *dummy)
 {
-       unsigned long long boot_pgd_ptr;
-       unsigned long long pgd_ptr;
+       phys_addr_t boot_pgd_ptr;
+       phys_addr_t pgd_ptr;
        unsigned long hyp_stack_ptr;
        unsigned long stack_page;
        unsigned long vector_ptr;
@@ -798,8 +798,8 @@ static void cpu_init_hyp_mode(void *dummy)
        /* Switch from the HYP stub to our own HYP init vector */
        __hyp_set_vectors(kvm_get_idmap_vector());
 
-       boot_pgd_ptr = (unsigned long long)kvm_mmu_get_boot_httbr();
-       pgd_ptr = (unsigned long long)kvm_mmu_get_httbr();
+       boot_pgd_ptr = kvm_mmu_get_boot_httbr();
+       pgd_ptr = kvm_mmu_get_httbr();
        stack_page = __get_cpu_var(kvm_arm_hyp_stack_page);
        hyp_stack_ptr = stack_page + PAGE_SIZE;
        vector_ptr = (unsigned long)__kvm_hyp_vector;