From: Jan Kiszka <jan.kis...@siemens.com>

This will allow to modify the hcr value based on the result of
arm_cpu_init when SDEI is in play.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---
 hypervisor/arch/arm64/setup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hypervisor/arch/arm64/setup.c b/hypervisor/arch/arm64/setup.c
index a24bf1d7..58c90276 100644
--- a/hypervisor/arch/arm64/setup.c
+++ b/hypervisor/arch/arm64/setup.c
@@ -58,13 +58,13 @@ int arch_cpu_init(struct per_cpu *cpu_data)
        /* switch to the permanent page tables */
        enable_mmu_el2(paging_hvirt2phys(cpu_data->pg_structs.root_table));
 
-       /* Setup guest traps */
-       arm_write_sysreg(HCR_EL2, hcr);
-
        err = arm_cpu_init(cpu_data);
        if (err)
                return err;
 
+       /* Setup guest traps */
+       arm_write_sysreg(HCR_EL2, hcr);
+
        /* Conditionally switch to hardened vectors */
        if (this_cpu_data()->smccc_feat_workaround_1 >= ARM_SMCCC_SUCCESS)
                arm_write_sysreg(vbar_el2, &hyp_vectors_hardened);
-- 
2.26.2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/275e855a0b75c03c9162c6a3bb4fe7414bf7e37e.1616139045.git.jan.kiszka%40siemens.com.

Reply via email to