Skip to content

Commit fdc265b

Browse files
committed
[lldb][AArch64] Invalidate cached VG value before reconfiguring SVE registers
This fixes 46b961f. Prior to the SME changes the steps were: * Invalidate all registers. * Update value of VG and use that to reconfigure the registers. * Invalidate all registers again. With the changes for SME I removed the initial invalidate thinking that it didn't make sense to do if we were going to invalidate them all anyway after reconfiguring. Well the reason it made sense was that it forced us to get the latest value of vg which we needed to reconfigure properly. Not doing so caused a test failure on our Graviton bot which has SVE (https://lab.llvm.org/buildbot/#/builders/96/builds/45722). It was flaky and looping it locally would always fail within a few minutes. Presumably it was using an invalid value of vg, which caused some offsets to be calculated incorrectly. To fix this I've invalided vg in AArch64Reconfigure just before we read it. This is the same as the fix I have in review for SME's svg register. Pushing this directly to fix the ongoing test failure.
1 parent 1b8b556 commit fdc265b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,8 @@ void GDBRemoteRegisterContext::AArch64Reconfigure() {
772772
std::optional<uint64_t> vg_reg_value;
773773
const RegisterInfo *vg_reg_info = m_reg_info_sp->GetRegisterInfo("vg");
774774
if (vg_reg_info) {
775+
// Make sure we get the latest value of vg from the remote.
776+
SetRegisterIsValid(vg_reg_info, false);
775777
uint32_t vg_reg_num = vg_reg_info->kinds[eRegisterKindLLDB];
776778
uint64_t reg_value = ReadRegisterAsUnsigned(vg_reg_num, fail_value);
777779
if (reg_value != fail_value && reg_value <= 32)

0 commit comments

Comments
 (0)