arm64: KVM: remove __kvm_hyp_code_{start,end} from hyp.S
authorMarc Zyngier <marc.zyngier@arm.com>
Wed, 26 Jun 2013 14:16:40 +0000 (15:16 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Fri, 11 Jul 2014 11:57:35 +0000 (04:57 -0700)
We already have __hyp_text_{start,end} to express the boundaries
of the HYP text section, and __kvm_hyp_code_{start,end} are getting
in the way of a more modular world switch code.

Just turn __kvm_hyp_code_{start,end} into #defines mapping the
linker-emited symbols.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/include/asm/kvm_asm.h
arch/arm64/include/asm/virt.h
arch/arm64/kvm/hyp.S

index 9fcd54b1e16d8800ffec64a249cb55739c88b058..d0bfc4ba82c0d23754dd8a488b7340db03d46788 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef __ARM_KVM_ASM_H__
 #define __ARM_KVM_ASM_H__
 
+#include <asm/virt.h>
+
 /*
  * 0 is reserved as an invalid value.
  * Order *must* be kept in sync with the hyp switch code.
@@ -96,8 +98,8 @@ extern char __kvm_hyp_init_end[];
 
 extern char __kvm_hyp_vector[];
 
-extern char __kvm_hyp_code_start[];
-extern char __kvm_hyp_code_end[];
+#define        __kvm_hyp_code_start    __hyp_text_start
+#define        __kvm_hyp_code_end      __hyp_text_end
 
 extern void __kvm_flush_vm_context(void);
 extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
index 215ad4649dd7d7492c7d566fda85146359291c20..7a5df5252dd736e4038e04e40510351820056183 100644 (file)
@@ -50,6 +50,10 @@ static inline bool is_hyp_mode_mismatched(void)
        return __boot_cpu_mode[0] != __boot_cpu_mode[1];
 }
 
+/* The section containing the hypervisor text */
+extern char __hyp_text_start[];
+extern char __hyp_text_end[];
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* ! __ASM__VIRT_H */
index 877d82a134bc8f728f32bd7368debafdcb5525fb..9c5d0acb36540f93b3e954010eeb03ba7b2aa038 100644 (file)
@@ -36,9 +36,6 @@
        .pushsection    .hyp.text, "ax"
        .align  PAGE_SHIFT
 
-__kvm_hyp_code_start:
-       .globl __kvm_hyp_code_start
-
 .macro save_common_regs
        // x2: base address for cpu context
        // x3: tmp register
@@ -880,7 +877,4 @@ ENTRY(__kvm_hyp_vector)
        ventry  el1_error_invalid               // Error 32-bit EL1
 ENDPROC(__kvm_hyp_vector)
 
-__kvm_hyp_code_end:
-       .globl  __kvm_hyp_code_end
-
        .popsection