All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] m68k/kernel: fix register dump for ColdFire format 4 exception frame
@ 2026-10-10 22:29 Michael Schmitz
  0 siblings, 0 replies; only message in thread
From: Michael Schmitz @ 2026-10-10 22:29 UTC (permalink / raw)
  To: gerg; +Cc: linux-m68k, geert, Michael Schmitz

On ColdFire, no extra processor state information is saved after an
exception frame. Take fault status and vector number from pt_regs.fmtvec
instead of from the longword following the exception frame (which would
be pt_regs.fmtvec from a prior exception on the stack).
Likewise, report the PC from pt_regs (redundant).

Untested ...

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
---
 arch/m68k/kernel/traps.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index 60759ba3cbd4..ec5cf9703e15 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -868,6 +868,21 @@ void show_registers(struct pt_regs *regs)
 		addr += sizeof(fp->un.fmt3);
 		break;
 	case 0x4:
+#if defined(CONFIG_COLDFIRE) && defined(CONFIG_MMU)
+		/* ColdFire format 4 frame has all information in pt_regs */
+		if (CPU_IS_COLDFIRE) {
+			unsigned int fs = (regs->vector & 0x3) |
+					 ((regs->vector & 0xc00) >> 8);
+			int vector = (regs->vector >> 2) & 0xff;
+
+			pr_cont("fault status=%0x vector=%u pc=%08lx\n",
+				fs, vector, regs->pc);
+			/* Frame format 4 extra size on ColdFire is 0
+			 * so don't advance addr
+			 */
+			break;
+		}
+#endif /* CONFIG_COLDFIRE && CONFIG_MMU */
 		if (CPU_IS_060)
 			pr_cont("fault addr=%08lx fslw=%08lx\n",
 				fp->un.fmt4.effaddr, fp->un.fmt4.pc);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-10 22:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-10 22:29 [PATCH RFC] m68k/kernel: fix register dump for ColdFire format 4 exception frame Michael Schmitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.