This is an archive of the discontinued LLVM Phabricator instance.

[lldb][AArch64] Invalidate SVG prior to reconfiguring ZA regdef
AbandonedPublic

Authored by DavidSpickett on Aug 22 2023, 6:59 AM.

Details

Reviewers
omjavaid
Summary

This fixes a bug where writing vg during streaming mode
could prevent you reading za directly afterwards.

vg is invalided when the write happens. SVE is reconfigured
by reading back the new value from the remote. So far so good.

For SME, we read SVG which in some situations appeared to remain
valid but have a value of 0 (perhaps it had never been read).
This meant lldb expected the size of za to be 0 bytes and
rejected the remote's response.

To fix this, invalidate svg before reconfiguring. This ensures
that the value used is the latest one from the remote.

The bug may depend on timing, I could not find a consistent way
to trigger it. I originally found it when checking whether za
is disabled after a vg change, so I've added checks for that
to TestZAThreadedDynamic.

Diff Detail

Event Timeline

DavidSpickett created this revision.Aug 22 2023, 6:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2023, 6:59 AM
DavidSpickett requested review of this revision.Aug 22 2023, 6:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2023, 6:59 AM

And if you're wondering, ZA being disabled after a vector length change is expected. lldb is just reporting what the kernel does here. lldb-server will still give you back a block of 0s though and that's what was not shown in this situation.

Matt added a subscriber: Matt.Aug 22 2023, 9:39 PM