Hi Manos! On 14.01.26 09:35, Manos Pitsidianakis wrote:
SME2 support adds the following state for HVF guests:- Vector registers Z0, ... , Z31 (introduced by FEAT_SVE but HVF does not support it) - Predicate registers P0, .., P15 (also FEAT_SVE) - ZA register - ZT0 register - PSTATE.{SM,ZA} bits (SVCR pseudo-register) - SMPRI_EL1 which handles the PE's priority in the SMCU - TPIDR2_EL0 the thread local ID register for SME Signed-off-by: Manos Pitsidianakis <[email protected]>
Thanks a lot for the patches. I don't have an M4/M5 handy (yet), so I can't test the code works correctly. But it sounds like you did that, so I have no concerns on functionality.
However, I have concerns on a few maintainability aspects. You #ifdef out a lot of code conditionally on the target macOS version. Any of that code that is in ifdef may or may not end up getting compiled in CI or other test builds, which means you are missing out on a lot of compilation test coverage. As a general rule of thumb, please reduce #ifdef to the bare minimum.
One thing I like to do (when possible) is to use the ifdef to define a global const variable or an inline function. That way the compiler's dead code analysis will eliminate the non-active aspects of your code, but all previous compiler phases still run which means you get syntax checks.
How much of the code down here really does require #ifdefs? And if it's a lot, maybe we just bump the minimum required macOS version instead.
Alex
