[linux] 04/10: [x86] x86/asm: revert ABI break introduced in 4.9.81.

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Fri Feb 16 17:28:18 UTC 2018


This is an automated email from the git hooks/post-receive script.

corsac pushed a commit to branch stretch
in repository linux.

commit d428cd39605ea7e40eba17639fa1bd57c4e0f7a2
Author: Yves-Alexis Perez <corsac at corsac.net>
Date:   Fri Feb 16 11:44:16 2018 +0100

    [x86] x86/asm: revert ABI break introduced in 4.9.81.
---
 debian/changelog                                   |   1 +
 ...asm-Move-status-from-thread_struct-to-thr.patch | 159 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 3 files changed, 161 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 21d101d..09daabf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -50,6 +50,7 @@ linux (4.9.81-1) UNRELEASED; urgency=medium
     - [x86] x86/microcode: Do the family check first
   * [x86] Rewrite "Make x32 syscall support conditional on a kernel parameter"
     to use a static key
+  * [x86] x86/asm: revert ABI break introduced in 4.9.81.
 
  -- Yves-Alexis Perez <corsac at debian.org>  Tue, 13 Feb 2018 17:44:41 +0100
 
diff --git a/debian/patches/debian/revert-x86-asm-Move-status-from-thread_struct-to-thr.patch b/debian/patches/debian/revert-x86-asm-Move-status-from-thread_struct-to-thr.patch
new file mode 100644
index 0000000..bfb438c
--- /dev/null
+++ b/debian/patches/debian/revert-x86-asm-Move-status-from-thread_struct-to-thr.patch
@@ -0,0 +1,159 @@
+From b0d78cb41fb649a4611e7c8418bbf634d63ae42f Mon Sep 17 00:00:00 2001
+From: Yves-Alexis Perez <corsac at corsac.net>
+Date: Fri, 16 Feb 2018 10:04:40 +0100
+Subject: [PATCH] Revert "x86/asm: Move 'status' from thread_struct to thread_info"
+Forwarded: not-needed
+
+This reverts commit f03d00ba0b478963fc96c975d3b27fc1b9bc3a43 which is
+commit 37a8f7c38339b22b69876d6f5a0ab851565284e3 upstream.
+
+Moving status from struct thread_struct to struct thread_info is an ABI
+change, so hold on it for now.
+---
+ arch/x86/entry/common.c            | 4 ++--
+ arch/x86/include/asm/processor.h   | 2 ++
+ arch/x86/include/asm/syscall.h     | 6 +++---
+ arch/x86/include/asm/thread_info.h | 3 +--
+ arch/x86/kernel/process_64.c       | 4 ++--
+ arch/x86/kernel/ptrace.c           | 2 +-
+ arch/x86/kernel/signal.c           | 2 +-
+ 7 files changed, 12 insertions(+), 11 deletions(-)
+
+diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
+index b0cd306dc527..57da9ec3593b 100644
+--- a/arch/x86/entry/common.c
++++ b/arch/x86/entry/common.c
+@@ -202,7 +202,7 @@ __visible inline void prepare_exit_to_usermode(struct pt_regs *regs)
+ 	 * special case only applies after poking regs and before the
+ 	 * very next return to user mode.
+ 	 */
+-	ti->status &= ~(TS_COMPAT|TS_I386_REGS_POKED);
++	current->thread.status &= ~(TS_COMPAT|TS_I386_REGS_POKED);
+ #endif
+ 
+ 	user_enter_irqoff();
+@@ -301,7 +301,7 @@ static __always_inline void do_syscall_32_irqs_on(struct pt_regs *regs)
+ 	unsigned int nr = (unsigned int)regs->orig_ax;
+ 
+ #ifdef CONFIG_IA32_EMULATION
+-	ti->status |= TS_COMPAT;
++	current->thread.status |= TS_COMPAT;
+ #endif
+ 
+ 	if (READ_ONCE(ti->flags) & _TIF_WORK_SYSCALL_ENTRY) {
+diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
+index cb866ae1bc5d..353f038ec645 100644
+--- a/arch/x86/include/asm/processor.h
++++ b/arch/x86/include/asm/processor.h
+@@ -391,6 +391,8 @@ struct thread_struct {
+ 	unsigned short		gsindex;
+ #endif
+ 
++	u32			status;		/* thread synchronous flags */
++
+ #ifdef CONFIG_X86_64
+ 	unsigned long		fsbase;
+ 	unsigned long		gsbase;
+diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h
+index 03eedc21246d..e3c95e8e61c5 100644
+--- a/arch/x86/include/asm/syscall.h
++++ b/arch/x86/include/asm/syscall.h
+@@ -60,7 +60,7 @@ static inline long syscall_get_error(struct task_struct *task,
+ 	 * TS_COMPAT is set for 32-bit syscall entries and then
+ 	 * remains set until we return to user mode.
+ 	 */
+-	if (task->thread_info.status & (TS_COMPAT|TS_I386_REGS_POKED))
++	if (task->thread.status & (TS_COMPAT|TS_I386_REGS_POKED))
+ 		/*
+ 		 * Sign-extend the value so (int)-EFOO becomes (long)-EFOO
+ 		 * and will match correctly in comparisons.
+@@ -116,7 +116,7 @@ static inline void syscall_get_arguments(struct task_struct *task,
+ 					 unsigned long *args)
+ {
+ # ifdef CONFIG_IA32_EMULATION
+-	if (task->thread_info.status & TS_COMPAT)
++	if (task->thread.status & TS_COMPAT)
+ 		switch (i) {
+ 		case 0:
+ 			if (!n--) break;
+@@ -177,7 +177,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
+ 					 const unsigned long *args)
+ {
+ # ifdef CONFIG_IA32_EMULATION
+-	if (task->thread_info.status & TS_COMPAT)
++	if (task->thread.status & TS_COMPAT)
+ 		switch (i) {
+ 		case 0:
+ 			if (!n--) break;
+diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
+index 89978b9c667a..bdf9c4c91572 100644
+--- a/arch/x86/include/asm/thread_info.h
++++ b/arch/x86/include/asm/thread_info.h
+@@ -54,7 +54,6 @@ struct task_struct;
+ 
+ struct thread_info {
+ 	unsigned long		flags;		/* low level flags */
+-	u32			status;		/* thread synchronous flags */
+ };
+ 
+ #define INIT_THREAD_INFO(tsk)			\
+@@ -214,7 +213,7 @@ static inline int arch_within_stack_frames(const void * const stack,
+ #define in_ia32_syscall() true
+ #else
+ #define in_ia32_syscall() (IS_ENABLED(CONFIG_IA32_EMULATION) && \
+-			   current_thread_info()->status & TS_COMPAT)
++			   current->thread.status & TS_COMPAT)
+ #endif
+ 
+ /*
+diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
+index dffe81d3c261..0887d2ae3797 100644
+--- a/arch/x86/kernel/process_64.c
++++ b/arch/x86/kernel/process_64.c
+@@ -538,7 +538,7 @@ void set_personality_ia32(bool x32)
+ 		current->personality &= ~READ_IMPLIES_EXEC;
+ 		/* in_compat_syscall() uses the presence of the x32
+ 		   syscall bit flag to determine compat status */
+-		current_thread_info()->status &= ~TS_COMPAT;
++		current->thread.status &= ~TS_COMPAT;
+ 	} else {
+ 		set_thread_flag(TIF_IA32);
+ 		clear_thread_flag(TIF_X32);
+@@ -546,7 +546,7 @@ void set_personality_ia32(bool x32)
+ 			current->mm->context.ia32_compat = TIF_IA32;
+ 		current->personality |= force_personality32;
+ 		/* Prepare the first "return" to user space */
+-		current_thread_info()->status |= TS_COMPAT;
++		current->thread.status |= TS_COMPAT;
+ 	}
+ }
+ EXPORT_SYMBOL_GPL(set_personality_ia32);
+diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
+index e497d374412a..0e63c0267f99 100644
+--- a/arch/x86/kernel/ptrace.c
++++ b/arch/x86/kernel/ptrace.c
+@@ -934,7 +934,7 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 value)
+ 		 */
+ 		regs->orig_ax = value;
+ 		if (syscall_get_nr(child, regs) >= 0)
+-			child->thread_info.status |= TS_I386_REGS_POKED;
++			child->thread.status |= TS_I386_REGS_POKED;
+ 		break;
+ 
+ 	case offsetof(struct user32, regs.eflags):
+diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
+index b1a5d252d482..763af1d0de64 100644
+--- a/arch/x86/kernel/signal.c
++++ b/arch/x86/kernel/signal.c
+@@ -785,7 +785,7 @@ static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs)
+ 	 * than the tracee.
+ 	 */
+ #ifdef CONFIG_IA32_EMULATION
+-	if (current_thread_info()->status & (TS_COMPAT|TS_I386_REGS_POKED))
++	if (current->thread.status & (TS_COMPAT|TS_I386_REGS_POKED))
+ 		return __NR_ia32_restart_syscall;
+ #endif
+ #ifdef CONFIG_X86_X32_ABI
+-- 
+2.16.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 2cc07e8..6697305 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -188,3 +188,4 @@ debian/revert-bpf-avoid-false-sharing-of-map-refcount-with-.patch
 debian/bpf-avoid-abi-change-in-4.9.77.patch
 debian/revert-sched-rt-Simplify-the-IPI-based-RT-balancing-.patch
 debian/revert-mm-fix-100-CPU-kswapd-busyloop-on-unreclaimab.patch
+debian/revert-x86-asm-Move-status-from-thread_struct-to-thr.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list