mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: Stefan Jumarea <stefanjumarea02@gmail.com>
Cc: Rich Felker <dalias@libc.org>, musl@lists.openwall.com
Subject: Re: [musl] [PATCH] mallocng: Add MTE support for Aarch64
Date: Tue, 11 Jun 2024 21:39:33 +0200	[thread overview]
Message-ID: <20240611193933.GH3766212@port70.net> (raw)
In-Reply-To: <ZmiFuLEEUEmaxYaG@stefan-starfish>

* Stefan Jumarea <stefanjumarea02@gmail.com> [2024-06-11 20:13:28 +0300]:

> On Tue, Jun 11, 2024 at 12:42:22PM -0400, Rich Felker wrote:
> > On Tue, Jun 11, 2024 at 06:37:11PM +0300, Stefan Jumarea wrote:
> > > On Tue, Jun 11, 2024 at 10:46:25AM -0400, Rich Felker wrote:
> > > > On Tue, Jun 11, 2024 at 04:09:22PM +0200, Szabolcs Nagy wrote:
> > > > > * Stefan Jumarea <stefanjumarea02@gmail.com> [2024-06-10 15:36:25 +0300]:
> > > 
> > > This was done since MTE has a 16 byte granule for tagging.
> > > Makes more sense to do this where the class is selected, yes. I'm not
> > > sure about making it work for smaller allocations, I'll try to think of
> > > a way to cover that.
> > 
> > Is there any way to perform a "load, ignoring tag mismatch" operation?
> > 
> 
> Yes, there is the `ldg` instruction that can load the tag of a given
> address, so we can use that.
> 

there is no atomic load with tag ignored. ldg+ld works if you know the
memory tag cannot change asynchronously.

writing to the tco register can disable (and then enable) tag checks
(see the linux docs).

i think it's a bad idea to share the same 16byte granule between user
allocation and in-band malloc meta data for the next allocation,
the two can be independently freed and thus the tag of the granule
can change asynchronously when accessed. and using tco to access the
in-band data might have overheads.

moving the in-band meta data to another granule is imho the right
solution but it costs more space than the compact mallocng design.


      reply	other threads:[~2024-06-11 19:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10 12:36 Stefan Jumarea
2024-06-10 15:59 ` Rich Felker
2024-06-11 14:09 ` Szabolcs Nagy
2024-06-11 14:46   ` Rich Felker
2024-06-11 15:37     ` Stefan Jumarea
2024-06-11 16:42       ` Rich Felker
2024-06-11 17:13         ` Stefan Jumarea
2024-06-11 19:39           ` Szabolcs Nagy [this message]

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=20240611193933.GH3766212@port70.net \
    --to=nsz@port70.net \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=stefanjumarea02@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).