I have been porting the Morello compartments demo to Debian linux, cross-compiling with g++ and link with LLVM lld.
I have noticed this attempts to use cheri_pcc_get() to build a capability with same bounds/permissions/tag/flag as the PCC, however in Linux hybrid-cap for me this will only read the address part.
Is this the expected behaviour of cheri_pcc_get() in hybrid?This built-in is being compiled to ADRP <reg> by the gcc compiler. According to the Morello architecture reference, in hybrid then ADRP will only read the offset or value which would seem to make sense. A quick check with clang suggests the builtin is being compiled in the same way.So, this would mean that one of the following is true:
What say you?
ThanksPete(P.S: The port was made to work by using cheri_ddc_get() since that also covers the whole memory range, although that seems a bit of a cludge)
No Jacob you are right, Clang does it properly... apologies, the problem was that to check what clang produced I simply compiled the C code and then used objdump to view the assembly. Unfortunately, as objdump not updated for Morello, the CVTP instruction was not interpreted and so from a quick look the instruction was ADR x8, <value> which I took to be the same as gcc! Did not investigate it further at that time, sorry again for confusion!