unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
To: libc-alpha@sourceware.org
Cc: Florian Weimer <fweimer@redhat.com>,
	Szabolcs Nagy <szabolcs.nagy@arm.com>,
	Joseph Myers <joseph@codesourcery.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Subject: [PATCH v6 0/1] RFC: Add <sys/tagged-address.h>
Date: Sun, 22 Aug 2021 05:45:45 -0700	[thread overview]
Message-ID: <20210822124546.154232-1-hjl.tools@gmail.com> (raw)

Changes in v6:

1. Update and simplify the API by only exporting:

/* Set the mask for address bits used in address translation.  Return 0
   on success.  Return -1 on error.  */
extern int set_translated_address_mask (uintptr_t __mask);

/* Non-zero if constant address BITS is a valid tagged address bits.  */
#define TRANSLATED_ADDRESS_VALID_BITS(BITS)

/* A mask for constant address BITS used in address translation.  */
#define TRANSLATED_ADDRESS_MASK(BITS)

2. Properly use _Static_assert for C and static_assert for C++.

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                  | 18 ++++++
 manual/Makefile                               |  3 +-
 manual/ctype.texi                             |  2 +-
 manual/memory.texi                            |  2 +-
 manual/tagged-address.texi                    | 48 ++++++++++++++++
 misc/Makefile                                 | 40 ++++++++++++--
 misc/Versions                                 | 10 ++++
 misc/set-translated-address-mask.c            | 41 ++++++++++++++
 misc/sys/tagged-address.h                     | 33 +++++++++++
 misc/tagged-address.c                         | 50 +++++++++++++++++
 misc/tst-tagged-address-1-static.c            |  1 +
 misc/tst-tagged-address-1.c                   | 55 +++++++++++++++++++
 misc/tst-tagged-address-2-static.c            |  1 +
 misc/tst-tagged-address-2.c                   | 45 +++++++++++++++
 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                   | 36 ++++++++++++
 misc/tst-tagged-address-5.c                   | 25 +++++++++
 misc/tst-tagged-address-6.c                   | 34 ++++++++++++
 misc/tst-tagged-address-7.c                   | 41 ++++++++++++++
 misc/tst-tagged-address-mod-5.c               | 47 ++++++++++++++++
 misc/tst-tagged-address-mod-6.c               | 34 ++++++++++++
 misc/tst-tagged-address-mod-7.c               | 35 ++++++++++++
 sysdeps/generic/inline-tagged-address.h       | 43 +++++++++++++++
 sysdeps/generic/ldsodefs.h                    |  4 ++
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  1 +
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  1 +
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  1 +
 34 files changed, 777 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-translated-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


             reply	other threads:[~2021-08-22 12:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 12:45 H.J. Lu via Libc-alpha [this message]
2021-08-22 12:45 ` [PATCH v6 1/1] <sys/tagged-address.h>: An API for tagged address H.J. Lu via Libc-alpha
2021-08-23  9:28   ` Florian Weimer via Libc-alpha
2021-08-23 13:40     ` H.J. Lu via Libc-alpha
2021-08-23 13:49       ` Florian Weimer via Libc-alpha
2021-08-23 14:15         ` H.J. Lu via Libc-alpha
2021-09-03  9:12           ` Szabolcs Nagy via Libc-alpha
2021-09-03 13:58             ` H.J. Lu via Libc-alpha
2021-09-06  8:52               ` Florian Weimer via Libc-alpha
2021-09-06 13:34                 ` H.J. Lu via Libc-alpha
2021-09-17 10:19                   ` Florian Weimer via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210822124546.154232-1-hjl.tools@gmail.com \
    --to=libc-alpha@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=joseph@codesourcery.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=szabolcs.nagy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).