================ @@ -625,6 +662,18 @@ NativeRegisterContextLinux_arm64::CacheAllRegisters(uint32_t &cached_size) { error = ReadZA(); if (error.Fail()) return error; + + // We will only be restoring ZT data if ZA is active. As writing to an + // inactive ZT enables ZA, which may not be desireable. + if (GetRegisterInfo().IsZTEnabled() && + m_za_header.size > sizeof(m_za_header)) { ---------------- bulbazord wrote:
The comment and the code are a little confusing to me. Reading the code, it's not obvious that `GetRegisterInfo().IsZTEnabled() && m_za_header.size > sizeof(m_za_header)` checks to see if ZA is active. This reads to me like "if ZT0 is enabled and the za header is filled in correctly". Why is "is ZT0 enabled" a condition if we just need to check ZA? Sorry if this is a noob question, I'm trying to learn more about this so I can help review these patches. 😄 I also see you doing this below, might be good to build an abstraction for this? https://github.com/llvm/llvm-project/pull/70205 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits