Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp134890pxk; Fri, 11 Sep 2020 02:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpg+Awz2h2vJjeWBJBdt7xxPatAHPEJisSO3U9LzOQu/dawVnunjs8kS5EQPIm5fu/OmFR X-Received: by 2002:a05:6402:456:: with SMTP id p22mr1014695edw.177.1599816853370; Fri, 11 Sep 2020 02:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599816853; cv=none; d=google.com; s=arc-20160816; b=KAVLh03val5a7/0BxC/Go0dpoIDXxqX0nNQzM92/3KgX0uk/THsXxXxMqfZLoL5aMo UDiJNQ4sVWQaV8bjQ5fd99KNE2YTQQYIm67i3+c/w2NzmKM8JGPCigoAGU0eVqH3gH8F eaBjdNLdYgD3r1SA5Cv/QLoZvoMBIkafLXsCWs1Xc15cwuXXtKs8167gdo+Uwvz/kN7y aQWap6pZuwA62tq4vAFSbUE/iRh5ZUsrGYZBsP/qGE4LAlFlLBl2sFqmCGZGk52kk3JN 79w73HdoGG7MgsVJRabS5BPidP/U/gVpeeGpi+9mbW+cC0nVeG+gfyFTJs2Tw8zWsB0M 1cvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=byQIC6UgJWmseFC9nmbs7RXzJK3qdkILERsCoHCugWs=; b=MHmj1zTDPitvZ6BIRtt8GrKnUFxGDMdCFHYA1B6+B7uRr3GZlxo9Kz1mUWiMiolYa8 EZbz8HSASKQvnw4c/dA+UBz9ZjJ7qrwHtGIW/NoW1UODh4dcioJnfzbipQpCQ7k2qWZy EezTitLzx/RvQ4KTOXKIRgqRcZaNFi/mX4z+0NDp7MUSF13PI28aT8cwKk1y956fyqyk JyDuLb+3OVE9PWhL1xzcCF5MW7S0Mn53gyeWxLxD/uIsaAg/YQ4ymCuFMzEcPWaoPpFP OJuiEs/johmdMGocX5ADN6dbliVUXROWhyUN3p8vofuelDS10jIRKoPdrI+VDp+X++nH 63gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZQQgMBfS; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si938422ejn.7.2020.09.11.02.33.50; Fri, 11 Sep 2020 02:34:13 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZQQgMBfS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725827AbgIKJcc (ORCPT + 99 others); Fri, 11 Sep 2020 05:32:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgIKJc3 (ORCPT ); Fri, 11 Sep 2020 05:32:29 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16B2DC061573; Fri, 11 Sep 2020 02:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=byQIC6UgJWmseFC9nmbs7RXzJK3qdkILERsCoHCugWs=; b=ZQQgMBfS9f9fKGY16bSRLKCWq1 di1lXzV9qLQwRVhx8rKhL5OEqPI40hatWWKJuXZQQ5T3BNIVVheCCUg3aV2SQPk6kRDQsMzhE0I8N 3SjYXRORXxuErboIWUpQAq6vztkTGTcbHVENERQl6Thbgotic4jL/3dldPKzMixUYr/U7j3nGzx7R g5BzVFC1Bk7IelEby7CMrUBxgygWVvshaWuR8O6aL2aZhEhSc7RYy2dsuvGddS9pIJ+QRUmjMm++x vsqiYNJPEjwajyMaC+jG54on15/cFnP2rzHLO0VME7+N10ITOsT/Us4xi2tcBfSiLfNfvnADx5xd/ MmeLgxcg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGfPr-0002xq-6V; Fri, 11 Sep 2020 09:32:23 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 59F22303DA0; Fri, 11 Sep 2020 11:32:21 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4C4F62B06AFFE; Fri, 11 Sep 2020 11:32:21 +0200 (CEST) Date: Fri, 11 Sep 2020 11:32:21 +0200 From: peterz@infradead.org To: Gabriel Krisman Bertazi 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 Message-ID: <20200911093221.GD1362448@hirez.programming.kicks-ass.net> References: <20200904203147.2908430-1-krisman@collabora.com> <20200904203147.2908430-2-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904203147.2908430-2-krisman@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) ? > +static inline void __clear_tsk_syscall_intercept(struct task_struct *tsk, > + unsigned int type) > +{ > + tsk->syscall_intercept &= ~type; > + > + if (tsk->syscall_intercept == 0) > + clear_tsk_thread_flag(tsk, TIF_SYSCALL_INTERCEPT); > +}