On 11/08/2022 11:28, Carsten Haitzler wrote:
I'm scratching my head above about compat32. I thought ... we had no 32bit compat? This is more regular aarch64/arm64 64bit compat vs purecap? My brain is going "shouldn't this be compa64 vs compat128?" (I know strictly its 129 bit as an extra cap bit is there too in memory).
I know we're USING the COMPAT32 ifdefs etc. really to mean 64bit non-purecap but it's confusing as above.
Alright maybe a recap then. Good idea to start reading this section [1] of the core Morello doc first, especially the table. There are two possible native ABIs: N1. PCuABI AArch64 (pointer = capability) N2. Standard AArch64 (pointer = 64-bit integer)
There are then two possible compat ABIs: C1. Standard AArch64 (pointer = 64-bit integer), "compat64" C2. AArch32 (pointer = 32-bit integer), "compat32"
You can't actually mix and match, N1 goes with C1 and N2 goes with C2. N2 and C1 are supposed to be exactly the same ABI. There's nothing tricky in the naming, 64 means 64-bit pointers and 32 means 32-bit pointers :) PCuABI is always a native ABI so there is no "compat128".
We do not actually support compat32, as there is no AArch32 on Morello, but to keep things clean we preserve its behaviour by using CONFIG_COMPAT{32,64} (and check that it still builds).
Hopefully that clarifies things!
That's what I thought - in purecap mode we don't have a compat32. The problem is talking about compat32 and it makes you go "eeeh what?" - assuming the person read up a bit on morello and was wondering what was going on.
So what I was bringing up here is that this seems to begin discussing something I thought we were not doing (32bit compat). I can see why you might want to keep the code building in theory. It made me scratch my head and wonder if I had got that right. Perhaps some clarification here would be good?
Yes you're right - my thinking when writing all this was that it's fine to assume a certain level of understanding of the whole approach, but since compat{32,64} are not really documented anywhere, I suppose this document is not a bad place to give some recap, probably at the top. Another improvement for v2, thanks :)
Kevin