Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp523046pxk; Fri, 11 Sep 2020 13:10:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyH1l64PMKO5Jdm+4vSexYaMx/OmRZgySMisPzBnIwYxXKWWe2Ru9s5vGMDxasv7CzLoKyq X-Received: by 2002:a50:d9c1:: with SMTP id x1mr4251772edj.283.1599855038426; Fri, 11 Sep 2020 13:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599855038; cv=none; d=google.com; s=arc-20160816; b=migEV3YjmsTWPeoPkr7TVHJGDphRVyadRYusC2rCcb9yDk/uirskIBA1pqYn2lDKUc e1VX4l+BuZeCWe82ECFguUc7C/Tqp0PDW51CJ676ywisIhkAlbfgk7Wk9/hP2mC+xdJr A0hf8OTTPzjaQxDAPH9eSRETGaoXLcj2UjUju9/wTb//N9ZPWyiCeHaSRy71yNbLSbyy Xq5O8S2vOAqr0IrvX4LatqDZI7Pc3mGEzhiNNRk82/dNfE8YoI5auzin5zYWFu5u5fpk IuziWV7k5oYD+OgFmLXPCgjlMHjwB2ZyqS2DkiKny1RVeSI/qhDAh6WgNQczOZMu2Hqc 3p4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:subject:cc:to:from; bh=phpcWCiNWaHYEGudfKK7AG84Bc4ff0YUYW+5k3yArDk=; b=btXDuuoqxb8/QCjpVZL565Qs7LdJeoEIPvlUFvaP+HrTLStFYK0fPk9gnAFc4e7gHg MvNMdyq3qenKvjiL8SAM0STKVQ2t6AgkEjsepgSexS6xUvwmLWkuw7Cri7s/cJt4XAyb 1xxu+05byS3vs/HImZjD2X5CCUcZOETbdB/G7g7NDB7vc5Hkdv4923oDFOqygrUtZyTG 5ej6rvUl8wxXIXDklYFGElZ3jG2UWKkD+nlHSbz2fwxnpZcz/jqTmcg4Paumn53MROdV L3yRbA8OPF5K1fimN++GsuHA7kHMfMtfaGr0SSiHCtyHOVNon/KjsznhJc551H0I/hKb ocuA== 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 l24si1945915eji.478.2020.09.11.13.10.14; Fri, 11 Sep 2020 13:10:38 -0700 (PDT) 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 S1725828AbgIKUI4 (ORCPT + 99 others); Fri, 11 Sep 2020 16:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbgIKUIy (ORCPT ); Fri, 11 Sep 2020 16:08:54 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C93E7C061573; Fri, 11 Sep 2020 13:08:53 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 53A7E29BA66 From: Gabriel Krisman Bertazi To: peterz@infradead.org Cc: luto@kernel.org, tglx@linutronix.de, keescook@chromium.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, willy@infradead.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, kernel@collabora.com Subject: Re: [PATCH v6 1/9] kernel: Support TIF_SYSCALL_INTERCEPT flag Organization: Collabora References: <20200904203147.2908430-1-krisman@collabora.com> <20200904203147.2908430-2-krisman@collabora.com> <20200911093221.GD1362448@hirez.programming.kicks-ass.net> Date: Fri, 11 Sep 2020 16:08:45 -0400 In-Reply-To: <20200911093221.GD1362448@hirez.programming.kicks-ass.net> (peterz@infradead.org's message of "Fri, 11 Sep 2020 11:32:21 +0200") Message-ID: <878sdgnkj6.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org peterz@infradead.org writes: > On Fri, Sep 04, 2020 at 04:31:39PM -0400, Gabriel Krisman Bertazi wrote: >> +static inline void __set_tsk_syscall_intercept(struct task_struct *tsk, >> + unsigned int type) >> +{ >> + tsk->syscall_intercept |= type; >> + >> + if (tsk->syscall_intercept) >> + set_tsk_thread_flag(tsk, TIF_SYSCALL_INTERCEPT); >> +} > > Did the above want to be: > > unsigned int old = tsk->syscall_intercept; > tsk->syscall_intercept |= type; > if (!old) > set_tsk_thread_flag(tsk, TIF_SYSCALL_INTERCEPT) > Hi Peter, Thanks for the review! I'm not sure this change gains us anything. For now, __set_tsk_syscall_intercept cannot be called with !type, so both versions behave the same, but my version is safe with that scenario. This won't be called frequent enough for the extra calls to set_tsk_thread_flag matter. Am I missing something? Thanks, -- Gabriel Krisman Bertazi