[PATCH 2/6] arm: use propagated hyp stubs

2 views
Skip to first unread message

Ralf Ramsauer

unread,
Jun 12, 2017, 10:18:05 AM6/12/17
to jailho...@googlegroups.com, Jan Kiszka, Ralf Ramsauer
Do no longer use a hvc for getting Linux's hyp-stub vector address. We
now use the address in the hypervisor header.

Signed-off-by: Ralf Ramsauer <ralf.r...@oth-regensburg.de>
---
hypervisor/arch/arm/exception.S | 10 ----------
hypervisor/arch/arm/include/asm/processor.h | 2 --
hypervisor/arch/arm/mmu_hyp.c | 13 +------------
3 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/hypervisor/arch/arm/exception.S b/hypervisor/arch/arm/exception.S
index 3348cecd..8c0ce6a8 100644
--- a/hypervisor/arch/arm/exception.S
+++ b/hypervisor/arch/arm/exception.S
@@ -70,13 +70,3 @@ vmreturn:
/* Restore usr regs */
pop {r0-r12, lr}
eret
-
- /*
- * Hypervisor calling convention follows the AAPCS:
- * r0-r3: arguments
- * r0: return value
- */
- .globl hvc
-hvc:
- hvc #0
- bx lr
diff --git a/hypervisor/arch/arm/include/asm/processor.h b/hypervisor/arch/arm/include/asm/processor.h
index 1ba9e45c..2efac288 100644
--- a/hypervisor/arch/arm/include/asm/processor.h
+++ b/hypervisor/arch/arm/include/asm/processor.h
@@ -39,8 +39,6 @@ struct registers {
#define dsb(domain) asm volatile("dsb " #domain ::: "memory")
#define isb() asm volatile("isb")

-unsigned int hvc(unsigned int r0, ...);
-
static inline void cpu_relax(void)
{
asm volatile("" : : : "memory");
diff --git a/hypervisor/arch/arm/mmu_hyp.c b/hypervisor/arch/arm/mmu_hyp.c
index ef2ec2ae..62fa8ed0 100644
--- a/hypervisor/arch/arm/mmu_hyp.c
+++ b/hypervisor/arch/arm/mmu_hyp.c
@@ -34,9 +34,6 @@ static struct {

extern unsigned long trampoline_start, trampoline_end;

-/* When disabling Jailhouse, we will need to restore the Linux stub */
-static unsigned long saved_vectors = 0;
-
static int set_id_map(int i, unsigned long address, unsigned long size)
{
if (i >= ARRAY_SIZE(id_maps))
@@ -274,14 +271,6 @@ int switch_exception_level(struct per_cpu *cpu_data)
PAGE_DEFAULT_FLAGS);

/*
- * The hypervisor stub allows to fetch its current vector base by doing
- * an HVC with r0 = -1. They will need to be restored when disabling
- * jailhouse.
- */
- if (saved_vectors == 0)
- saved_vectors = hvc(-1);
-
- /*
* paging struct won't be easily accessible when initializing el2, only
* the CPU datas will be readable at their physical address
*/
@@ -363,7 +352,7 @@ void __attribute__((noreturn)) arch_shutdown_mmu(struct per_cpu *cpu_data)
* - reset the vectors
* - return to EL1
*/
- shutdown_fun_phys(regs_phys, saved_vectors);
+ shutdown_fun_phys(regs_phys, hypervisor_header.arm_hyp_info.saved_vector);

__builtin_unreachable();
}
--
2.13.1

Reply all
Reply to author
Forward
0 new messages