diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8fa78c0dd..6e12ddee4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: - name: Build run: make -k -j2 ARCH=aarch64-linux-gnu- CHAINLOADING=1 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: m1n1 path: | diff --git a/proxyclient/m1n1/hv/__init__.py b/proxyclient/m1n1/hv/__init__.py index 451763d22..3abe05765 100644 --- a/proxyclient/m1n1/hv/__init__.py +++ b/proxyclient/m1n1/hv/__init__.py @@ -1441,9 +1441,13 @@ def init(self): self.map_vuart() - actlr = ACTLR(self.u.mrs(ACTLR_EL12)) + # ACTLR depends on the CPU part + part = MIDR(self.u.mrs(MIDR_EL1)).PART + actlr_el12 = ACTLR_EL12 if part >= MIDR_PART.T8110_BLIZZARD else ACTLR_EL12_PRE + + actlr = ACTLR(self.u.mrs(actlr_el12)) actlr.EnMDSB = 1 - self.u.msr(ACTLR_EL12, actlr.value) + self.u.msr(actlr_el12, actlr.value) self.setup_adt() diff --git a/proxyclient/m1n1/sysreg.py b/proxyclient/m1n1/sysreg.py index fd4a3078e..f0a1d6025 100644 --- a/proxyclient/m1n1/sysreg.py +++ b/proxyclient/m1n1/sysreg.py @@ -379,5 +379,13 @@ class TLBI_RVA(Register64): TTL = 38, 37 BaseADDR = 36, 0 +class MIDR_PART(IntEnum): + T8110_BLIZZARD = 0x30 + +class MIDR(Register64): + REV_LOW = 3, 0 + PART = 15, 4 + REV_HIGH = 23, 20 + __all__.extend(k for k, v in globals().items() if (callable(v) or isinstance(v, type)) and v.__module__ == __name__) diff --git a/src/hv.c b/src/hv.c index 5179bf7b1..a653cfd8e 100644 --- a/src/hv.c +++ b/src/hv.c @@ -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); @@ -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);