[Lldb-commits] [PATCH] D117928: [lldb] Disable tests for x86 that uses write command on XMM registers

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 24 10:56:39 PST 2022


labath added a comment.

In D117928#3265048 <https://reviews.llvm.org/D117928#3265048>, @ljmf00 wrote:

> In D117928#3263992 <https://reviews.llvm.org/D117928#3263992>, @mgorny wrote:
>
>> Thank you. Yes, please test on an older kernel, in case it's specifically a kernel regression.
>
> I can confirm regression on Linux LTS 5.10.93. Probably later and introduced by the patch I mentioned. I reported to the kernel bug tracker. See https://bugzilla.kernel.org/show_bug.cgi?id=215524 .
>
> In D117928#3264795 <https://reviews.llvm.org/D117928#3264795>, @labath wrote:
>
>> If this is a problem with PTRACE_SETREGSET(NT_FPREGSET), then we might be able to work around it by using PTRACE_POKEUSER instead. But it'd definitely be good to confirm this, so that we can report the bug to kernel devs.
>
> According to `ptrace` documentation `PTRACE_SETFPREGS` seems a better fit, although either this and `PTRACE_POKEUSER` disallow writing in some specific general-purpose registers, so we should only use this for FP/XMM registers?

I think either would be fine, if it works (I'm not sure how early the PTRACE_SETFPREGS and PTRACE_SETREGSET codepaths converge inside the kernel). I wouldn't be too worried about the write prohibition clause. I'm pretty sure that applies to things like setting the single-step bit inside the flags register, and similar mischief that could confuse/crash the kernel. Those restrictions should be enforced for any register-writing method. And now, thanks to @mgorny, we actually have tests that would catch situations when we're not able to change some register.

If you want, I can try to create a patch for this, though it might take me a couple of days to get around to it.

> AFAIK BSD-based kernels implements `PT_SETXMMREGS` although I don't see any documentation on the Linux kernel side about this.

Yeah, linux doesn't have those.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117928/new/

https://reviews.llvm.org/D117928



More information about the lldb-commits mailing list