On 30/10/2024 22:59, Jeff Xu wrote: > Apologize in advance that I'm unfamiliar with ARM's POR, up to review > this patch series, so I might ask silly questions or based on wrong > understanding. That's no problem, your input is very welcome! There is no fundamental difference between POR and PKRU AFAIK - the encoding is different, but the principle is the same. The main thing to keep in mind is that POE (the arm64 extension) allows restricting execution in addition to read/write. > It seems that the patch has the same logic as Aruna Ramakrishna > proposed for X86, is this correct ? Yes, patch 1 aims at aligning arm64 with x86 (same behaviour). Going forward I think we should try and keep the arm64 and x86 handling of pkeys as consistent as possible. > In the latest version of x86 change [1], I have a comment if we want > to consider adding a new flag SS_PKEYALTSTACK (see SS_AUTODISARM as an > example) in sigaltstack, and restrict this mechanism (overwriting > PKRU/POR_EL0 and sigframe) to sigaltstack() with SS_PKEYALTSTACK. > There is a subtle difference if we do that, i.e. the existing > signaling handling user might not care or do not use PKEY/POE, and > overwriting PKRU/POR_EL0 and sigframe every time will add extra CPU > time on the signaling delivery, which could be real-time sensitive.