Re: [PATCH v2 01/24] New target methods for memory tagging support

Simon Marchi
2020-10-27T13:50:42Z

On 2020-10-27 9:43 a.m., Luis Machado wrote:
> The TAGS vector contains bytes. The interpretation of those bytes is
> target/arch-specific. AArch64 interprets those as 1 tag per byte. Some
> other target or arch may interpret those differently.
>
> Length is the number of bytes in the memory range, which doesn't
> necessarily match the length of the TAGS vector. AArch64 has 1 tag for
> every 16 bytes, for example. So in a 32 bytes memory range, we'd have 2
> bytes in the TAGS vector.
>
> Should I enhance the documentation of those methods to make it a bit
> more clear? I realize some of this is tied to details and terminology of
> the technology.

Ok, that makes sense. I think it would help to say that the contents of
TAGS is target and arch-specific. If the readers want more details,
they'll know they have to dig into the target and arch code. Here in
target_ops sounds like a good place to say it.

>> Also, what does the return values mean?
> My idea was to provide meaningful error codes, as opposed to a bool that
> tells us the it succeeded/failed. Maybe I should make those a bool for
> now given I don't have a standardized list of possible error codes?

If the meaningful error codes allow for better error messages, sure. If
so, I'd suggest using enumerations for the possible return values.

Simon