Commit 15ff9a39 authored by Marc Zyngier's avatar Marc Zyngier

arm: Remove the ability to set HYP vectors outside of the decompressor

Although we have to bounce between HYP and SVC to decompress and
relocate the kernel, we don't need to be able to use it in the
kernel itself. So let's drop the functionnality.

Since the vectors are never changed, there is no need to reset them
either, and nobody calls that stub anyway. The last function
(SOFT_RESTART) is still present in order to support kexec.
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parent 59c1d9cc
...@@ -39,8 +39,6 @@ static inline void sync_boot_mode(void) ...@@ -39,8 +39,6 @@ static inline void sync_boot_mode(void)
sync_cache_r(&__boot_cpu_mode); sync_cache_r(&__boot_cpu_mode);
} }
void __hyp_set_vectors(unsigned long phys_vector_base);
void __hyp_reset_vectors(void);
#else #else
#define __boot_cpu_mode (SVC_MODE) #define __boot_cpu_mode (SVC_MODE)
#define sync_boot_mode() #define sync_boot_mode()
...@@ -75,9 +73,6 @@ static inline bool is_kernel_in_hyp_mode(void) ...@@ -75,9 +73,6 @@ static inline bool is_kernel_in_hyp_mode(void)
#define HVC_SET_VECTORS 0 #define HVC_SET_VECTORS 0
#define HVC_SOFT_RESTART 1 #define HVC_SOFT_RESTART 1
#define HVC_RESET_VECTORS 2
#define HVC_STUB_HCALL_NR 3
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
......
...@@ -189,19 +189,19 @@ ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE ...@@ -189,19 +189,19 @@ ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE
ENDPROC(__hyp_stub_install_secondary) ENDPROC(__hyp_stub_install_secondary)
__hyp_stub_do_trap: __hyp_stub_do_trap:
#ifdef ZIMAGE
teq r0, #HVC_SET_VECTORS teq r0, #HVC_SET_VECTORS
bne 1f bne 1f
/* Only the ZIMAGE stubs can change the HYP vectors */
mcr p15, 4, r1, c12, c0, 0 @ set HVBAR mcr p15, 4, r1, c12, c0, 0 @ set HVBAR
b __hyp_stub_exit b __hyp_stub_exit
#endif
1: teq r0, #HVC_SOFT_RESTART 1: teq r0, #HVC_SOFT_RESTART
bne 1f bne 2f
bx r1 bx r1
1: teq r0, #HVC_RESET_VECTORS 2: ldr r0, =HVC_STUB_ERR
beq __hyp_stub_exit
ldr r0, =HVC_STUB_ERR
__ERET __ERET
__hyp_stub_exit: __hyp_stub_exit:
...@@ -210,26 +210,9 @@ __hyp_stub_exit: ...@@ -210,26 +210,9 @@ __hyp_stub_exit:
ENDPROC(__hyp_stub_do_trap) ENDPROC(__hyp_stub_do_trap)
/* /*
* __hyp_set_vectors: Call this after boot to set the initial hypervisor * __hyp_set_vectors is only used when ZIMAGE must bounce between HYP
* vectors as part of hypervisor installation. On an SMP system, this should * and SVC. For the kernel itself, the vectors are set once and for
* be called on each CPU. * all by the stubs.
*
* r0 must be the physical address of the new vector table (which must lie in
* the bottom 4GB of physical address space.
*
* r0 must be 32-byte aligned.
*
* Before calling this, you must check that the stub hypervisor is installed
* everywhere, by waiting for any secondary CPUs to be brought up and then
* checking that BOOT_CPU_MODE_HAVE_HYP(__boot_cpu_mode) is true.
*
* If not, there is a pre-existing hypervisor, some CPUs failed to boot, or
* something else went wrong... in such cases, trying to install a new
* hypervisor is unlikely to work as desired.
*
* When you call into your shiny new hypervisor, sp_hyp will contain junk,
* so you will need to set that to something sensible at the new hypervisor's
* initialisation entry point.
*/ */
ENTRY(__hyp_set_vectors) ENTRY(__hyp_set_vectors)
mov r1, r0 mov r1, r0
...@@ -245,12 +228,6 @@ ENTRY(__hyp_soft_restart) ...@@ -245,12 +228,6 @@ ENTRY(__hyp_soft_restart)
ret lr ret lr
ENDPROC(__hyp_soft_restart) ENDPROC(__hyp_soft_restart)
ENTRY(__hyp_reset_vectors)
mov r0, #HVC_RESET_VECTORS
__HVC(0)
ret lr
ENDPROC(__hyp_reset_vectors)
#ifndef ZIMAGE #ifndef ZIMAGE
.align 2 .align 2
.L__boot_cpu_mode_offset: .L__boot_cpu_mode_offset:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment