This is an archive of the discontinued LLVM Phabricator instance.

[lldb][AArch64] Add memory-tagging qSupported feature
ClosedPublic

Authored by DavidSpickett on Feb 23 2021, 6:26 AM.

Details

Summary

This feature "memory-tagging+" indicates that lldb-server
supports memory tagging packets. (added in a later patch)

We check HWCAP2_MTE to decide whether to enable this
feature for Linux.

Diff Detail

Event Timeline

DavidSpickett created this revision.Feb 23 2021, 6:26 AM
DavidSpickett requested review of this revision.Feb 23 2021, 6:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2021, 6:26 AM
omjavaid accepted this revision.Mar 1 2021, 3:37 AM
This revision is now accepted and ready to land.Mar 1 2021, 3:37 AM
  • Rebase onto main

Same code just moved around since qSupported parsing was refactored.

Rebase onto main.

  • Rebase onto new qSupported functions
  • Check AUXV for enabling feature, instead of enabling for all AArch64
DavidSpickett edited the summary of this revision. (Show Details)Apr 28 2021, 8:17 AM

@mgorny Can you take a quick look and see if I'm adding this new feature correctly?

And thanks for working on qSupported. I skipped checking HWCAP in my first revision because the features were added in generic code, now I can be more accurate in the Linux specific method.

lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
300

There is a mechanism to get auvx from a process but I don't think we have one at this point.

lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
1034

For the moment my MTE test target is in fact, a remote platform in QEMU. But at least this checks that no one else gets the feature incorrectly.

@mgorny Can you take a quick look and see if I'm adding this new feature correctly?

Everything looks good from my perspective.

And thanks for working on qSupported. I skipped checking HWCAP in my first revision because the features were added in generic code, now I can be more accurate in the Linux specific method.

Thanks!

lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
300

You may want to add an explicit comment about that.

  • Add comment to explain reading auxv.
DavidSpickett marked an inline comment as done.Apr 28 2021, 9:11 AM

asm/hwcap.h is not available on x86 (riscv/arm/aarch64 have it at least)
so #ifdef the includes and auxval call.

Rebase, fix missed clang-format-ing.

DavidSpickett added a subscriber: pcc.
This comment was removed by DavidSpickett.

Rebase, this is good to land as is.

This revision was landed with ongoing or failed builds.Jun 24 2021, 7:43 AM
This revision was automatically updated to reflect the committed changes.