From 178b9ba6185dde5c1523a43e10574aa4e3f05a38 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 13 Jul 2021 07:52:52 +0200
Subject: [PATCH 138/158] entry: Fix the preempt lazy fallout
Common code needs common defines....
Fixes: f2f9e496208c ("x86: Support for lazy preemption")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/include/asm/thread_info.h | 2 --
include/linux/entry-common.h | 6 ++++++
2 files changed, 6 insertions(+), 2 deletions(-)
Index: linux-5.15.19-rt29/arch/x86/include/asm/thread_info.h
===================================================================
@ linux-5.15.19-rt29/arch/x86/include/asm/thread_info.h:153 @ struct thread_info {
#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
-#define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)
-
#define STACK_WARN (THREAD_SIZE/8)
/*
Index: linux-5.15.19-rt29/include/linux/entry-common.h
===================================================================
--- linux-5.15.19-rt29.orig/include/linux/entry-common.h
+++ linux-5.15.19-rt29/include/linux/entry-common.h
@ linux-5.15.19-rt29/arch/x86/include/asm/thread_info.h:60 @
# define ARCH_EXIT_TO_USER_MODE_WORK (0)
#endif
+#ifdef CONFIG_PREEMPT_LAZY
+# define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)
+#else
+# define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED)
+#endif
+
#define EXIT_TO_USER_MODE_WORK \
(_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
_TIF_NEED_RESCHED_MASK | _TIF_PATCH_PENDING | _TIF_NOTIFY_SIGNAL | \