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

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to