[PATCH 0/7] RFC Memory tagging support

Wilco Dijkstra Wilco.Dijkstra@arm.com
Mon Jun 15 18:35:41 GMT 2020


Hi,

> memmove in C has
> 
> rettype
> inhibit_loop_to_libcall
> MEMMOVE (a1const void *a1, a2const void *a2, size_t len)
> {
>   unsigned long int dstp = (long int) dest;
>   unsigned long int srcp = (long int) src;
>
>   /* This test makes the forward copying code be used whenever possible.
>      Reduces the working set.  */
>   if (dstp - srcp >= len) /* *Unsigned* compare!  */
>
> How does it work?

It's not a problem. If the move does not overlap, the tags may be different, and
you do a forward or backward copy depending on the tags (which doesn't matter
when there is no overlap!). If the move overlaps and the tags are the same, things
work as expected. If the tags are not the same, MTE will trigger an exception.

Cheers,
Wilco


More information about the Libc-alpha mailing list