#
#asahi-dev · 2023-11-28 14:46
DannyB TCR_EL1_DTBI | TCR_EL1_ASID | TCR_EL1_EXTRA)
#asahi-dev · 2023-11-28 14:46
DannyB TCR_TBI0_TOPBYTE_IGNORED | (TCR_TBID0_ENABLE) | TCR_E0PD_VALUE | \
#asahi-dev · 2023-11-28 14:46
DannyB TCR_IRGN1_WRITEBACK | (TCR_TG1_GRANULE_SIZE) | \
#asahi-dev · 2023-11-28 14:46
DannyB TCR_IRGN0_WRITEBACK | (T0SZ_BOOT << TCR_T0SZ_SHIFT) | \
#asahi-dev · 2023-11-28 14:46
DannyB#define TCR_EL1_BASE \
#asahi-dev · 2023-11-28 14:46
DannyB TCR_SH1_OUTER | TCR_ORGN1_WRITEBACK | \
#asahi-dev · 2023-11-28 14:46
DannyB (TCR_IPS_VALUE | TCR_SH0_OUTER | TCR_ORGN0_WRITEBACK | \
#asahi-dev · 2023-11-28 14:46
DannyBBase is
#asahi-dev · 2023-11-28 14:45
DannyB#define TCR_EL1_BOOT (TCR_EL1_BASE | (T1SZ_BOOT << TCR_T1SZ_SHIFT) | (TCR_TG0_GRANULE_SIZE))
#asahi-dev · 2023-11-28 14:45
DannyBit sets it to
#asahi-dev · 2023-11-28 14:45
DannyBYeah
#asahi-dev · 2023-11-28 14:44
svenhm, okay, so probably nothing special then
#asahi-dev · 2023-11-28 14:44
DannyBThey have set the TCR here for years
#asahi-dev · 2023-11-28 14:44
DannyBhttps://github.com/apple-oss-distributions/xnu/blob/xnu-10002.41.9/osfmk/arm64/start.s#L636
#asahi-dev · 2023-11-28 14:44
DannyBThe open source code of this part is actually correct (IE it matches the compiled kernels):
#asahi-dev · 2023-11-28 14:40
svenah, right
#asahi-dev · 2023-11-28 14:39
DannyBthey write it on all m2/m3
#asahi-dev · 2023-11-28 14:39
DannyBit's the first piece of common_start
#asahi-dev · 2023-11-28 14:39
DannyByes
#asahi-dev · 2023-11-28 14:39
svendo they write to TCR in the chicken bit sequence inside xnu? maybe there's some truly weird hw bug where they have to do that specifically ordered w.r.t some chicken bit
#asahi-dev · 2023-11-28 14:38
DannyBin any case, i'll read the ID registers when i get back to the laptop
#asahi-dev · 2023-11-28 14:38
DannyBsince they should be equivalent
#asahi-dev · 2023-11-28 14:38
DannyBif so it would be easier to say "this bit affects all memory accesses"
#asahi-dev · 2023-11-28 14:38
svenhuh, that does sound strange
#asahi-dev · 2023-11-28 14:38
DannyBi guess they mean it has effect if it would be translated if the translation was on, even if translation is off?
#asahi-dev · 2023-11-28 14:37
DannyBwhat does it mean to affect the address generation if they would be translated, but it has effect whether the translation is enabled or not?
#asahi-dev · 2023-11-28 14:37
DannyBis
#asahi-dev · 2023-11-28 14:37
DannyB"This affects addresses generated in EL0 and EL1 using AArch64 where the address would be translated by tables pointed to by TTBR0_EL1. It has an effect whether the EL1&0 translation regime is enabled or not."
#asahi-dev · 2023-11-28 14:37
DannyBBTW, can we talk about how weird
#asahi-dev · 2023-11-28 14:35
mazdumping the id registers would settle it.
#asahi-dev · 2023-11-28 14:35
j`eybut presumably those aren't the issue, if setting everything to 0 is fine..
#asahi-dev · 2023-11-28 14:34
svenMTX should only matter if MTE is available but I don't think the M3 has that
#asahi-dev · 2023-11-28 14:32
DannyBjust MTX1/0 and TBI1/0
#asahi-dev · 2023-11-28 14:32
DannyBi tink that's it
#asahi-dev · 2023-11-28 14:31
DannyBTop byte ignore
#asahi-dev · 2023-11-28 14:31
DannyB"This control has an effect regardless of whether stage 1 of the EL1&0 translation regime is enabled or not."
#asahi-dev · 2023-11-28 14:31
DannyBfor example
#asahi-dev · 2023-11-28 14:31
DannyBMTX0
#asahi-dev · 2023-11-28 14:31
DannyBBut there are things that matter in TCR even with MMU off
#asahi-dev · 2023-11-28 14:31
DannyBsetting it to 0 works
#asahi-dev · 2023-11-28 14:30
j`eyDannyB: have you tried setting TCR to some other value, not the one XNU uses?
#asahi-dev · 2023-11-28 14:30
DannyBThere are things that matter regardless of SCTLR state
#asahi-dev · 2023-11-28 14:30
DannyBon
#asahi-dev · 2023-11-28 14:30
DannyBbecause we would bai and issue a message if SCTLR_M is not
#asahi-dev · 2023-11-28 14:29
DannyBIt's not
#asahi-dev · 2023-11-28 14:29
svenbefore mmu_configure? I don't think so
#asahi-dev · 2023-11-28 14:29
DannyBalso a good question
#asahi-dev · 2023-11-28 14:29
j`eybut the mmu isnt on, right?
#asahi-dev · 2023-11-28 14:29
svenhrm, how would TCR matter before the MMU is on?
#asahi-dev · 2023-11-28 14:28
DannyBwith whatever the TCR is set to initially

plus ›