Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 335FE1FAA for ; Fri, 29 Apr 2022 23:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=GuE59RNYBcSn7YxgPNLjHOdq2pqA9HQAGI3HMZ8V3bA=; b=Mg6soHH5neJME8iJ1TwIkua8FK 4tj0TafDVMPpeqLC33cK1YvHmi7JKaWuMNmUIkVN7Y5J9FG967oWK9ZMRBXuyLwz3coHcpSnYUi+S qhtN1hnGwCbfWy13sN3Rb4aNTkWYbehc3ihRODwUTj8ysjEiGmXzA4lrwdgXtQ6bq+ELPHbxUOM+B 6IFDD+ykq2CD1tvoNT307XYOgsBkVrEz2iS3Xrn1sDUIH1xX/aNS2ggcoVsZ0xk3+6lylomVF2OLm J9fk2qe3YH1VFmcfT3hTEdUBxC7MYdG8CFqTEqrNUPkmbgLPHUoP0VcyhXhwBVhzxJqlkbr033Ii+ g/4U+wQw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkZvZ-009j5m-Ls; Fri, 29 Apr 2022 23:21:34 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A8436300385; Sat, 30 Apr 2022 01:21:32 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6CEFA2028F01B; Sat, 30 Apr 2022 01:21:32 +0200 (CEST) Date: Sat, 30 Apr 2022 01:21:32 +0200 From: Peter Zijlstra To: Sami Tolvanen Cc: linux-kernel@vger.kernel.org, Kees Cook , Josh Poimboeuf , x86@kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Subject: Re: [RFC PATCH 14/21] treewide: static_call: Pass call arguments to the macro Message-ID: References: <20220429203644.2868448-1-samitolvanen@google.com> <20220429203644.2868448-15-samitolvanen@google.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220429203644.2868448-15-samitolvanen@google.com> On Fri, Apr 29, 2022 at 01:36:37PM -0700, Sami Tolvanen wrote: > Include the function arguments in the static call macro to make it > possible to add a wrapper for the call. This is needed with > CONFIG_CFI_CLANG to disable indirect call checking for static calls > that are patched into direct calls at runtime. > > Users of static_call were updated using the following Coccinelle > script and manually adjusted to preserve coding style: > > @@ > expression name; > expression list args; > identifier static_call =~ "^static_call(_mod|_cond)?$"; > @@ > > - static_call(name)(args) > + static_call(name, args) Urgh, sadness.. I worked so hard to get away from that terrible syntax. Can you explain why this is needed? I don't think there are any indirect calls to get confused about. That is, if you have STATIC_CALL_INLINE then the compiler should be emitting direct calls to the trampoline. At no point will there be an indirect call.