public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v5 0/1] RFC: Add <sys/tagged-address.h>
@ 2021-08-05 13:13 H.J. Lu
  2021-08-05 13:13 ` [PATCH v5 1/1] <sys/tagged-address.h>: An API for tagged address H.J. Lu
  0 siblings, 1 reply; 19+ messages in thread
From: H.J. Lu @ 2021-08-05 13:13 UTC (permalink / raw)
  To: libc-alpha
  Cc: Florian Weimer, Joseph Myers, Kirill A . Shutemov, Szabolcs Nagy,
	Adhemerval Zanella, Sunil K Pandey

We need an API for tagged address manipulation so that we can use it
within glibc to make glibc LAM compatible and enable LAM in memmove
tests as well as to enable LAM in GCC libsanitizer/hwasan.

If it is needed only for LAM, what is the best way to make it a public
glibc header? Should it be added to <sys/platform/x86.h>?

Changes in v5:

Add restrictions:

1. All bits between 0 and N - 1, where N is the number of tagged address
bits, are used in address translation.
2. All pointers participating in a pointer arithmetic operation should have
the same tag if they point to the same memory object so that pointer
equality operation can be performed on tagged pointers.

Changes in v4:

1. Document that the zero return value from get_tagged_address_bits
indicates that tag bits are not the highest bits in address.
2. Document that the zero value of TAGGED_ADDRESS_MASK indicates the
invalid address mask.
3. Add <bits/tagged-address-mask.h> to provide TAGGED_ADDRESS_MASK.
4. Add C++ support to TAGGED_ADDRESS_MASK.

Changes in v3:

1. set_tagged_address_mask can be only called once before main.
2. Add more tests.

---
By default, the number of the address bits used in address translation
is the number of address bits.  But it can be changed by ARM Top-byte
Ignore (TBI) or Intel Linear Address Masking (LAM).

<sys/tagged-address.h> provides an API for tagged address manipulation.

H.J. Lu (1):
  <sys/tagged-address.h>: An API for tagged address

 NEWS                                          |  2 +-
 bits/tagged-address-mask.h                    | 47 +++++++++++
 bits/tagged-address-valid-bits.h              | 28 +++++++
 csu/libc-start.c                              |  3 +
 elf/dl-support.c                              |  5 ++
 include/sys/tagged-address.h                  |  9 +++
 manual/Makefile                               |  3 +-
 manual/ctype.texi                             |  2 +-
 manual/memory.texi                            |  2 +-
 manual/tagged-address.texi                    | 80 +++++++++++++++++++
 misc/Makefile                                 | 35 ++++++--
 misc/Versions                                 |  7 ++
 misc/set-tagged-address-mask.c                | 41 ++++++++++
 misc/sys/tagged-address.h                     | 45 +++++++++++
 misc/tagged-address.c                         | 55 +++++++++++++
 misc/tst-tagged-address-1-static.c            |  1 +
 misc/tst-tagged-address-1.c                   | 53 ++++++++++++
 misc/tst-tagged-address-2-static.c            |  1 +
 misc/tst-tagged-address-2.c                   | 44 ++++++++++
 misc/tst-tagged-address-3-static.c            |  1 +
 misc/tst-tagged-address-3.c                   | 48 +++++++++++
 misc/tst-tagged-address-4-static.c            |  1 +
 misc/tst-tagged-address-4.c                   | 35 ++++++++
 misc/tst-tagged-address-5.c                   | 25 ++++++
 misc/tst-tagged-address-6.c                   | 34 ++++++++
 misc/tst-tagged-address-7.c                   | 40 ++++++++++
 misc/tst-tagged-address-mod-5.c               | 45 +++++++++++
 misc/tst-tagged-address-mod-6.c               | 34 ++++++++
 misc/tst-tagged-address-mod-7.c               | 34 ++++++++
 sysdeps/generic/inline-tagged-address.h       | 43 ++++++++++
 sysdeps/generic/ldsodefs.h                    |  4 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  5 ++
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  5 ++
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  5 ++
 34 files changed, 813 insertions(+), 9 deletions(-)
 create mode 100644 bits/tagged-address-mask.h
 create mode 100644 bits/tagged-address-valid-bits.h
 create mode 100644 include/sys/tagged-address.h
 create mode 100644 manual/tagged-address.texi
 create mode 100644 misc/set-tagged-address-mask.c
 create mode 100644 misc/sys/tagged-address.h
 create mode 100644 misc/tagged-address.c
 create mode 100644 misc/tst-tagged-address-1-static.c
 create mode 100644 misc/tst-tagged-address-1.c
 create mode 100644 misc/tst-tagged-address-2-static.c
 create mode 100644 misc/tst-tagged-address-2.c
 create mode 100644 misc/tst-tagged-address-3-static.c
 create mode 100644 misc/tst-tagged-address-3.c
 create mode 100644 misc/tst-tagged-address-4-static.c
 create mode 100644 misc/tst-tagged-address-4.c
 create mode 100644 misc/tst-tagged-address-5.c
 create mode 100644 misc/tst-tagged-address-6.c
 create mode 100644 misc/tst-tagged-address-7.c
 create mode 100644 misc/tst-tagged-address-mod-5.c
 create mode 100644 misc/tst-tagged-address-mod-6.c
 create mode 100644 misc/tst-tagged-address-mod-7.c
 create mode 100644 sysdeps/generic/inline-tagged-address.h

-- 
2.31.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-08-21 21:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 13:13 [PATCH v5 0/1] RFC: Add <sys/tagged-address.h> H.J. Lu
2021-08-05 13:13 ` [PATCH v5 1/1] <sys/tagged-address.h>: An API for tagged address H.J. Lu
2021-08-05 17:26   ` Joseph Myers
2021-08-05 17:41     ` H.J. Lu
2021-08-05 17:54       ` Joseph Myers
2021-08-05 19:33         ` H.J. Lu
2021-08-12  8:36   ` Florian Weimer
2021-08-12 12:01     ` Szabolcs Nagy
2021-08-17 12:32       ` Szabolcs Nagy
2021-08-17 12:53         ` H.J. Lu
2021-08-17 14:59           ` Szabolcs Nagy
2021-08-17 15:37             ` H.J. Lu
2021-08-20 16:14       ` H.J. Lu
2021-08-20 16:25         ` Florian Weimer
2021-08-20 16:30           ` H.J. Lu
2021-08-20 23:26     ` H.J. Lu
2021-08-21 16:10       ` Sunil Pandey
2021-08-21 16:37         ` H.J. Lu
2021-08-21 21:20           ` Sunil Pandey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).