Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6523713rwl; Wed, 22 Mar 2023 11:42:48 -0700 (PDT) X-Google-Smtp-Source: AK7set+anrLVUxNxsLSk5CMFly7ackeX5Qm1R1CHX0fI58CrJFjjroeHeH762nAtrmlX3ZyQGSuq X-Received: by 2002:a17:90b:33ca:b0:23f:7843:93ed with SMTP id lk10-20020a17090b33ca00b0023f784393edmr4806882pjb.8.1679510568661; Wed, 22 Mar 2023 11:42:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679510568; cv=none; d=google.com; s=arc-20160816; b=AUFj/8Z8oE6LgQiTf+0D++mVo8BeKXhp61GeIs7qDYdmun60/GlXw44ZYg8wYexvwd lVDzBeZIXNjP7vK04OphiegIAFykTbRJq1/P600wMb7IdflvITWhvJaLqWm7bwJ7cx4B guDqfseH+wg0vc9qfRAdha2/KQcNAUuFEYAzi9Iefbu6NysYSoMVMnaPc9RHoZiNVRC+ tKlMrokF+aaPBtntOl+FoGV+PWqJtIuSP10QtBP+0BHOnBNIXOOXfUKHeRURlEYv3j3G v3vThZ3dnGfyiRuErLUkqhvNse8vDCHnCqL7VNUIvdscojPXwAliilFt90QcDx0Ckf8v R13Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=S711V3vqc9goCbJ9t3svFPYGPiRxO7DtyrZ6YBUm7kg=; b=Fp6ycjUrMu8Wv/2aD+f9L2E43Xwf2fhXPtA7zZpsjPxepF6P+XEOIWlnEC1PAgzWa6 o1GMueIwoSt7jxDwO/VgdEK/wnpZXpPaZVak926qVhN7vg3f2SrENdPD2aCXenHzfVA6 wwe+BtpYqm3i7QKYQ2rQ3mFpMXZ32t1xb8cuks75+4eulkC3UzCkD0IPMIAa+0aRrdOb aEx6gUoTlO1fZ4Q9W+ear1/tenvVmHtHon+CsJFTJn2IcOAKLqtdhSBsNIyAbiNqKddc ilVuQVp0KZA5VOQCpg9A3vd59etAyXbAQhVzU3Q4oDi5Z0SyR/SmyJeQUZDdSrmuQ6nS bBFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rjk8xzpS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb11-20020a17090b4a4b00b0023cfd08e30esi18288042pjb.148.2023.03.22.11.42.35; Wed, 22 Mar 2023 11:42:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rjk8xzpS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230074AbjCVSd0 (ORCPT + 99 others); Wed, 22 Mar 2023 14:33:26 -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: X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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