public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] aarch64: Use future HWCAP2_MTE in ifunc resolver Date: Mon, 27 Jul 2020 11:54:54 +0000 (GMT) [thread overview] Message-ID: <20200727115454.B2C933857C6A@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2dc33b928b389f50e7fd8cadd952b79112a071ab commit 2dc33b928b389f50e7fd8cadd952b79112a071ab Author: Szabolcs Nagy <szabolcs.nagy@arm.com> Date: Fri Jul 24 12:37:23 2020 +0100 aarch64: Use future HWCAP2_MTE in ifunc resolver Make glibc MTE-safe on systems where MTE is available. This allows using heap tagging with an LD_PRELOADed malloc implementation that enables MTE. We don't document this as guaranteed contract yet, so glibc may not be MTE safe when HWCAP2_MTE is set (older glibcs certainly aren't). This is mainly for testing and debugging. The HWCAP flag is not exposed in public headers until Linux adds it to its uapi. The HWCAP value reservation will be in Linux 5.9. Diff: --- sysdeps/aarch64/multiarch/strlen.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sysdeps/aarch64/multiarch/strlen.c b/sysdeps/aarch64/multiarch/strlen.c index 7c0352dd87..9440decf75 100644 --- a/sysdeps/aarch64/multiarch/strlen.c +++ b/sysdeps/aarch64/multiarch/strlen.c @@ -26,8 +26,14 @@ # include <string.h> # include <init-arch.h> -/* This should check HWCAP_MTE when it is available. */ -#define MTE_ENABLED() (false) +/* This should check HWCAP2_MTE when it is available: current + linux kernel does not expose it, but its value is reserved. + This is needed to make glibc MTE-safe on future systems in + case user code enables MTE. The ABI contract for enabling + MTE is not yet specified, but it can be useful for at least + debugging which does not need a contract. */ +#define FUTURE_HWCAP2_MTE (1 << 18) +#define MTE_ENABLED() (GLRO(dl_hwcap2) & FUTURE_HWCAP2_MTE) extern __typeof (__redirect_strlen) __strlen;
reply other threads:[~2020-07-27 11:54 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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 * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200727115454.B2C933857C6A@sourceware.org \ --to=nsz@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /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: linkBe 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).