From patchwork Thu Apr 19 10:58:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 133746 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp490294ljf; Thu, 19 Apr 2018 03:59:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx49/ggkUq75dzJfzzPKrgZBQuuIYJ4eEYwV2r7OFCHvhSCRWXylpvo4pLnRCYD1QduE4xOZ2 X-Received: by 10.98.130.140 with SMTP id w134mr5430645pfd.127.1524135545064; Thu, 19 Apr 2018 03:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524135545; cv=none; d=google.com; s=arc-20160816; b=YNM9nIFbGX4ZRK2GO+TYQE6DZBkri4SGOJaqU/bsEtPcggN/Fyz4sj+GIEPO93BaMt gOFs3t4ZMz8zD/rZfOkchhshFIS2qSxAEleVFqcKMLNE+hORuOgRMjkYpovLT+owqh1g UGAiRrcpldnmMs3YmzuIZhOaCBqdNx9SNr72PIsd1ZuG9MXgNYNMm61LPIKMcObXCGGB p8sO5Wq3oPxGNbVjuhHOL8CEfsa81chkpB/R0flFw/BVDYJHPwCQtPHdoYND4LWMh5JS iXkO1fqB+qw9bvWYttsTGURZL1Ar4IjldNf1h00A6Di5oOa8BzD5wHnaGbExRaP3Fz3y LuWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Ext4jsrBr2VQNgd6x2/yd2rFNvaUdpNuFf0lIC+7nk4=; b=hQwfvAQdNTGjM6RVrWMNbu7adFC8FHg2N2uRQNBgw9G1nmeUgstM+LeXuuSYdg7Am/ lp12hBQxZOS7vobWcSFYr8ZRnEfqMoZNy7Zd3wUNFNAS1BPqZ2lEj1GDpPajw0JjKFFZ kHARzP7Tkr9/TDyQDgE77ZoF72UvHP8v640g5CwpSpbcoM0g8F1WMTMEM2kO9FP+JhPu QQeZsm8+2M1+2lZW1LXyUR5gY1ZZp9YXuJJ1707VQSG+8x3aUrcML3LAjohBcrqJ4xs2 tOu//9jOLzAxN7TubNX2cOPyFHK7mQAjCxl0kgpcMctgQWIBHEGyVwcw1pBtMLWLbsxO kVzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6-v6si3101456pln.339.2018.04.19.03.59.04; Thu, 19 Apr 2018 03:59:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752618AbeDSK7A (ORCPT + 29 others); Thu, 19 Apr 2018 06:59:00 -0400 Received: from foss.arm.com ([217.140.101.70]:35828 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228AbeDSK65 (ORCPT ); Thu, 19 Apr 2018 06:58:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9994815AD; Thu, 19 Apr 2018 03:58:57 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 652AA3F59D; Thu, 19 Apr 2018 03:58:55 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Ralf Baechle , James Hogan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "David S. Miller" , Ingo Molnar , Peter Zijlstra , Steven Rostedt , Oleg Nesterov , linux-arch@vger.kernel.org Subject: [RFC PATCH 1/6] thread_info: Add update_thread_flag() helpers Date: Thu, 19 Apr 2018 11:58:43 +0100 Message-Id: <1524135528-28561-2-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> References: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are a number of bits of code sprinkled around the kernel to set a thread flag if a certain condition is true, and clear it otherwise. To help make those call sites terser and less cumbersome, this patch adds a new family of thread flag manipulators update*_thread_flag([...,] flag, cond) which do the equivalent of: if (cond) set*_thread_flag([...,] flag); else clear*_thread_flag([...,] flag); Signed-off-by: Dave Martin Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Oleg Nesterov --- Note, this patch assumes C99 _Bool semantics where casting a value to _Bool is true is and only if the value compares != 0. This would not be true if bool where a typedef of unsigned char for example. It appears that the kernel has always used the C99 semantics for bool and relies on them elsewhere, so I don't believe this patch introduces a new dependency. --- include/linux/sched.h | 6 ++++++ include/linux/thread_info.h | 11 +++++++++++ include/trace/syscall.h | 6 ++---- kernel/ptrace.c | 13 +++++-------- 4 files changed, 24 insertions(+), 12 deletions(-) -- 2.1.4 Acked-by: Will Deacon diff --git a/include/linux/sched.h b/include/linux/sched.h index b3d697f..c2c3051 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1578,6 +1578,12 @@ static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag) clear_ti_thread_flag(task_thread_info(tsk), flag); } +static inline void update_tsk_thread_flag(struct task_struct *tsk, int flag, + bool value) +{ + update_ti_thread_flag(task_thread_info(tsk), flag, value); +} + static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) { return test_and_set_ti_thread_flag(task_thread_info(tsk), flag); diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index 34f053a..efd5ec4 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -64,6 +64,15 @@ static inline void clear_ti_thread_flag(struct thread_info *ti, int flag) clear_bit(flag, (unsigned long *)&ti->flags); } +static inline void update_ti_thread_flag(struct thread_info *ti, int flag, + bool value) +{ + if (value) + set_ti_thread_flag(ti, flag); + else + clear_ti_thread_flag(ti, flag); +} + static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag) { return test_and_set_bit(flag, (unsigned long *)&ti->flags); @@ -83,6 +92,8 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) set_ti_thread_flag(current_thread_info(), flag) #define clear_thread_flag(flag) \ clear_ti_thread_flag(current_thread_info(), flag) +#define update_thread_flag(flag, value) \ + update_ti_thread_flag(current_thread_info(), flag, value) #define test_and_set_thread_flag(flag) \ test_and_set_ti_thread_flag(current_thread_info(), flag) #define test_and_clear_thread_flag(flag) \ diff --git a/include/trace/syscall.h b/include/trace/syscall.h index dc8ac27..dcc9bdf 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h @@ -37,10 +37,8 @@ struct syscall_metadata { #if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS) static inline void syscall_tracepoint_update(struct task_struct *p) { - if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) - set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT); - else - clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT); + update_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT, + test_thread_flag(TIF_SYSCALL_TRACEPOINT)); } #else static inline void syscall_tracepoint_update(struct task_struct *p) diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 21fec73..7a2bd8d 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -785,16 +785,13 @@ static int ptrace_resume(struct task_struct *child, long request, if (!valid_signal(data)) return -EIO; - if (request == PTRACE_SYSCALL) - set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); - else - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + update_tsk_thread_flag(child, TIF_SYSCALL_TRACE, + request == PTRACE_SYSCALL); #ifdef TIF_SYSCALL_EMU - if (request == PTRACE_SYSEMU || request == PTRACE_SYSEMU_SINGLESTEP) - set_tsk_thread_flag(child, TIF_SYSCALL_EMU); - else - clear_tsk_thread_flag(child, TIF_SYSCALL_EMU); + update_tsk_thread_flag(child, TIF_SYSCALL_EMU, + request == PTRACE_SYSEMU || + request == PTRACE_SYSEMU_SINGLESTEP); #endif if (is_singleblock(request)) { From patchwork Thu Apr 19 10:58:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 133747 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp490319ljf; Thu, 19 Apr 2018 03:59:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/2yfzE2+knbtAzur3U5dQrHk6NCc/3rqQpFsR5yUh0rooWsWB6E6F535zXUDOYMNhYeduo X-Received: by 2002:a17:902:207:: with SMTP id 7-v6mr5670226plc.261.1524135546937; Thu, 19 Apr 2018 03:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524135546; cv=none; d=google.com; s=arc-20160816; b=irg25K3RNIJ1HUYo5TiJoUmoSLyVCuY2ILc5dsWmzEASkhSoWBCmwjNIV1twldQuOc Ab92pp27bnsO35R8r56msjTbjwpy7mlM8x1P4SXxht6sFCnL0siRdVtio3iSH7Shfcr8 Lmzzt5VHegecoDkXByh8Fri88NWuo3ypNHt3J4OAAvTUmnHJKL0UdyF2IlCL58FPgO+a HjRdkFJyzrrUS/0L1jKyNlMdD79WSJQyDyKtlPim0l0tt02SYOjWUiYy8rf2wzXCnAQu NW7q+fb1Y9uxR4T0fjPw6VUFSdLh5zXH2Yz1AAVzE5mcLSGgDh7ZcfH7ExhQb/3tDWRC nswQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=hIqb4CvguZn4U5rLc6F8lKH1t8d2R8mtWtp9p21dhkM=; b=cBxzV/tYL3zQzdqkQFlsZTkUHHVlIUzc09Pkq7ORnqisozduHjw3T3xxgKT5WlDv4Q PejEaMFEkMnFQPWwB5DnieKmKTfDS8Tmb7IcjRd1xZzvrLg1PMiR7zy+2jq33vBupZko Whs32jgCtlOVGeFcAN7vrWD1orUYg+OgG1uJmyeb5olVjyky1I5te4uk0InVtibmN/RF dqqjZKWjp3TpxYRGjfXMDII7m9V33LvK7LQuZyt5pcS6xtfeb6mtpiFNq8TbCqEnPKs0 q8IfXrbXw+3B/hcAkma6tV+fz/oL4WBkVEMDSMWy3h3yY6lx+1ssaA0Or+awIwPx5gsI WHgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 135si3021331pfc.21.2018.04.19.03.59.06; Thu, 19 Apr 2018 03:59:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752658AbeDSK7E (ORCPT + 29 others); Thu, 19 Apr 2018 06:59:04 -0400 Received: from foss.arm.com ([217.140.101.70]:35862 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752605AbeDSK7A (ORCPT ); Thu, 19 Apr 2018 06:59:00 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 613F115B2; Thu, 19 Apr 2018 03:59:00 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D962A3F59D; Thu, 19 Apr 2018 03:58:57 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Ralf Baechle , James Hogan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "David S. Miller" , Ingo Molnar , Peter Zijlstra , Steven Rostedt , Oleg Nesterov , linux-arch@vger.kernel.org, Russell King Subject: [RFC PATCH 2/6] ARM: Use update_thread_flag() Date: Thu, 19 Apr 2018 11:58:44 +0100 Message-Id: <1524135528-28561-3-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> References: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch uses the new update_thread_flag() helper to simplify an if () set; else clear; construct. No functional change. Signed-off-by: Dave Martin Cc: Russell King --- arch/arm/kernel/elf.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.1.4 diff --git a/arch/arm/kernel/elf.c b/arch/arm/kernel/elf.c index 1824229..aade393 100644 --- a/arch/arm/kernel/elf.c +++ b/arch/arm/kernel/elf.c @@ -68,12 +68,9 @@ void elf_set_personality(const struct elf32_hdr *x) * binary is EABI or softfloat (and thus, guaranteed not to use * FPA instructions.) */ - if (elf_hwcap & HWCAP_IWMMXT && - eflags & (EF_ARM_EABI_MASK | EF_ARM_SOFT_FLOAT)) { - set_thread_flag(TIF_USING_IWMMXT); - } else { - clear_thread_flag(TIF_USING_IWMMXT); - } + update_thread_flag(TIF_USING_IWMMXT, + elf_hwcap & HWCAP_IWMMXT && + eflags & (EF_ARM_EABI_MASK | EF_ARM_SOFT_FLOAT)); } EXPORT_SYMBOL(elf_set_personality); From patchwork Thu Apr 19 10:58:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 133751 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp491070ljf; Thu, 19 Apr 2018 04:00:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx49zjutWatVuob1qjbwSnp7mYZCD3yHjTBTauXNSHC9oAgqK8o+dMdQTJAIgdUI297eVc0z8 X-Received: by 10.98.46.5 with SMTP id u5mr5346297pfu.247.1524135607076; Thu, 19 Apr 2018 04:00:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524135607; cv=none; d=google.com; s=arc-20160816; b=QTx7SX3uPm0QgiQvQFQ2AP6BU9VL0Xyc3Gdr8c0/Nlsy9QTixed/Yzdgm7VWwZMA+r JRUGWmRIkQEw/+AFtZW87BDsAqnolTs2B0i8pgHQwAi8BRG5j+hQoOY//eks3MQopaIy Qyxk+rJX6DHHkp91eGhYu8+PQh2agDK2j1kgoj3oheeBRmSX/UXJ1IU3AH8S0b/DXDx2 Sc1gsTTU/FMzfzk8AJlQgW4e+wHSoJOkoEOuFaNHXnNeWXpV4ND2XQYezl+dA7NnUpfs R7L7SfvBbiAcOWDlJyxhZqcXfNh/ivkCPuiQfWWMZPbp6qA/aRUFIQUB4lQcHqIqxbVd v6oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=3vo7X0uNsw1iOa/lgt5aU+EjS3poL9A4jSv1KuVNdCU=; b=dC5wYFVI4LRJzljnMelPIsvEZhnohAOqJveeZfD+amLXU+j2XnJkSj2HSu7Hgt6b6e +G/qT/luMeCPB3C0jtG+HPemFOTAm/PuKc1ffBUB/nbIO97gjgx1d5vM3BJ7h96638sp Q4QD6DOwK5ThiDR9wfD+8u4TY9tjDudQHNyiPw4I4Mz09I9LmiOENXEl4Cn/dJNiFjQG d+pLqRJ1ICMgpmzhjs0AtHzoIQlMEMmA6aVtO35fdNIUXbfAexXEPdFCLm1vRCsxCq1x OUdVreh5j4C9jGvZGftOV6wSSHowl+ANuz3qLO8sfe3noPxWG0gmqXmcTHuvmrJ1bHd2 XQLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34-v6si3279426plm.495.2018.04.19.04.00.06; Thu, 19 Apr 2018 04:00:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752819AbeDSLAE (ORCPT + 29 others); Thu, 19 Apr 2018 07:00:04 -0400 Received: from foss.arm.com ([217.140.101.70]:35890 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752617AbeDSK7D (ORCPT ); Thu, 19 Apr 2018 06:59:03 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D3C2315BE; Thu, 19 Apr 2018 03:59:02 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9FBF23F59D; Thu, 19 Apr 2018 03:59:00 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Ralf Baechle , James Hogan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "David S. Miller" , Ingo Molnar , Peter Zijlstra , Steven Rostedt , Oleg Nesterov , linux-arch@vger.kernel.org Subject: [RFC PATCH 3/6] arm64: Use update{,_tsk}_thread_flag() Date: Thu, 19 Apr 2018 11:58:45 +0100 Message-Id: <1524135528-28561-4-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> References: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch uses the new update_thread_flag() helpers to simplify a couple of if () set; else clear; constructs. No functional change. Signed-off-by: Dave Martin Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/kernel/fpsimd.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) -- 2.1.4 Acked-by: Will Deacon diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index 87a3536..0c4e7e0 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -618,10 +618,8 @@ int sve_set_vector_length(struct task_struct *task, task->thread.sve_vl = vl; out: - if (flags & PR_SVE_VL_INHERIT) - set_tsk_thread_flag(task, TIF_SVE_VL_INHERIT); - else - clear_tsk_thread_flag(task, TIF_SVE_VL_INHERIT); + update_tsk_thread_flag(task, TIF_SVE_VL_INHERIT, + flags & PR_SVE_VL_INHERIT); return 0; } @@ -902,7 +900,7 @@ void fpsimd_thread_switch(struct task_struct *next) if (current->mm) task_fpsimd_save(); - if (next->mm) { + if (next->mm) /* * If we are switching to a task whose most recent userland * FPSIMD state is already in the registers of *this* cpu, @@ -910,13 +908,10 @@ void fpsimd_thread_switch(struct task_struct *next) * the TIF_FOREIGN_FPSTATE flag so the state will be loaded * upon the next return to userland. */ - if (__this_cpu_read(fpsimd_last_state.st) == - &next->thread.uw.fpsimd_state - && next->thread.fpsimd_cpu == smp_processor_id()) - clear_tsk_thread_flag(next, TIF_FOREIGN_FPSTATE); - else - set_tsk_thread_flag(next, TIF_FOREIGN_FPSTATE); - } + update_tsk_thread_flag(next, TIF_FOREIGN_FPSTATE, + __this_cpu_read(fpsimd_last_state.st) != + &next->thread.uw.fpsimd_state || + next->thread.fpsimd_cpu != smp_processor_id()); } void fpsimd_flush_thread(void) From patchwork Thu Apr 19 10:58:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 133748 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp490369ljf; Thu, 19 Apr 2018 03:59:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx4924uRk6JBWQi6imydN5Mz9YQUFWT0CN8vFjHcQTlyrkM5KMwCaNN8eUloObtjJ01n+AoUi X-Received: by 10.98.159.129 with SMTP id v1mr5412551pfk.25.1524135551790; Thu, 19 Apr 2018 03:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524135551; cv=none; d=google.com; s=arc-20160816; b=li7mHYdrRit416WcuFpFtwOkLOn2Obe+RXdgnF3RjLLnXQrOR1UTgwsnhZFSDQhhla f9NPu19O9bvJBHyvhJjbSpWbmjSZPXhU29EGFdWV0Lt45ItD44lLkrfPOvDC7FpZ/6CV W30toZYS16R1V+/BgwCUzmZLOciw4GplgE2skJGCMPnA/p1sOGuw5qS/tZidsE58vvyL d+U+JwwECpm7UVPLOq9KqbNOCguHmLeCT+oYmQt1xfHcC0owXQIBfI/FrdDmNjsJczll KQreiET1IAoKvIwRrLz4yXGyz5krGYdZJlCRLBfERu8GmFXtZFqn0mysZi2b4bb2QYpB EGiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=yln2iUAo4qpz7lzHj0XJ0hAnQiu91h/Q0cTueTt6KRY=; b=v0+5wjnCeBB9sv/xst1D1yrVT5wfkWr+IzLH7BlBq1uUbaknmtWwYv3G2Ec3qDK/nC TpIKGYxk8KUlBntPw2lCYgdFcN9B48w7u92x2V1L0u/v2akCfzQudEOI/gyZVDqLWf4C oipR/ccHFitMe+7Szd/HIdNivF6R/o8RGrvnrqB2Fp2IuctbKXQPxr4+KaoU/w/qBEfG L/8Lbi5mY4GgTZ2eI+NW0hbg7kXqY3dyckKboZx4EDeM9MtCYdlYjeZJg+JO+DOwqCvV /cJ4QNOLM4MtqWWPGovpw7iakVJ5axdd7vFCdGMYKpvzGSE1OZak4RKvmUAtbQNKK3MM fibg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b39-v6si1543565plb.456.2018.04.19.03.59.11; Thu, 19 Apr 2018 03:59:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752694AbeDSK7J (ORCPT + 29 others); Thu, 19 Apr 2018 06:59:09 -0400 Received: from foss.arm.com ([217.140.101.70]:35902 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228AbeDSK7F (ORCPT ); Thu, 19 Apr 2018 06:59:05 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5377C15BF; Thu, 19 Apr 2018 03:59:05 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1F9583F59D; Thu, 19 Apr 2018 03:59:02 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Ralf Baechle , James Hogan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "David S. Miller" , Ingo Molnar , Peter Zijlstra , Steven Rostedt , Oleg Nesterov , linux-arch@vger.kernel.org Subject: [RFC PATCH 4/6] MIPS: Use update{,_tsk}_thread_flag() Date: Thu, 19 Apr 2018 11:58:46 +0100 Message-Id: <1524135528-28561-5-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> References: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch uses the new update_thread_flag() helpers to simplify a couple of if () set; else clear; constructs. No functional change. Signed-off-by: Dave Martin Cc: Ralf Baechle Cc: James Hogan --- arch/mips/kernel/elf.c | 10 ++-------- arch/mips/kernel/process.c | 15 ++++++--------- arch/mips/kernel/ptrace.c | 5 +---- arch/mips/kernel/syscall.c | 10 ++-------- 4 files changed, 11 insertions(+), 29 deletions(-) -- 2.1.4 diff --git a/arch/mips/kernel/elf.c b/arch/mips/kernel/elf.c index 731325a..2351509 100644 --- a/arch/mips/kernel/elf.c +++ b/arch/mips/kernel/elf.c @@ -267,14 +267,8 @@ int arch_check_elf(void *_ehdr, bool has_interpreter, void *_interp_ehdr, static inline void set_thread_fp_mode(int hybrid, int regs32) { - if (hybrid) - set_thread_flag(TIF_HYBRID_FPREGS); - else - clear_thread_flag(TIF_HYBRID_FPREGS); - if (regs32) - set_thread_flag(TIF_32BIT_FPREGS); - else - clear_thread_flag(TIF_32BIT_FPREGS); + update_thread_flag(TIF_HYBRID_FPREGS, hybrid); + update_thread_flag(TIF_32BIT_FPREGS, regs32); } void mips_set_personality_fp(struct arch_elf_state *state) diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index b9e9bf6..4bdecb6 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -763,18 +763,15 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value) */ for_each_thread(task, t) { /* Update desired FP register width */ - if (value & PR_FP_MODE_FR) { - clear_tsk_thread_flag(t, TIF_32BIT_FPREGS); - } else { - set_tsk_thread_flag(t, TIF_32BIT_FPREGS); + update_tsk_thread_flag(t, TIF_32BIT_REGS, + !(value & PR_FP_MODE_FR)); + + if (!(value & PR_FP_MODE_FR)) clear_tsk_thread_flag(t, TIF_MSA_CTX_LIVE); - } /* Update desired FP single layout */ - if (value & PR_FP_MODE_FRE) - set_tsk_thread_flag(t, TIF_HYBRID_FPREGS); - else - clear_tsk_thread_flag(t, TIF_HYBRID_FPREGS); + update_tsk_thread_flag(t, TIF_HYBRID_FPREGS, + value & PR_FP_MODE_FRE); } /* Allow threads to use FP again */ diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 0b23b1a..b218812 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -279,10 +279,7 @@ int ptrace_set_watch_regs(struct task_struct *child, child->thread.watch.mips3264.watchhi[i] = ht[i]; } - if (watch_active) - set_tsk_thread_flag(child, TIF_LOAD_WATCH); - else - clear_tsk_thread_flag(child, TIF_LOAD_WATCH); + update_tsk_thread_flag(child, TIF_LOAD_WATCH, watch_active); return 0; } diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 69c17b5..e9fa130 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -209,14 +209,8 @@ SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2) if (arg1 & ~3) return -EINVAL; - if (arg1 & 1) - set_thread_flag(TIF_FIXADE); - else - clear_thread_flag(TIF_FIXADE); - if (arg1 & 2) - set_thread_flag(TIF_LOGADE); - else - clear_thread_flag(TIF_LOGADE); + update_thread_flag(TIF_FIXADE, arg1 & 1); + update_thread_flag(TIF_LOGADE, arg1 & 2); return 0; From patchwork Thu Apr 19 10:58:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 133749 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp490450ljf; Thu, 19 Apr 2018 03:59:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+7mwJuirEO/2H/lC3mu2n+p5UoKdnGul3XPNJOAEu6l3iMGK9YgaDK7VeP2gmo6RrE4MCD X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10-v6mr5729988plb.329.1524135558876; Thu, 19 Apr 2018 03:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524135558; cv=none; d=google.com; s=arc-20160816; b=1KA0q4HK3CUnpIiNWzphZhbsAwZZAAk+MyV2zRBkTks00W1XVesb0QqUMA0qDo5Kpy ytfrAZNI6NQc4o4poXDrjRczAN0BOoh5bgIlVe31esnP/mg89H37THjk98d7JVlZbkDC XGUmGltW3JjMAe+Vk6l5eQv4KJTDQAz7z5lW/h2rwwZHIW/gwWxl3Qbx9fyWW/5+LU+v X1NlsALqbRXpBCv3ZbOobVQg6plfL9F5bMQpKcymL+zvjSBxDchPbTQ/Vt1fVJFkpih5 efVmALiCdkBv5aRhXCIMtSZIUrE8hWrq1HzUj6l7NjqwKHSnRDQ9OwpYhQFhTIH0iBeD 2Qvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=uos9N+/+gTbmX8esVvytXfTPR/k6nSOERv1pPyrGpvI=; b=vGk7iO7T9aZbTVfNIuXdyrzA6O5ipYy0H9+nZmmLb8chq8nUv1xRLkn2APLegCFDLQ bOlM1CfrJ7YghSJukCZR7IrErGGln2jVtrnaFH7/zYsIYx297GibUitAe974QCTmoiuB jTj8bEjjNqGk7cNV4fx1k9mGlnLCsrydlFJ+c+MpoUY4tWe9FreV5VMpxaM6q+IDu4G2 /iLc4knRkwEaLkiAFw6hYEkCLTHj4WdWLSrf7JNIxYqW9ZRgnQo7Kb8V/CAKJ+D2uQus /3roamWEcr/pdh1p21aSM9lJo/79UWVudoJ+0MIpvjtEXnRbJl9L7Io/F/Z0n2YVeNvN 0tkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b39-v6si1543565plb.456.2018.04.19.03.59.18; Thu, 19 Apr 2018 03:59:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752766AbeDSK7R (ORCPT + 29 others); Thu, 19 Apr 2018 06:59:17 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35936 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752670AbeDSK7I (ORCPT ); Thu, 19 Apr 2018 06:59:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EAA501650; Thu, 19 Apr 2018 03:59:07 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 936273F59D; Thu, 19 Apr 2018 03:59:05 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Ralf Baechle , James Hogan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "David S. Miller" , Ingo Molnar , Peter Zijlstra , Steven Rostedt , Oleg Nesterov , linux-arch@vger.kernel.org Subject: [RFC PATCH 5/6] powerpc: Use update_thread_flag() Date: Thu, 19 Apr 2018 11:58:47 +0100 Message-Id: <1524135528-28561-6-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> References: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch uses the new update_thread_flag() helper to simplify a couple of if () set; else clear; constructs. No functional change. Signed-off-by: Dave Martin Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman --- arch/powerpc/include/asm/elf.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.1.4 diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h index 548d9a4..136c9b1 100644 --- a/arch/powerpc/include/asm/elf.h +++ b/arch/powerpc/include/asm/elf.h @@ -88,14 +88,8 @@ typedef elf_vrregset_t elf_fpxregset_t; #ifdef __powerpc64__ # define SET_PERSONALITY(ex) \ do { \ - if (((ex).e_flags & 0x3) == 2) \ - set_thread_flag(TIF_ELF2ABI); \ - else \ - clear_thread_flag(TIF_ELF2ABI); \ - if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ - set_thread_flag(TIF_32BIT); \ - else \ - clear_thread_flag(TIF_32BIT); \ + update_thread_flag(TIF_ELF2ABI, ((ex).e_flags & 0x3) == 2); \ + update_thread_flag(TIF_32BIT, (ex).e_ident[EI_CLASS] == ELFCLASS32); \ if (personality(current->personality) != PER_LINUX32) \ set_personality(PER_LINUX | \ (current->personality & (~PER_MASK))); \ From patchwork Thu Apr 19 10:58:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 133750 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp490591ljf; Thu, 19 Apr 2018 03:59:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+w+AEJDt39eYhlq/dGWdnM7KWdzWvZLrUqGcEj8nN7IXifjszVPF7XVbJfxA+PYPUImwUd X-Received: by 10.99.163.9 with SMTP id s9mr4695142pge.187.1524135571152; Thu, 19 Apr 2018 03:59:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524135571; cv=none; d=google.com; s=arc-20160816; b=fGIiIYF0uuIqbdODH2ZM+ZcV6GphtkVHmFML262wVbMjDkoSwP+Pm6KBcIBZ0Lda/V mk0Ti315Oq8Fpykb2G3h+03/Ro4e5vauBtC+SBmDgaQ2nQy+e5x9oSYfkYAd7jxxGzq3 RrPpKPmVqepv9zB6SV5QjP/cShoBHCt32i5s0j9TpMonGouSU3V3fQKfitfWrvkh2uRx clCN/fIAgIiB4+ddp8EKbVOfllwhGuqx6YmUDRxMNPRCB34Ds/BQZQMo6lPJ/MDsyNVU 85WJ8YCNPUYyOvzY9X6xYj31OmI6FmN7u+lv2uRNeYENJtpuNHNJDXqPLHdTzs3h/I69 jgEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=4kCJBo5ewAK0NimWdBT8srbQ3afKURBI5lb0MZuPf+o=; b=UV+WRKsOd+EL1MU8bQJ3xTNWWWpIOqd5BcRSE7g5i5H4CfTC7R2O+OrE4sZb/Gnnkk wLDeV0nSRvuVmLDh7PHv4AZxRP3jqNwVwvdDO21jW55oqSaT2rTH/f063RJlbUtBD6EE 4n2qJz0dL8cV2EV7S3+Owt4qcO6YhydUDDGdVaxKibjEX+8bPluuBnKB4cauDVosGqog xn2vlov12WTB8luWik+rAjb1gyzSbrdNYkEfsEZaw8O47p8zcPktHmD0sNbWsUL/sUeV KPwojiD7ZrlMFlc9zKtwJvPz/Uz4LZzf87bC5UE6fAXDwhbsfYpkiA/W8DMDWfEMEKcC nKhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5-v6si3313880plp.330.2018.04.19.03.59.30; Thu, 19 Apr 2018 03:59:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbeDSK7P (ORCPT + 29 others); Thu, 19 Apr 2018 06:59:15 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35966 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228AbeDSK7L (ORCPT ); Thu, 19 Apr 2018 06:59:11 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8D35B165C; Thu, 19 Apr 2018 03:59:10 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 362033F59D; Thu, 19 Apr 2018 03:59:08 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Ralf Baechle , James Hogan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "David S. Miller" , Ingo Molnar , Peter Zijlstra , Steven Rostedt , Oleg Nesterov , linux-arch@vger.kernel.org Subject: [RFC PATCH 6/6] sparc: Use update_thread_flag() Date: Thu, 19 Apr 2018 11:58:48 +0100 Message-Id: <1524135528-28561-7-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> References: <1524135528-28561-1-git-send-email-Dave.Martin@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch uses the new update_thread_flag() helper to simplify an if () set; else clear; construct. No functional change. Signed-off-by: Dave Martin Cc: "David S. Miller" --- arch/sparc/include/asm/elf_64.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.1.4 diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h index 7e078bc..f1ef89c 100644 --- a/arch/sparc/include/asm/elf_64.h +++ b/arch/sparc/include/asm/elf_64.h @@ -202,10 +202,7 @@ extern unsigned long sparc64_elf_hwcap; #define ELF_PLATFORM (NULL) #define SET_PERSONALITY(ex) \ -do { if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ - set_thread_flag(TIF_32BIT); \ - else \ - clear_thread_flag(TIF_32BIT); \ +do { update_thread_flag(TIF_32BIT, (ex).e_ident[EI_CLASS] == ELFCLASS32); \ /* flush_thread will update pgd cache */ \ if (personality(current->personality) != PER_LINUX32) \ set_personality(PER_LINUX | \