This is an archive of the discontinued LLVM Phabricator instance.

[lldb][AArch64] Add testing of save/restore for Linux MTE control register
ClosedPublic

Authored by DavidSpickett on Aug 9 2023, 3:24 AM.

Details

Summary

This has always worked but had no coverage. Adding testing now so that
later I can refactor the save/restore code safely.

Diff Detail

Event Timeline

DavidSpickett created this revision.Aug 9 2023, 3:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 3:24 AM
DavidSpickett requested review of this revision.Aug 9 2023, 3:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 3:25 AM

This looks fine but instead of adding a new test cant we add MTE control register tests to already available MTE tests?

Remove unused includes.

This looks fine but instead of adding a new test cant we add MTE control register tests to already available MTE tests?

We have these existing tests:
mte_core_file - clearly it can't go here, core files are read only.
mte_memory_region - memory regions have nothing to do with registers.
mte_tag_access - Could go here.
mte_tag_faults - Could go here.

You can call it def test_mte_ctrl_is_restored and that explains it if it fails among a set of somewhat unrelated tests, but it makes it harder to see at a glance if we've tested that register specifically. Doing it in it's own test file is clear what it's doing and it's next to the other register tests and the forthcoming SME tests.

I know I've gone either way on adding new test cases or tacking onto older ones in the past but in this case that's the way I'm leaning.

Remove HWCAP check from program file. The runner will check cppuinfo
and even if that was fooled, the prctl would fail at runtime if you
didn't have MTE.

omjavaid accepted this revision.Aug 31 2023, 3:46 AM
This revision is now accepted and ready to land.Aug 31 2023, 3:46 AM