From d5f7c3d4b4e4b437dfb54f9eb1ed6876dfb63744 Mon Sep 17 00:00:00 2001 From: Michael Schmitz Date: Sun, 1 Aug 2021 13:06:21 +1200 Subject: [PATCH 2/2] m68k: warn in get_fc() if DFC is not USER_DATA Trace uacess mode restore operations that mess up the SFC/DFC registers - read out current DFC before changing modes and warn when the current mode wasn't USER_DATA! Signed-off-by: Michael Schmitz --- arch/m68k/include/asm/processor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h index 29dfa54..a8c533d 100644 --- a/arch/m68k/include/asm/processor.h +++ b/arch/m68k/include/asm/processor.h @@ -98,6 +98,7 @@ static inline unsigned long get_fc(void) { unsigned long val; __asm__ ("movec %/dfc,%0":"=r" (val):); + WARN_ON_ONCE(val != USER_DATA); return val; } /* -- 2.7.4