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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB1A4C6FD1C for ; Wed, 22 Mar 2023 18:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229617AbjCVSd1 (ORCPT ); Wed, 22 Mar 2023 14:33:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbjCVSdZ (ORCPT ); Wed, 22 Mar 2023 14:33:25 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2B2D132E0 for ; Wed, 22 Mar 2023 11:33:24 -0700 (PDT) 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 2D50ECE1D2E for ; 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-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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