On 22/05/2025 10:28 pm, H. Peter Anvin wrote:
On May 22, 2025 10:53:16 AM PDT, Andrew Cooper andrew.cooper3@citrix.com wrote:
On 22/05/2025 6:22 pm, Dave Hansen wrote:
On 5/22/25 10:17, Xin Li (Intel) wrote:
Clear the software event flag in the augmented SS to prevent infinite SIGTRAP handler loop if TF is used without an external debugger.
Do you have a test case for this? It seems like the kind of thing we'd want in selftests/.
Hmm.
This was a behaviour intentionally changed in FRED so traps wouldn't get lost if an exception where to occur.
What precise case is triggering this?
~Andrew
SIGTRAP → sigreturn. Basically, we have to uplevel the suppression behavior to the kernel (where it belongs) instead of doing it at the ISA level.
So the problem is specifically that we're in a SYSCALL context (from FRED's point of view), and we rewrite state in the FRED FRAME to be another context which happened to have eflags.TF set.
And the combination of these two triggers a new singlestep to be pending immediately.
I have to admit that I didn't like the implication from the SYSCALL bit, and argued to have it handled differently, but alas. I think the real bug here is trying to ERETU with a splice of two different contexts worth of FRED state.
~Andrew