mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] x86/fred: Reconstruct fault state for rejected INT instructions
@ 2026-09-17 23:09 Matthew Schwartz
  2026-09-17 23:09 ` [PATCH 1/2] x86/fred: Reconstruct the #GP context " Matthew Schwartz
  2026-09-17 23:09 ` [PATCH 2/2] selftests/x86: Check signal state for rejected software interrupts Matthew Schwartz
  0 siblings, 2 replies; 7+ messages in thread
From: Matthew Schwartz @ 2026-09-17 23:09 UTC (permalink / raw)
  To: Xin Li, hpa
  Cc: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, linux-kernel, linux-kselftest, Paul Gofman,
	Lionel Landwerlin, Shuah Khan, Matthew Schwartz

This series reconstructs the #GP signal context for rejected INT
instructions with FRED enabled. The incorrect error code and saved IP
break Wine's handling of INT 0x2d, causing Elden Ring to fail with a
spurious access violation on Panther Lake.

The software event flag handling follows the same reasoning as the
existing sigreturn fix in prevent_single_step_upon_eretu(). The second
patch adds 32-bit and 64-bit signal-context and ptrace resume coverage.

Both selftest variants pass all 29 checks on patched FRED-enabled
Panther Lake and on a non-FRED AMD host. With the same binaries on
unpatched Panther Lake, 16 signal-context checks and the first ptrace IP
check fail. The two dependent ptrace resume checks are not reached.

Separate continuation testing with the fix matched an IDT baseline on
another system in both bitnesses: unchanged IP retries the INT whether
RF is set or clear, and advancing IP resumes at the next instruction.

One observed ptrace divergence remains separate: after rewriting IP at
the stop from raise(SIGSTOP), PTRACE_SINGLESTEP traps before the target
instruction on FRED, whereas IDT executes it. The selftest starts from
an INT3 stop to isolate rejected-INT behavior. The syscall-stop case is
a follow-up investigation outside this series.

Matthew Schwartz (2):
  x86/fred: Reconstruct the #GP context for rejected INT instructions
  selftests/x86: Check signal state for rejected software interrupts

 arch/x86/entry/entry_fred.c              |  11 +-
 tools/testing/selftests/x86/Makefile     |   2 +-
 tools/testing/selftests/x86/int_signal.c | 311 +++++++++++++++++++++++
 3 files changed, 322 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/x86/int_signal.c


base-commit: b5a051f6b840d48f159166ef073d3021989bfb50
-- 
2.55.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-18 10:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 23:09 [PATCH 0/2] x86/fred: Reconstruct fault state for rejected INT instructions Matthew Schwartz
2026-09-17 23:09 ` [PATCH 1/2] x86/fred: Reconstruct the #GP context " Matthew Schwartz
2026-09-18  0:07   ` H. Peter Anvin
2026-09-18 10:33     ` Peter Zijlstra
2026-09-18 10:38   ` [tip: x86/urgent] " tip-bot2 for Matthew Schwartz
2026-09-17 23:09 ` [PATCH 2/2] selftests/x86: Check signal state for rejected software interrupts Matthew Schwartz
2026-09-18 10:38   ` [tip: x86/urgent] " tip-bot2 for Matthew Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®