From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CAC7FC433F5 for ; Mon, 2 May 2022 07:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QgXZFYbn3UIw/9wGNQGJgculvddhUIu48Yz/46Vg+Co=; b=JcdG48yLzUtzrI YdUUSDRRl5IqnQ2T0zgd7rgM+e1N7j3t2OgMgqzj7xvgkRDcs9jL+EnkLO7Lm7Z9oQt4UHhd1Vlo0 /If5z1ZV+g53z1w7mgfF/9f5B2fKswPUHd0wSROiSdmvSR5mJ3xDw9Z/zgeKJieplzjoOfDk18QqS utWWavmDlxKunZ6i1oK3HCbiwzS0QGT0ZSs0QSXD1USSJylGSmbBLG4BT5H1apXZVaCkTInWK/a/l xq7ULMMPbvbjkPjONPXWHeUtXptuuMps3Hiq554fwGhfwODIVLaqMRSCmmQMcSgxxE+XL0BMhUTjx xC4Rh0RaGiLfbnncbK4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nlQla-000Brr-46; Mon, 02 May 2022 07:46:46 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nlQlX-000Brd-VG for linux-arm-kernel@bombadil.infradead.org; Mon, 02 May 2022 07:46:43 +0000 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=pOoEoq3uxOd2hY3qnCRK9aDXRSIdbU9S375EHmEixg8=; b=Zx1qMADDPH8oEOTa4jVupxWl6E jp0Ix1UpwVxb/Fun8uQkpi/VDVUrELD+eS/RX9VUTmUff5Lfk9pHLGnzXGRo5XQjnKpVQAnDGA+HY 6njW7JD42U9XDnB6D3TI9rmTZ/aqSpbsxfUtPIHKH48smGoBc+hsJpqXaRadtuEJcHvW3GiOXvq13 d4zs632v/3gKbbrqz0yWyBW7gjlr+57/KxIGorr/dnptiwV1AYALOr2y65wpMHAAJ4xsSV0n37yzE 19MxrkmlClL3jeLhLETg9bIIv0pjGFEOLCYtKCiGSpok8qhV9B6cU0FBm//Y4T/y5l5jfkXJiDpIU UHe+W3Jw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nlQlP-00AOnG-Mt; Mon, 02 May 2022 07:46:36 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 4FA2398035B; Mon, 2 May 2022 09:46:33 +0200 (CEST) Date: Mon, 2 May 2022 09:46:33 +0200 From: Peter Zijlstra To: Sami Tolvanen Cc: LKML , Kees Cook , Josh Poimboeuf , X86 ML , Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel , llvm@lists.linux.dev Subject: Re: [RFC PATCH 14/21] treewide: static_call: Pass call arguments to the macro Message-ID: <20220502074633.GA479834@worktop.programming.kicks-ass.net> References: <20220429203644.2868448-1-samitolvanen@google.com> <20220429203644.2868448-15-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 29, 2022 at 05:49:21PM -0700, Sami Tolvanen wrote: > On Fri, Apr 29, 2022 at 4:21 PM Peter Zijlstra wrote: > > 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. > > Clang emits an indirect call for ({ &f; })(), which is optimized into > a direct call when possible. Come to think of it, the recent > InstCombine change to the compiler patch should solve this issue. Let > me double check, I'd be more than happy to drop these two patches. Oooh, but this must not require any magic. That is, we have a *ton* of code that relies on constant propagation of function pointers to not emit indirect calls. Please make sure that 'just-works'. Look at all the __always_inline functions in rbtree*.h for instance, some like latch and augment rely on quite complicated const propagation for the actual function pointer is in a const struct. I've verified all that actually generates direct calls when we did that code (on GCC, clang wasn't really a thing back then). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel