diff options
| author | Andy Lutomirski <luto@kernel.org> | 2016-08-02 17:05:36 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-02 19:35:23 -0400 |
| commit | 7e7814180b334dff97ef8f56c7c40c277ad4531c (patch) | |
| tree | 8f2f0ce6b3aca6dcce64a46047c42df63f43a7e9 /arch/alpha | |
| parent | 0a11b9aae49adf1f952427ef1a1d9e793dd6ffb6 (diff) | |
signal: consolidate {TS,TLF}_RESTORE_SIGMASK code
In general, there's no need for the "restore sigmask" flag to live in
ti->flags. alpha, ia64, microblaze, powerpc, sh, sparc (64-bit only),
tile, and x86 use essentially identical alternative implementations,
placing the flag in ti->status.
Replace those optimized implementations with an equally good common
implementation that stores it in a bitfield in struct task_struct and
drop the custom implementations.
Additional architectures can opt in by removing their
TIF_RESTORE_SIGMASK defines.
Link: http://lkml.kernel.org/r/8a14321d64a28e40adfddc90e18a96c086a6d6f9.1468522723.git.luto@kernel.org
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Tested-by: Michael Ellerman <mpe@ellerman.id.au> [powerpc]
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/alpha')
| -rw-r--r-- | arch/alpha/include/asm/thread_info.h | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h index 32e920a83ae5..e9e90bfa2b50 100644 --- a/arch/alpha/include/asm/thread_info.h +++ b/arch/alpha/include/asm/thread_info.h | |||
| @@ -86,33 +86,6 @@ register struct thread_info *__current_thread_info __asm__("$8"); | |||
| 86 | #define TS_UAC_NOPRINT 0x0001 /* ! Preserve the following three */ | 86 | #define TS_UAC_NOPRINT 0x0001 /* ! Preserve the following three */ |
| 87 | #define TS_UAC_NOFIX 0x0002 /* ! flags as they match */ | 87 | #define TS_UAC_NOFIX 0x0002 /* ! flags as they match */ |
| 88 | #define TS_UAC_SIGBUS 0x0004 /* ! userspace part of 'osf_sysinfo' */ | 88 | #define TS_UAC_SIGBUS 0x0004 /* ! userspace part of 'osf_sysinfo' */ |
| 89 | #define TS_RESTORE_SIGMASK 0x0008 /* restore signal mask in do_signal() */ | ||
| 90 | |||
| 91 | #ifndef __ASSEMBLY__ | ||
| 92 | #define HAVE_SET_RESTORE_SIGMASK 1 | ||
| 93 | static inline void set_restore_sigmask(void) | ||
| 94 | { | ||
| 95 | struct thread_info *ti = current_thread_info(); | ||
| 96 | ti->status |= TS_RESTORE_SIGMASK; | ||
| 97 | WARN_ON(!test_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags)); | ||
| 98 | } | ||
| 99 | static inline void clear_restore_sigmask(void) | ||
| 100 | { | ||
| 101 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | ||
| 102 | } | ||
| 103 | static inline bool test_restore_sigmask(void) | ||
| 104 | { | ||
| 105 | return current_thread_info()->status & TS_RESTORE_SIGMASK; | ||
| 106 | } | ||
| 107 | static inline bool test_and_clear_restore_sigmask(void) | ||
| 108 | { | ||
| 109 | struct thread_info *ti = current_thread_info(); | ||
| 110 | if (!(ti->status & TS_RESTORE_SIGMASK)) | ||
| 111 | return false; | ||
| 112 | ti->status &= ~TS_RESTORE_SIGMASK; | ||
| 113 | return true; | ||
| 114 | } | ||
| 115 | #endif | ||
| 116 | 89 | ||
| 117 | #define SET_UNALIGN_CTL(task,value) ({ \ | 90 | #define SET_UNALIGN_CTL(task,value) ({ \ |
| 118 | __u32 status = task_thread_info(task)->status & ~UAC_BITMASK; \ | 91 | __u32 status = task_thread_info(task)->status & ~UAC_BITMASK; \ |
