mbox

[v3,0/8] Memory tagging support

Message ID 20201123154236.25809-1-rearnsha@arm.com
Headers

Message

Richard Earnshaw Nov. 23, 2020, 3:42 p.m. UTC
  This is the third iteration of the patch set to enable memory tagging
in glibc's malloc code.  It mainly addresses the following issues raised
during the previous review:

 - Clean up/add some internal API documentation
 - Remove ROUND_UP_ALLOCATION_SIZE and use some conditionalized code
   in checked_request2size instead.
 - Support MALLOC_CHECK_ in conjuction with _MTAG_ENABLE.

The first two issues are addressed in patch 4 of this series, and the
third in patch 5.  I intend to merge patches 3, 4 and 5 into a single
update to the malloc code before the final commit; I've kept them
separate for now to (hopefully) simplify the review.

The patches have all been rebased against master as of 2020/11/20.

I spent quite a bit of time while working on these looking at whether
the code could be refactored in order to reduce the places where
SIZE_SZ was being added (in different multiples) to various pointers.
I eventually concluded that this wasn't significantly improving the
readability of the code, but one change has survived - I've replaced
usage of 2 * SIZE_SZ with CHUNK_HDR_SZ when it is clear that this is
referring to the header block at the start of a chunk.

I've pushed a copy of this patch series to rearnsha/mte-v3.0, since I
understand some people want to try the patch series as a whole.

R.

Richard Earnshaw (8):
  config: Allow memory tagging to be enabled when configuring glibc
  elf: Add a tunable to control use of tagged memory
  malloc: Basic support for memory tagging in the malloc() family
  malloc: Clean up commentary
  malloc: support MALLOC_CHECK_ in conjunction with _MTAG_ENABLE.
  linux: Add compatibility definitions to sys/prctl.h for MTE
  aarch64: Add sysv specific enabling code for memory tagging
  aarch64: Add aarch64-specific files for memory tagging support

 INSTALL                                       |  14 +
 config.h.in                                   |   3 +
 config.make.in                                |   2 +
 configure                                     |  17 +
 configure.ac                                  |  10 +
 elf/dl-tunables.list                          |   9 +
 malloc/arena.c                                |  59 ++-
 malloc/hooks.c                                |  79 ++--
 malloc/malloc.c                               | 336 ++++++++++++++----
 malloc/malloc.h                               |   7 +
 manual/install.texi                           |  13 +
 manual/tunables.texi                          |  31 ++
 sysdeps/aarch64/Makefile                      |   5 +
 sysdeps/aarch64/__mtag_address_get_tag.S      |  31 ++
 sysdeps/aarch64/__mtag_memset_tag.S           |  46 +++
 sysdeps/aarch64/__mtag_new_tag.S              |  38 ++
 sysdeps/aarch64/__mtag_tag_region.S           |  44 +++
 sysdeps/aarch64/libc-mtag.h                   |  57 +++
 sysdeps/generic/libc-mtag.h                   |  52 +++
 sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h  |   1 +
 sysdeps/unix/sysv/linux/aarch64/bits/mman.h   |   7 +
 .../unix/sysv/linux/aarch64/cpu-features.c    |  28 ++
 .../unix/sysv/linux/aarch64/cpu-features.h    |   1 +
 sysdeps/unix/sysv/linux/sys/prctl.h           |  18 +
 24 files changed, 811 insertions(+), 97 deletions(-)
 create mode 100644 sysdeps/aarch64/__mtag_address_get_tag.S
 create mode 100644 sysdeps/aarch64/__mtag_memset_tag.S
 create mode 100644 sysdeps/aarch64/__mtag_new_tag.S
 create mode 100644 sysdeps/aarch64/__mtag_tag_region.S
 create mode 100644 sysdeps/aarch64/libc-mtag.h
 create mode 100644 sysdeps/generic/libc-mtag.h