Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3262931pxb; Mon, 16 Nov 2020 09:47:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfO3yEmDt5csAhExbNUKBaqMcrLq3No4eedxNA+waEzSTgH1BQKuP/0tdCP11cEgS2FFMe X-Received: by 2002:a17:906:a4b:: with SMTP id x11mr16066882ejf.11.1605548838094; Mon, 16 Nov 2020 09:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605548838; cv=none; d=google.com; s=arc-20160816; b=URnjxkvzbUYdzs6haIuIfksSkRrg4ucgVnmhYU/pOpYPyVArBAdgzhKjSqbvs7Wp/I L4UVwQG1WIRdFP5jXb+GomyKJC+YfMN1UBBTM5iOdY9MqZtP8fyh4dmEn90cgNUA41QR 37St6YxqZ0JWLhKrasOLR+t6Aa62DeFMFcv6soMJiYn3fxXkInI+io3zf/KWn78xz1gM UtzLoHAc24PaP5c1Ltqp5KFbSFy+NS+o7bo4vz9e+Y3vCOde81MY75qQ1+zKuc9pZ7Yq G6T4N8CxvQ/UsWAptHen9GmrFkBW/NgyLWbSs4VERexbwOGy2eXVuJZ3Xt6wmSLIPtct emEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=MQdk1lG9GWNNQDtZwzsxIOQX0hNGACVM1IhWurnfN3E=; b=crx/q9U8l5IQ27yId0SKaiGb+6QF9DfCwzXB0xWt2laMPa6NwzrnN4Xu3rqlocHMx/ mxJbdl6fS1YobFyAzDuw3jUWUat3cJjzcRl/h0V+vUDNwvJNMtYGQBEJDG0TBjPqehWR 6L1jLo+B6hsEZCYa1BG7jN81IleMPwyOvbo3p+rLrQUZYn7BONa+kY4VBWjfZWEBrM73 qqcmNyhUNbcZKioZyOZkQJiesXWk9P/dlEwPfBqgcB9VJvUHKpmDVdbCAj54sYW5JZGz 5dep+pIAHYGj+U8ZariBgftJN6axy5kleS7DsfW5sVlM6SbCw28oAATHYAJFrLzO0ZS8 RzsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si2974988edr.228.2020.11.16.09.46.55; Mon, 16 Nov 2020 09:47:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387904AbgKPRm0 (ORCPT + 99 others); Mon, 16 Nov 2020 12:42:26 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:34282 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387899AbgKPRmY (ORCPT ); Mon, 16 Nov 2020 12:42:24 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 7F99C1F45E49 From: Gabriel Krisman Bertazi To: tglx@linutronix.de Cc: hch@infradead.org, mingo@redhat.com, keescook@chromium.org, arnd@arndb.de, luto@amacapital.net, wad@chromium.org, rostedt@goodmis.org, paul@paul-moore.com, eparis@redhat.com, oleg@redhat.com, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Gabriel Krisman Bertazi , kernel@collabora.com Subject: [PATCH v2 02/10] entry: Expose helpers to migrate TIF to SYSCALL_WORK flags Date: Mon, 16 Nov 2020 12:41:58 -0500 Message-Id: <20201116174206.2639648-3-krisman@collabora.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201116174206.2639648-1-krisman@collabora.com> References: <20201116174206.2639648-1-krisman@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the goal to split the syscall work related flags into a separate field that is architecture independent, expose transitional helpers that resolve to either the TIF flags or to the corresponding SYSCALL_WORK flags. This will allow architectures to migrate only when they port to the generic syscall entry code. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v2: - Drop bogus cast to ulong (hch) - Fix subsystem prefix (tglx) --- include/linux/thread_info.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index e93e249a4e9b..f2d78de55840 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -97,6 +97,36 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) #define test_thread_flag(flag) \ test_ti_thread_flag(current_thread_info(), flag) +#ifdef CONFIG_GENERIC_ENTRY +#define set_syscall_work(fl) \ + set_bit(SYSCALL_WORK_BIT_##fl, ¤t_thread_info()->syscall_work) +#define test_syscall_work(fl) \ + test_bit(SYSCALL_WORK_BIT_##fl, ¤t_thread_info()->syscall_work) +#define clear_syscall_work(fl) \ + clear_bit(SYSCALL_WORK_BIT_##fl, ¤t_thread_info()->syscall_work) + +#define set_task_syscall_work(t, fl) \ + set_bit(SYSCALL_WORK_BIT_##fl, &task_thread_info(t)->syscall_work) +#define test_task_syscall_work(t, fl) \ + test_bit(SYSCALL_WORK_BIT_##fl, &task_thread_info(t)->syscall_work) +#define clear_task_syscall_work(t, fl) \ + clear_bit(SYSCALL_WORK_BIT_##fl, &task_thread_info(t)->syscall_work) +#else +#define set_syscall_work(fl) \ + set_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl) +#define test_syscall_work(fl) \ + test_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl) +#define clear_syscall_work(fl) \ + clear_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl) + +#define set_task_syscall_work(t, fl) \ + set_ti_thread_flag(task_thread_info(t), TIF_##fl) +#define test_task_syscall_work(t, fl) \ + test_ti_thread_flag(task_thread_info(t), TIF_##fl) +#define clear_task_syscall_work(t, fl) \ + clear_ti_thread_flag(task_thread_info(t), TIF_##fl) +#endif /* CONFIG_GENERIC_ENTRY */ + #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED) #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES -- 2.29.2