Hi, and welcome to the Arm 'What is' program series. In each episode, we explore a tech
topic to give you insight and perspective into some of today's hottest design trends.
I'm Brian Fuller, editor-in-chief at Arm and today we're going to find out what
are memory tagging extensions or MTE?
And to help us with that, I want to introduce Graeme Barnes and Travis Walton.
Graeme is a lead architect and fellow at Arm. And Travis is director developer ecosystem strategy
with Arm's client line of business. Now, when they're not helping us understand what is MTE,
Graeme enjoys running, and he's learning to play the piano and Travis likes running marathons
and writing code. So they have a lot in common outside of MTE.
Gentlemen, let's get started. What exactly is MTE?
MTE is a memory error detection tool, or at least hardware acceleration, such tools. Specifically,
it's an extension to our architecture to help with detecting errors in software use of memory,
such as out of bounds accesses and those tricky to find use of the three errors.
You know, those types of errors, which are responsible for significant proportions of
reliability and vulnerability issues in today's software. As a tool, it can be used in multiple
ways. Developers can use it to help debug their software, platform providers can use it as a
reliability tool to monitor system software and applications running on their platforms
to check that they're behaving as expected. And some people see it as contributing to
the security of a device, preventing certain classes of vulnerability from being exploited.
Well, that obviously has a lot of uses. Travis, can you talk a little bit about
why we need memory tagging extensions today from a mobile app developer's perspective?
Well, there's a concept in programming languages called memory safety,
some languages have it, some languages don't.
And the basic extent of it is if I say allocate space for ten things within my code,
ten spaceships, ten, you know, ten aliens, ten database records,
and then I write eleven items while I've allocated space for ten. And then we safe language will pop
up with an error and go, you know, this is bad. You've tried to write too much data,
the developer can go and fix it or if the user catches it, submit a good report.
In a memory unsafe language like
C or C++, you just overwrite whatever was next to the data, the space that you originally allocated
and crop some of the data. And nothing bad happens, no errors appear until much later
when you try to access that extra data, then you get a bug, a crash, some corrupted data.
And these are incredibly hard to track down. They can exist in big code basis for
years and years and years. They're very, very expensive. They're very hard to find
and MTE is a tool that makes finding them much, much easier. It takes away a lot of
developer pain, it takes away a lot of the cost of finding these bugs.
They should get to market easier, increases application stability, it's a huge win for
software developers in these memory unsafe languages. Even developers in memory safe
languages rely on memory unsafe languages, which are all at the bottom of the software stack. So
yeah, absolutely marvelous developer tool really increases the stability of the applications.
Graeme, is this largely a hardware implementation,
a software implementation or a combination of both?
So it's a combination. So MTE works by annotating the memory allocation.
So that's how you divide up your memory in software so that when you do an allocate or
free with small tag values, hence the tagging in memory tagging extensions.
Along with a corresponding tag on the pointers that you use to access that memory.
And then when you access memory using the pointer, hardware takes over and hardware checks that the
tag on the pointer is the same as the tag on the memory. So if you try to access out of bounds, you
probably accessing memory with a different tag, or if you freed that memory and you retag the memory,
you'll be again, you'll be accessing memory with a different tag and you generate an error.
And of that error, you can decide what you want to do,
whether it's stop your application or keep up your application or whatever it is that you
decide what you're going to. So software has the visibility of how memory is being allocated and
free and responsible for assigning the tags, and the hardware is responsible checking the tags.
Does this add much to SoC design complexity and cost, or is that not much of an issue?
Nothing comes for free. So architecturally MTE requires your memory to now appear
as tagged memory. So this memory with a few extra bits for every
16 bytes of memory you have in your system and implementation needs to provide that somehow.
So typically this is achieved by setting aside a bit of your DRAM for those tags, with some
changes to the memory control, to go and access the tags when you need them, and some changes to
your cache hierarchy and your interconnect to move the tags around to where they're needed.
And then some changes to the CPU to give the extra instructions to manipulate those tags.
And also to do that extra check that we need at the end to test with,
you're doing the right thing. And
of course, if you're using Arm IP, I believe all of our Arm v9 implementations and the support IP
has support for MTE now. So if you're using that IP, then mostly, most of the work is done.
That's excellent. This is a relatively new introduction into the technology world.
What's been the industry's reaction to MTE, and I'll throw that to Travis.
It's a part of my role is taking these
architectural, these hardware concepts and talking to developers in the ecosystem about it.
And I've talked to quite a lot of developers of major mobile applications about MTE.
Over the last year or so, and the reaction has been phenomenal.
I've written a lot of code myself, and I know the pain of trying to track down some of these errors
there, that's some of the hardest folks to find in code. And they're one of the first places that
the hackers would go. They're one of the easiest things to pry open when you want to a security,
you know, when you want to breach the security of some application or system.
For developers having an easy way of tracking down this type of bug
is incredible. It's been called like our dream software tool implemented in hardware.
Well, thank you, Graeme and Travis. MTE is clearly
another excellent weapon in the battle to secure systems.
Now check out all our other 'What is' episodes here and be sure to subscribe to this channel
because we'll be adding more as the year progresses. Thanks for watching!