From patchwork Fri May 11 15:05:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 135542 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp987500lji; Fri, 11 May 2018 08:06:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrgMjChF5+72cXMEvltBXd21sfhYBu/evrA2Beyqv0kaVTa3hYHt/rp7DFELl9lJvz4Al16 X-Received: by 2002:a62:dfcd:: with SMTP id d74-v6mr5903376pfl.114.1526051160931; Fri, 11 May 2018 08:06:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526051160; cv=none; d=google.com; s=arc-20160816; b=vyVS7PAjceFUUpXemDL3/hKhBzF5ii25fWzKBJNXQzIg2aUR4K3E4cqUytJtKY1AYf m2isIeufucoP6hof3agxWohAl11hDK8OS/bj0YzFVPlV5aKU9C1GrPWejxNGXyE+XAou f6MetVg0JW4oPLReuaZeM4g3J5uL22xTyvdIGc45nIplGwwtEwJBB6IC/S+tji8UDqJz s7/ZyRkOhlSrUdd9s/kP0RyYqR2ECORSHR71TFabLUUt5EfLKbKXCKEvlodt115l4w1X AVEuMqjArQ9EQ9B/WjkwtkYtc1Py/9a+/Vkw/CqqQ7ymLm29E9cCOdn/+ZWKLOO1JneZ zjqQ== 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=hh1CaIinupGHZpQcq2kwNRbqLeccCvBnJmAflYvFtYw=; b=uyAm8evurkRdoPzhlXLZqL1aM1otz+VEnepAus0ah2BcBl4GoR/gJ0MDOTKtMS4noi FqPcrhORGxSuH8PD6miUa1eBa2UB6uOQv+++/NpGvBq3kCrFYG2GTI/IpIaOn4dOslgI 7y/2XKzMM1JCjEAC7cLmagwnH6QoUILwBa/MYB/YT6HsKY2994+1q15FHQlp4MIueOON 8pONmYOcKAdWKVlQUlBko1WuwiMGZjz8YbFhsBwSfzvfE/w3jORBXBStWQ0aRYhvYg3B g/UKzgyWuqFhBetvJFEcfTdaieziN7a/wPlKVMcvxvz3rAG2i+IXf3SxHahsjOnY/jY+ zdtg== 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 n10-v6si3087083plk.112.2018.05.11.08.06.00; Fri, 11 May 2018 08:06:00 -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 S1753397AbeEKPF4 (ORCPT + 29 others); Fri, 11 May 2018 11:05:56 -0400 Received: from foss.arm.com ([217.140.101.70]:43150 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753145AbeEKPFy (ORCPT ); Fri, 11 May 2018 11:05:54 -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 AC6001650; Fri, 11 May 2018 08:05:54 -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 BE8483F23C; Fri, 11 May 2018 08:05:52 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: 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: [PATCH REPOST 1/5] thread_info: Port core code to use update_thread_flag() helpers Date: Fri, 11 May 2018 16:05:00 +0100 Message-Id: <1526051104-15995-2-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1526051104-15995-1-git-send-email-Dave.Martin@arm.com> References: <1526051104-15995-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 ports a couple of relevant bits of the core kernel to use the new update_thread_flag() helpers. No functional change. Signed-off-by: Dave Martin Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Oleg Nesterov --- include/trace/syscall.h | 6 ++---- kernel/ptrace.c | 13 +++++-------- 2 files changed, 7 insertions(+), 12 deletions(-) -- 2.1.4 Acked-by: Steven Rostedt (VMware) Acked-by: Oleg Nesterov 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 Fri May 11 15:05:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 135543 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp987546lji; Fri, 11 May 2018 08:06:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpjOmHNg6mmZDFGTnFurz6Fuxro+RF9Zobw6c5m80OcKgvprp0PVdmFfADGAsLTH9NKI72D X-Received: by 2002:a17:902:7e05:: with SMTP id b5-v6mr5747084plm.230.1526051163655; Fri, 11 May 2018 08:06:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526051163; cv=none; d=google.com; s=arc-20160816; b=ARrmutw/C1tqH8o60Qa6Wng+WZw7pmSvVerCaLJBz3lCpwMdpuZmB/SKUwAGnjp6Ww HbP/39n+W+lUEiL3tMh4Kb1wzLVot4vdHvlJi50qrtMeppR7nuKh3be58SWo69gbK34z iwtIe5qQJ59P2KIwy6NIsW/D1LWQIKVigEH1yNOych7P8qtYuhr5E6GAtRSzXuUj8rV+ PQZAiZK6Hn+V/NxiZMWJTOsAImWYB2axx/qSqAG+DUqReZYLaAzvQxHtEtL3BGFJnm+o CSQZAOPCBQV8D5tExOFlcgZMPQhluPD18IFnTfZVRaMtIBGVvUnI/JXZRAVJYi2YaIcR E14Q== 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=WjACOErfMxWvCTPwvXq+5DsusNo3NPyfhegwd+9d0KWv0Nsqrji17cfvGPHF5ddF/v QJxG2NjdveEVP5JtQ4+j03GoSz4CJq+YZV0qAa/v67ss8Q/MG+btHTzeBVr9Ucc+JNQO FEY56MDg6xJo7wQXKdojZMStAl3GejM+vwN0GqqiwNc6jRrB+TH/JoSOkquyUFnHGbJB 2YVvaL6ZStnWnoD4EvxC7ghUa4IMdl4GuyUPNZSAT4X5f5Sj8TFU/iTBI4rNSJN+VcoP wFO8rpmvofarrbmNe9t9JChRmgg+cLDoRNdwgI+hXzT0OfkL3CG1cA/tLydUB7PTWMXc oq+w== 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 m19-v6si3509995pff.303.2018.05.11.08.06.03; Fri, 11 May 2018 08:06:03 -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 S1753420AbeEKPF7 (ORCPT + 29 others); Fri, 11 May 2018 11:05:59 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43172 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753145AbeEKPF5 (ORCPT ); Fri, 11 May 2018 11:05: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 2B24B1684; Fri, 11 May 2018 08:05: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 EAD683F23C; Fri, 11 May 2018 08:05:54 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: 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: [PATCH REPOST 2/5] ARM: Use update_thread_flag() Date: Fri, 11 May 2018 16:05:01 +0100 Message-Id: <1526051104-15995-3-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1526051104-15995-1-git-send-email-Dave.Martin@arm.com> References: <1526051104-15995-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 Fri May 11 15:05:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 135544 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp987621lji; Fri, 11 May 2018 08:06:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoD797MsS5D/SpD6NS+d++xK6T0uwQUkOF2qfQB/PlnY2RQU4cagQhAZliFnfWVC0mwWk2F X-Received: by 2002:a17:902:30a3:: with SMTP id v32-v6mr5927783plb.123.1526051167487; Fri, 11 May 2018 08:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526051167; cv=none; d=google.com; s=arc-20160816; b=TNpKofCs7Cf8IRVRvKe+JnDMyxqPLUEyrKxn3cBFKrKtcqBD/BSQUjOLHrcqe+nwjp 3P8Y2dI17/uqLNTlOKan8km8Rd6S4Zuv2EUyfAJnr2N55DmUDvpGsU9vwR5tAA+yk4u+ lDypWWPgV3p8OBi5O/0RN5jTGkXTso6onwgNv30AqZuK8KN4Szh623XzgbIiTbxT19kJ 1r9NYrHSXAQpImd1ECI0gEtEsV17NfT7yQEC6CIQysjN94Pr/KHF+z8orob+sU6CDoGI wqXk7AgDDep7faBV4/FyuGANaS/MtEz6+bPJHtNahJFgKvaUg8+/THgs8K9fx8EU7Hbq 89OQ== 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=kc6uyzB4v69m3J5BhVA5cyZICFVGEgP26YPXoxDN1BzVSjnWvX2A2LsKkDa9xpg6m+ X/KWx3/ed3+a3ey9ynPvA+OK3F1OUXInYJ6+dFKvk6uNGi78bGbAtAvZElOIyO9JuH9X 2GP5EhWqVkWH4nfZhvUOMmRzc3b2hL8GosJzqEslK1pgunrZQS3owkgcm67cLayy2jsZ 4O5+s0VccfhhMJ2bFPiOUXsosyKMD+kB07/YfDDSV7/F2MLCgMEobu5EcAxNKqZzHJbA Ca8huRk09eLo2w3mNxXKfFpCUjIfR6znuudlGMjroDbRK5Fn9YipnEKtmmPPeBZounub UAOw== 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 m19-v6si3509995pff.303.2018.05.11.08.06.07; Fri, 11 May 2018 08:06: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 S1753439AbeEKPGD (ORCPT + 29 others); Fri, 11 May 2018 11:06:03 -0400 Received: from foss.arm.com ([217.140.101.70]:43198 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753421AbeEKPF7 (ORCPT ); Fri, 11 May 2018 11:05:59 -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 5781D168F; Fri, 11 May 2018 08:05:59 -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 699E83F23C; Fri, 11 May 2018 08:05:57 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: 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: [PATCH REPOST 3/5] MIPS: Use update{,_tsk}_thread_flag() Date: Fri, 11 May 2018 16:05:02 +0100 Message-Id: <1526051104-15995-4-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1526051104-15995-1-git-send-email-Dave.Martin@arm.com> References: <1526051104-15995-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 Fri May 11 15:05:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 135546 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp989693lji; Fri, 11 May 2018 08:07:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqCI0IhQMtpL3d3MOVdKmhkVsTshExItNQU3gLeDWiuuv+/ZRf22WBshJqOQEr/FP+bi729 X-Received: by 2002:a62:4cca:: with SMTP id e71-v6mr5813921pfj.171.1526051265379; Fri, 11 May 2018 08:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526051265; cv=none; d=google.com; s=arc-20160816; b=yI4yxX4cN8DZlU7PY4JdGP8f4DXYHJPi2KazSxzhPaVhzBgOpYgGlVDaai3wdufmec Rsyyxtiuosr/sN0nwOQFbcEZkGw6BnX/+T/8n1bxlL5r49T5sOqZd795RAQqHC500B91 8CZqpdgyZUnyX2WeMJRR6trcElc3yHuiJ2Hf8sUnkv3xoqf+Zd9j28YrLkNDo/Tbffna 8OVKe7Wk4q37dBCWCDjHFu0iz5SEwrI36Ba0jkT5YHNRi9rtIdzGRRsqkx/QLFcI55I5 kMRld40P6Btx2tLbWjTB0uU+DfEfTjZRw9nveai/3kSj6iLp09g2bXQhNK2RCZUdh7FE mbJg== 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=CQXBogU6ewaFGBR1yN/68twJ8qEQDZaQssAgx6e8+RHB8EBIXX4NpY+ZLtSQywJnxs Q0sDbipLfR9OlBixzQFhrj2xVdYMjGTePeknE1TgaTbeKuhnj3Oc5VOhn628ts08SO7N or6kPaIWXyXNEvYoejYKtqTmRlR9TkvUQtfNs9fIUjsVNuaUJQw03Ag/JvWdzf9Nvq0g e6FxYkZktj8/sq2gmvJGa8hS8mjy0oi3Xsy9ebVPzQOn7ss66Qs8YrwPix1hBiD2EyNV RMXhPCw0ULk9kCiZP8jdVbhklZFc4P6b388blTLneZv7XEXWTdqv2175lKrkiq9aYWc+ a4ug== 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 s14-v6si2670766pgf.640.2018.05.11.08.07.45; Fri, 11 May 2018 08:07:45 -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 S1753601AbeEKPHm (ORCPT + 29 others); Fri, 11 May 2018 11:07:42 -0400 Received: from foss.arm.com ([217.140.101.70]:43220 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753423AbeEKPGB (ORCPT ); Fri, 11 May 2018 11:06:01 -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 A74CC16A0; Fri, 11 May 2018 08:06:01 -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 9622E3F23C; Fri, 11 May 2018 08:05:59 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: 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: [PATCH REPOST 4/5] powerpc: Use update_thread_flag() Date: Fri, 11 May 2018 16:05:03 +0100 Message-Id: <1526051104-15995-5-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1526051104-15995-1-git-send-email-Dave.Martin@arm.com> References: <1526051104-15995-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 Acked-by: Michael Ellerman 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 Fri May 11 15:05:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 135545 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp987659lji; Fri, 11 May 2018 08:06:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp8H4CIaK6Itp8iPv7ukC/5lamQp33O7O6cIwy4Pz5mThSiDFxgqRbODgl2W9xoxREPHGnm X-Received: by 2002:a63:7d43:: with SMTP id m3-v6mr4832136pgn.117.1526051170086; Fri, 11 May 2018 08:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526051170; cv=none; d=google.com; s=arc-20160816; b=pWwbWIqRRF3cZj00VHkelx7DDEcr0jvTlXF3kliXw0+5OZo6TGk2xUuDay1QmBDpvH TIKuKNCaYh6kcrkoPb4dQio31Lln8sOroiIYMMKAaCi+r4jk0IfXF4WHL/VSiWvbP93p hvaWXpLQQlJkmrKtl1ukTwFm4r9OaN91dJ2cXh06Cy1epoe54hkR/iv9FvebPfc1cYTY E8HH8DD82m78J/Wg/LVbkn/Jy1U6aLLhZtjjSstr5TjH1OnzWiDNd8xRSELWKkwqRU6G HLyCH5spfUhCzeZ33JqMxIIBmEwDI2PXWC5aNTiOerNgHpx42551cL0RPzwZjcQGjXrP PkZQ== 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=vOaKvVBvKlpsU3qzC4DRba41VQ3tHlY61WHIliuJwdYpe8ZwQVimfQjdTxL/Z2CkuH s4Byf2Icn+BRqydRhGS5sxdorJkXCW4dOsy5bhF8owo5iKGFULmZNtajx1UW/1tvUPPX q1FYgrk00zlWhnHKpTdmXWBKubXXIm92bnmq9E/qE00btq9KDLs6aKKXseleuXynnc7O zkEYOWiX46COxXI6eMCqP1Mni2D20TCJc+GKlfRX6VfEFW9znUqBaxQLtL162a0sN4WJ bvhiwlCvxG8KkxWyk3PQ2ArU23jGlINhnkW8j/C0IHFzzl2cZa+JoJyMeOOxpSZONkWj Xo/w== 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 b61-v6si3335661plc.500.2018.05.11.08.06.09; Fri, 11 May 2018 08:06:10 -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 S1753463AbeEKPGG (ORCPT + 29 others); Fri, 11 May 2018 11:06:06 -0400 Received: from foss.arm.com ([217.140.101.70]:43238 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753421AbeEKPGE (ORCPT ); Fri, 11 May 2018 11:06:04 -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 02DFA16BA; Fri, 11 May 2018 08:06:04 -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 E5EC33F23C; Fri, 11 May 2018 08:06:01 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: 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: [PATCH REPOST 5/5] sparc: Use update_thread_flag() Date: Fri, 11 May 2018 16:05:04 +0100 Message-Id: <1526051104-15995-6-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1526051104-15995-1-git-send-email-Dave.Martin@arm.com> References: <1526051104-15995-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 Acked-by: David S. Miller 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 | \