Skip to content

Commit 2ef60e6

Browse files
jannaumarcan
authored andcommitted
hv: Use architectural ACTLR_EL12 on M2+ for secondary init
Fixes: 99571e5 ("hv: Use architectural ACTLR_EL12 on M2+") Signed-off-by: Janne Grunau <[email protected]>
1 parent 5c8c3cc commit 2ef60e6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/hv.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ void hv_start(void *entry, u64 regs[4])
137137
hv_secondary_info.apvmkeyhi = mrs(SYS_IMP_APL_APVMKEYHI_EL2);
138138
hv_secondary_info.apsts = mrs(SYS_IMP_APL_APSTS_EL12);
139139
hv_secondary_info.actlr_el2 = mrs(ACTLR_EL2);
140-
hv_secondary_info.actlr_el1 = mrs(SYS_IMP_APL_ACTLR_EL12);
140+
if (cpufeat_actlr_el2)
141+
hv_secondary_info.actlr_el1 = mrs(SYS_ACTLR_EL12);
142+
else
143+
hv_secondary_info.actlr_el1 = mrs(SYS_IMP_APL_ACTLR_EL12);
141144
hv_secondary_info.cnthctl = mrs(CNTHCTL_EL2);
142145
hv_secondary_info.sprr_config = mrs(SYS_IMP_APL_SPRR_CONFIG_EL1);
143146
hv_secondary_info.gxf_config = mrs(SYS_IMP_APL_GXF_CONFIG_EL1);
@@ -198,7 +201,10 @@ static void hv_init_secondary(struct hv_secondary_info_t *info)
198201
msr(SYS_IMP_APL_APVMKEYHI_EL2, info->apvmkeyhi);
199202
msr(SYS_IMP_APL_APSTS_EL12, info->apsts);
200203
msr(ACTLR_EL2, info->actlr_el2);
201-
msr(SYS_IMP_APL_ACTLR_EL12, info->actlr_el1);
204+
if (cpufeat_actlr_el2)
205+
msr(SYS_ACTLR_EL12, info->actlr_el1);
206+
else
207+
msr(SYS_IMP_APL_ACTLR_EL12, info->actlr_el1);
202208
msr(CNTHCTL_EL2, info->cnthctl);
203209
msr(SYS_IMP_APL_SPRR_CONFIG_EL1, info->sprr_config);
204210
msr(SYS_IMP_APL_GXF_CONFIG_EL1, info->gxf_config);

0 commit comments

Comments
 (0)