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)) {