summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2017-10-02 22:54:37 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2017-10-02 22:54:37 -0400
commit6748013ef5ba5f0393ab06d4271d19d7083e9935 (patch)
tree6bfdc1eb55aeb6f0f4a4dc4e4d3e359efa0dcdd1
parentbf6391f89cca33a9308177b5e35b99dd008715a5 (diff)
download4.12-rt-patches-6748013ef5ba5f0393ab06d4271d19d7083e9935.tar.gz
x86: refresh preempt-lazy patchrt-v4.11-980-g6dc2cce93211
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--patches/x86-preempt-lazy.patch51
1 files changed, 30 insertions, 21 deletions
diff --git a/patches/x86-preempt-lazy.patch b/patches/x86-preempt-lazy.patch
index de5b8740b30946..51d7e634aa69e6 100644
--- a/patches/x86-preempt-lazy.patch
+++ b/patches/x86-preempt-lazy.patch
@@ -1,23 +1,17 @@
-Subject: x86: Support for lazy preemption
+From 27e7c8249e0f683c53400c81f588f3c1690ecf29 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
-Date: Thu, 01 Nov 2012 11:03:47 +0100
+Date: Thu, 1 Nov 2012 11:03:47 +0100
+Subject: [PATCH] x86: Support for lazy preemption
Implement the x86 pieces for lazy preempt.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
----
- arch/x86/Kconfig | 1 +
- arch/x86/entry/common.c | 4 ++--
- arch/x86/entry/entry_32.S | 17 +++++++++++++++++
- arch/x86/entry/entry_64.S | 16 ++++++++++++++++
- arch/x86/include/asm/preempt.h | 31 ++++++++++++++++++++++++++++++-
- arch/x86/include/asm/thread_info.h | 11 +++++++++++
- arch/x86/kernel/asm-offsets.c | 2 ++
- 7 files changed, 79 insertions(+), 3 deletions(-)
+diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
+index 5e6a68ed5d64..ef502de03137 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -160,6 +160,7 @@ config X86
+@@ -159,6 +159,7 @@ config X86
select HAVE_PERF_REGS
select HAVE_PERF_USER_STACK_DUMP
select HAVE_REGS_AND_STACK_ACCESS_API
@@ -25,9 +19,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
select HAVE_STACK_VALIDATION if X86_64
select HAVE_SYSCALL_TRACEPOINTS
select HAVE_UNSTABLE_SCHED_CLOCK
+diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
+index d602b269058f..9bb6144b0e25 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
-@@ -130,7 +130,7 @@ static long syscall_trace_enter(struct p
+@@ -130,7 +130,7 @@ static long syscall_trace_enter(struct pt_regs *regs)
#define EXIT_TO_USERMODE_LOOP_FLAGS \
(_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
@@ -36,7 +32,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags)
{
-@@ -146,7 +146,7 @@ static void exit_to_usermode_loop(struct
+@@ -146,7 +146,7 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags)
/* We have work to do. */
local_irq_enable();
@@ -45,9 +41,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
schedule();
#ifdef ARCH_RT_DELAYS_SIGNAL_SEND
+diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
+index 57f7ec35216e..1e4d382963f4 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
-@@ -340,8 +340,25 @@ END(ret_from_exception)
+@@ -332,8 +332,25 @@ END(ret_from_exception)
ENTRY(resume_kernel)
DISABLE_INTERRUPTS(CLBR_ANY)
.Lneed_resched:
@@ -73,9 +71,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
testl $X86_EFLAGS_IF, PT_EFLAGS(%esp) # interrupts off (exception path) ?
jz restore_all
call preempt_schedule_irq
+diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
+index d8b4baf18ec6..26c603fb0d87 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
-@@ -541,7 +541,23 @@ GLOBAL(retint_user)
+@@ -544,7 +544,23 @@ retint_kernel:
bt $9, EFLAGS(%rsp) /* were interrupts off? */
jnc 1f
0: cmpl $0, PER_CPU_VAR(__preempt_count)
@@ -99,9 +99,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
call preempt_schedule_irq
jmp 0b
1:
+diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h
+index ec1f3c651150..d9cd82a824a6 100644
--- a/arch/x86/include/asm/preempt.h
+++ b/arch/x86/include/asm/preempt.h
-@@ -85,17 +85,46 @@ static __always_inline void __preempt_co
+@@ -85,17 +85,46 @@ static __always_inline void __preempt_count_sub(int val)
* a decrement which hits zero means we have no preempt_count and should
* reschedule.
*/
@@ -149,6 +151,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
}
#ifdef CONFIG_PREEMPT
+diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
+index 9fc44b95f7cb..8a3d741830c3 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -54,11 +54,14 @@ struct task_struct;
@@ -184,16 +188,16 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+#define TIF_NEED_RESCHED_LAZY 9 /* lazy rescheduling necessary */
#define TIF_USER_RETURN_NOTIFY 11 /* notify kernel of userspace return */
#define TIF_UPROBE 12 /* breakpointed or singlestepping */
- #define TIF_NOTSC 16 /* TSC is not accessible in userland */
-@@ -108,6 +116,7 @@ struct thread_info {
+ #define TIF_NOCPUID 15 /* CPUID is not accessible in userland */
+@@ -109,6 +117,7 @@ struct thread_info {
#define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
#define _TIF_SECCOMP (1 << TIF_SECCOMP)
+#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY)
#define _TIF_USER_RETURN_NOTIFY (1 << TIF_USER_RETURN_NOTIFY)
#define _TIF_UPROBE (1 << TIF_UPROBE)
- #define _TIF_NOTSC (1 << TIF_NOTSC)
-@@ -143,6 +152,8 @@ struct thread_info {
+ #define _TIF_NOCPUID (1 << TIF_NOCPUID)
+@@ -145,6 +154,8 @@ struct thread_info {
#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
@@ -202,6 +206,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
#define STACK_WARN (THREAD_SIZE/8)
/*
+diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
+index de827d6ac8c2..41fd80368774 100644
--- a/arch/x86/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets.c
@@ -36,6 +36,7 @@ void common(void) {
@@ -218,3 +224,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
DEFINE(PTREGS_SIZE, sizeof(struct pt_regs));
+ DEFINE(_PREEMPT_ENABLED, PREEMPT_ENABLED);
}
+--
+2.1.4
+