Skip to content

Commit b2e9df8

Browse files
oleg-nesterovKAGA-KOKO
authored andcommitted
x86: Introduce restart_block->arch_data to remove TS_COMPAT_RESTART
Save the current_thread_info()->status of X86 in the new restart_block->arch_data field so TS_COMPAT_RESTART can be removed again. Signed-off-by: Oleg Nesterov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8c150ba commit b2e9df8

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

arch/x86/include/asm/thread_info.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,10 @@ static inline int arch_within_stack_frames(const void * const stack,
217217
#ifndef __ASSEMBLY__
218218
#ifdef CONFIG_COMPAT
219219
#define TS_I386_REGS_POKED 0x0004 /* regs poked by 32-bit ptracer */
220-
#define TS_COMPAT_RESTART 0x0008
221220

222-
#define arch_set_restart_data arch_set_restart_data
221+
#define arch_set_restart_data(restart) \
222+
do { restart->arch_data = current_thread_info()->status; } while (0)
223223

224-
static inline void arch_set_restart_data(struct restart_block *restart)
225-
{
226-
struct thread_info *ti = current_thread_info();
227-
if (ti->status & TS_COMPAT)
228-
ti->status |= TS_COMPAT_RESTART;
229-
else
230-
ti->status &= ~TS_COMPAT_RESTART;
231-
}
232224
#endif
233225

234226
#ifdef CONFIG_X86_32

arch/x86/kernel/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)
767767
static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs)
768768
{
769769
#ifdef CONFIG_IA32_EMULATION
770-
if (current_thread_info()->status & TS_COMPAT_RESTART)
770+
if (current->restart_block.arch_data & TS_COMPAT)
771771
return __NR_ia32_restart_syscall;
772772
#endif
773773
#ifdef CONFIG_X86_X32_ABI

include/linux/restart_block.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ enum timespec_type {
2323
* System call restart block.
2424
*/
2525
struct restart_block {
26+
unsigned long arch_data;
2627
long (*fn)(struct restart_block *);
2728
union {
2829
/* For futex_wait and futex_wait_requeue_pi */

0 commit comments

Comments
 (0)