diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-12-25 12:51:12 -0500 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-12-25 12:51:12 -0500 |
commit | f0d87c3482a8d22f443655d421c70851db49a18d (patch) | |
tree | 2543a929730783d577726bf9075c110911ef4282 | |
parent | 89970dc5aed91bca6c41e9aa43cad7645cf37ddc (diff) | |
download | 4.9-rt-patches-f0d87c3482a8d22f443655d421c70851db49a18d.tar.gz |
x86: import updated preempt lazy support patchrt-v4.8-728-g1a4a2bc46072
-rw-r--r-- | patches/x86-preempt-lazy.patch | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/patches/x86-preempt-lazy.patch b/patches/x86-preempt-lazy.patch index 023abdef9ca9f2..96d6afe9c77f33 100644 --- a/patches/x86-preempt-lazy.patch +++ b/patches/x86-preempt-lazy.patch @@ -11,9 +11,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> 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 | 10 ++++++++++ + arch/x86/include/asm/thread_info.h | 11 +++++++++++ arch/x86/kernel/asm-offsets.c | 2 ++ - 7 files changed, 78 insertions(+), 3 deletions(-) + 7 files changed, 79 insertions(+), 3 deletions(-) --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -27,7 +27,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> select ANON_INODES --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c -@@ -136,7 +136,7 @@ static long syscall_trace_enter(struct p +@@ -129,7 +129,7 @@ static long syscall_trace_enter(struct p #define EXIT_TO_USERMODE_LOOP_FLAGS \ (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ @@ -36,7 +36,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) { -@@ -152,7 +152,7 @@ static void exit_to_usermode_loop(struct +@@ -145,7 +145,7 @@ static void exit_to_usermode_loop(struct /* We have work to do. */ local_irq_enable(); @@ -47,7 +47,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef ARCH_RT_DELAYS_SIGNAL_SEND --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S -@@ -271,8 +271,25 @@ END(ret_from_exception) +@@ -308,8 +308,25 @@ END(ret_from_exception) ENTRY(resume_kernel) DISABLE_INTERRUPTS(CLBR_ANY) need_resched: @@ -62,11 +62,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> + cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count) + jne restore_all + -+ GET_THREAD_INFO(%ebp) -+ cmpl $0,TI_preempt_lazy_count(%ebp) # non-zero preempt_lazy_count ? ++ movl PER_CPU_VAR(current_task), %ebp ++ cmpl $0,TASK_TI_preempt_lazy_count(%ebp) # non-zero preempt_lazy_count ? + jnz restore_all + -+ testl $_TIF_NEED_RESCHED_LAZY, TI_flags(%ebp) ++ testl $_TIF_NEED_RESCHED_LAZY, TASK_TI_flags(%ebp) + jz restore_all +test_int_off: +#endif @@ -75,7 +75,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> call preempt_schedule_irq --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -512,7 +512,23 @@ GLOBAL(retint_user) +@@ -546,7 +546,23 @@ GLOBAL(retint_user) bt $9, EFLAGS(%rsp) /* were interrupts off? */ jnc 1f 0: cmpl $0, PER_CPU_VAR(__preempt_count) @@ -88,11 +88,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> + cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count) + jnz 1f + -+ GET_THREAD_INFO(%rcx) -+ cmpl $0, TI_preempt_lazy_count(%rcx) ++ movq PER_CPU_VAR(current_task), %rcx ++ cmpl $0, TASK_TI_preempt_lazy_count(%rcx) + jnz 1f + -+ bt $TIF_NEED_RESCHED_LAZY,TI_flags(%rcx) ++ bt $TIF_NEED_RESCHED_LAZY,TASK_TI_flags(%rcx) + jnc 1f +do_preempt_schedule_irq: +#endif @@ -151,16 +151,22 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_PREEMPT --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h -@@ -57,6 +57,8 @@ struct thread_info { - __u32 flags; /* low level flags */ - __u32 status; /* thread synchronous flags */ - __u32 cpu; /* current CPU */ -+ int preempt_lazy_count; /* 0 => lazy preemptable +@@ -54,11 +54,14 @@ struct task_struct; + + struct thread_info { + unsigned long flags; /* low level flags */ ++ int preempt_lazy_count; /* 0 => lazy preemptable + <0 => BUG */ }; #define INIT_THREAD_INFO(tsk) \ -@@ -73,6 +75,10 @@ struct thread_info { + { \ + .flags = 0, \ ++ .preempt_lazy_count = 0, \ + } + + #define init_stack (init_thread_union.stack) +@@ -67,6 +70,10 @@ struct thread_info { #include <asm/asm-offsets.h> @@ -171,7 +177,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif /* -@@ -91,6 +97,7 @@ struct thread_info { +@@ -85,6 +92,7 @@ struct thread_info { #define TIF_SYSCALL_EMU 6 /* syscall emulation active */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ #define TIF_SECCOMP 8 /* secure computing */ @@ -179,7 +185,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #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 */ -@@ -115,6 +122,7 @@ struct thread_info { +@@ -108,6 +116,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) @@ -187,7 +193,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define _TIF_USER_RETURN_NOTIFY (1 << TIF_USER_RETURN_NOTIFY) #define _TIF_UPROBE (1 << TIF_UPROBE) #define _TIF_NOTSC (1 << TIF_NOTSC) -@@ -151,6 +159,8 @@ struct thread_info { +@@ -143,6 +152,8 @@ struct thread_info { #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY) #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) @@ -198,15 +204,15 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c -@@ -31,6 +31,7 @@ void common(void) { - BLANK(); - OFFSET(TI_flags, thread_info, flags); - OFFSET(TI_status, thread_info, status); -+ OFFSET(TI_preempt_lazy_count, thread_info, preempt_lazy_count); +@@ -36,6 +36,7 @@ void common(void) { BLANK(); + OFFSET(TASK_TI_flags, task_struct, thread_info.flags); ++ OFFSET(TASK_TI_preempt_lazy_count, task_struct, thread_info.preempt_lazy_count); OFFSET(TASK_addr_limit, task_struct, thread.addr_limit); -@@ -88,4 +89,5 @@ void common(void) { + + BLANK(); +@@ -91,4 +92,5 @@ void common(void) { BLANK(); DEFINE(PTREGS_SIZE, sizeof(struct pt_regs)); |