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 645A2C6FD1F for ; Wed, 22 Mar 2023 18:34:15 +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=9zRt350nfGHeeo33MOOA9jBHKGJ6Mx0iUFjs5i5gJKc=; b=n/bM5oft6VPi42 lFk5/65akI7GMPtuAnNXfy5O6IvMH0OFa6FYaOBq8BZb2UZEI/GKHn2TXAFZdvhb/hAMeBKNX1h3p zgM9RlO6i6/G4f41J5GM9cBtA4WtbnE8YPcPeOr8wWb0UokY9BFB412HJOBk+cuViilDpCRCoPwAm ZsQQ1GkQCFxeblO/qiXULP6MYGELbrxQ+j19ceMy2pKsFxv5N1TjiUpN0YZLodOZIhj+LKwdyg8Ar QggngBZpwKrtC32KKBXS7yjVzULsVRsydMMhJw69tdLQ+7tBHQRhxhH2BXkZDhTDsft5IZBDNl8Ne ot694wydMH3jOs2KQvpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pf3H6-00H1tl-0g; Wed, 22 Mar 2023 18:33:28 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pf3H2-00H1sh-2y for linux-arm-kernel@lists.infradead.org; Wed, 22 Mar 2023 18:33:26 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 03EF8CE1D14; Wed, 22 Mar 2023 18:33:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBBFAC433EF; Wed, 22 Mar 2023 18:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679510001; bh=8sgbiQ5GWQMIb7f1SUhqvJcyq2pw/WxgGPM5+WJNN90=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rjk8xzpSudwSb3umMZyFNtnq+zAtHui6AzDhkWQenYYn9f3WkUIoKOMDWXBe2765M GHl+dTopZ8A/Rmhg+mb33Ww7v+eDrx2y8SWgDGwSC/i/jo+nA5gT194Gn4eA29FzZw vqT2JOxAwCAwh59yhe1S8qwIffFuZXoLkBon9WyydSCJAgWee6lk9vUbBan66f2LLv rdMyds1OHOiOGM63Z8T9S9aHfBxy/Cm3JHJdGwlIRsnv2UVR275JNHAQhJKgKbTukY Ir6tgwTHnzggPbclqAoIC0BngMZPRloVfVAywH8dwFsuHeHhJ66xuW1eJsKvbzSvie o0ANA4NX1qyQA== Date: Wed, 22 Mar 2023 11:33:18 -0700 From: Josh Poimboeuf To: Sami Tolvanen Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Mark Rutland , Jason Baron , Steven Rostedt , Ard Biesheuvel , Christophe Leroy , Paolo Bonzini , Sean Christopherson , Nick Desaulniers , Will McVicker , Kees Cook , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 08/11] arm64/static_call: Fix static call CFI violations Message-ID: <20230322183318.pqu2jjmi33j4an33@treble> References: <3d8c9e67a7e29f3bed4e44429d953e1ac9c6d5be.1679456900.git.jpoimboe@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230322_113325_144340_AF0B1699 X-CRM114-Status: GOOD ( 15.13 ) 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 Wed, Mar 22, 2023 at 11:07:21AM -0700, Sami Tolvanen wrote: > > +/* > > + * Make a dummy reference to a function pointer in C to force the compiler to > > + * emit a __kcfi_typeid_ symbol for asm to use. > > + */ > > +#define GEN_CFI_SYM(func) \ > > + static typeof(func) __used __section(".discard.cfi") *__UNIQUE_ID(cfi) = func > > Couldn't we just use __ADDRESSABLE instead of adding a separate macro? > The type of the variable shouldn't matter here, as long as we take the > address of func. Oh I did pretty much reimplement __ADDRESSABLE didn't I ;-) -- Josh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel