Skip to content

Commit

Permalink
hv: Use architectural ACTLR_EL12 on M2+ for secondary init
Browse files Browse the repository at this point in the history
Fixes: 99571e5 ("hv: Use architectural ACTLR_EL12 on M2+")
Signed-off-by: Janne Grunau <j@jannau.net>
  • Loading branch information
jannau committed Sep 23, 2024
1 parent 6a28f05 commit 56bf15d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/hv.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ void hv_start(void *entry, u64 regs[4])
hv_secondary_info.apvmkeyhi = mrs(SYS_IMP_APL_APVMKEYHI_EL2);
hv_secondary_info.apsts = mrs(SYS_IMP_APL_APSTS_EL12);
hv_secondary_info.actlr_el2 = mrs(ACTLR_EL2);
hv_secondary_info.actlr_el1 = mrs(SYS_IMP_APL_ACTLR_EL12);
if (cpufeat_actlr_el2)
hv_secondary_info.actlr_el1 = mrs(SYS_ACTLR_EL12);
else
hv_secondary_info.actlr_el1 = mrs(SYS_IMP_APL_ACTLR_EL12);
hv_secondary_info.cnthctl = mrs(CNTHCTL_EL2);
hv_secondary_info.sprr_config = mrs(SYS_IMP_APL_SPRR_CONFIG_EL1);
hv_secondary_info.gxf_config = mrs(SYS_IMP_APL_GXF_CONFIG_EL1);
Expand Down Expand Up @@ -198,7 +201,10 @@ static void hv_init_secondary(struct hv_secondary_info_t *info)
msr(SYS_IMP_APL_APVMKEYHI_EL2, info->apvmkeyhi);
msr(SYS_IMP_APL_APSTS_EL12, info->apsts);
msr(ACTLR_EL2, info->actlr_el2);
msr(SYS_IMP_APL_ACTLR_EL12, info->actlr_el1);
if (cpufeat_actlr_el2)
msr(SYS_ACTLR_EL12, info->actlr_el1);
else
msr(SYS_IMP_APL_ACTLR_EL12, info->actlr_el1);
msr(CNTHCTL_EL2, info->cnthctl);
msr(SYS_IMP_APL_SPRR_CONFIG_EL1, info->sprr_config);
msr(SYS_IMP_APL_GXF_CONFIG_EL1, info->gxf_config);
Expand Down

0 comments on commit 56bf15d

Please sign in to comment.