diff --git a/elf/dl-tunables.list b/elf/dl-tunables.list index 0d398dd251..92b6f21b44 100644 --- a/elf/dl-tunables.list +++ b/elf/dl-tunables.list @@ -126,4 +126,13 @@ glibc { default: 3 } } + + memtag { + enable { + type: INT_32 + minval: 0 + maxval: 255 + env_alias: _MTAG_ENABLE + } + } } diff --git a/manual/tunables.texi b/manual/tunables.texi index ec18b10834..428a0918e6 100644 --- a/manual/tunables.texi +++ b/manual/tunables.texi @@ -35,6 +35,8 @@ their own namespace. * POSIX Thread Tunables:: Tunables in the POSIX thread subsystem * Hardware Capability Tunables:: Tunables that modify the hardware capabilities seen by @theglibc{} +* Memory Tagging Tunables:: Tunables that control the use of hardware + memory tagging @end menu @node Tunable names @@ -423,3 +425,32 @@ instead. This tunable is specific to i386 and x86-64. @end deftp + +@node Memory Tagging Tunables +@section Memory Tagging Tunables +@cindex memory tagging tunables + +@deftp {Tunable namespace} glibc.memtag +If the hardware supports memory tagging, these tunables can be used to +control the way @theglibc{} uses this feature. Currently, only AArch64 +supports this feature. +@end deftp + +@deftp Tunable glibc.memtag.enable +This tunable takes a value between 0 and 255 and acts as a bitmask +that enables various capabilities. + +Bit 0 (the least significant bit) causes the malloc subsystem to allocate +tagged memory, with each allocation being assigned a random tag. + +Bit 1 enables precise faulting mode for tag violations on systems that +support deferred tag violation reporting. This may cause programs +to run more slowly. + +Other bits are currently reserved. + +@Theglibc{} startup code will automatically enable memory tagging +support in the kernel if this tunable has any non-zero value. + +The default value is @samp{0}, which disables all memory tagging. +@end deftp