Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6503819rwl; Wed, 22 Mar 2023 11:27:19 -0700 (PDT) X-Google-Smtp-Source: AK7set8MKXWU5ZBF4jCpi+Hcr0641T8hNf+TPKq7rpye4kCvQQuzqgkGa+bLju+Kt5dqxh5/5sgF X-Received: by 2002:a05:6a20:9c:b0:da:bb5f:41ed with SMTP id 28-20020a056a20009c00b000dabb5f41edmr349121pzg.61.1679509638901; Wed, 22 Mar 2023 11:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679509638; cv=none; d=google.com; s=arc-20160816; b=AmNZEfsOaN/O+DuaLm46keFNPKC88XAxINhKzclJqoUmErxag30oZwaV2ZkA6a1Tmr Bo05vmETYnJ977i7NH5/IFzLMSHuoWlXjEdA4o0ihMX8Flk9PVsnTgLW1ZL1sUJG/Tsb sr4P5LETyho/d56M4acaIX8H8VQ+6NJmX1acwJ4x7jKDaiXqqQYITFYe3hJBHbMX+ujh 0x9XexhcDdPU529TnL8QB5W/XLXVfLRXZXl/ziOcya91A6CDtH0R6KeyhywhE+2nIBXB tXVw2cRJr8vqM03RFui360n2qdfiHmaK6wVsp5iTY4vlR+dX7vpm82Rof8eIwdIRjc+u Ti+w== 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=5Ep87/vmR06nMDAvF+RkAfChPfNf5IZI9W5Og/mAvrM=; b=eIDbn+rTZEYJ6Ss/mbyqOnIsxL5Pf5g1yCJdCVa+otC7jUDJYp24ZY0N3wobJ7j9FG OFzoa2HWDfp4VFPjzVvGZLfHBtoz+zqWCFvLX9yuoCwRsNtwpATZHfT6DWAbzFp3X5+X C5KckHM42My3R2ARJi+4Ej5csmX1epcZGvkqoTkQM8L74zbATfb8vyIjYiSP2sZoUZkT rfxoJRpz2848nyN+X5GPxYzhV7graAEHGozrThVblSWfA5yRIJGcvFS2OnWVqmr1JrRS Oxo8t+8yDPtQxA+KppGOi2VY4HLiEToAQ3iI4QV5kOFLYqKh2+Hh8JD1uvwhZmdBfoHx mK7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RvQKIcTF; 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 g22-20020a056a00079600b005dc44c567a0si10544149pfu.24.2023.03.22.11.27.07; Wed, 22 Mar 2023 11:27:18 -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=RvQKIcTF; 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 S230467AbjCVS0X (ORCPT + 99 others); Wed, 22 Mar 2023 14:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230408AbjCVS0W (ORCPT ); Wed, 22 Mar 2023 14:26:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B0162D148 for ; Wed, 22 Mar 2023 11:26:21 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 2BE6D62267 for ; Wed, 22 Mar 2023 18:26:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7423C433D2; Wed, 22 Mar 2023 18:26:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679509580; bh=CNp6XvgesRx5FTnJf4WjIyqASMOSmavUiGLUcOYLzso=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RvQKIcTFfZK63U9V7DUJe46dhC1GCCLr2F2jPTZzLZY7J0DxnFPRjCPynY75AhixD lH+8Pr4UfvBKblvicGrsVIoXbwfrVAU0s43W1jn+o0AY5gsKxcWjfzuh5Z9CBZwmmw tacWhoRTrfiZYbIFze8TFaN2P2Us4icLJgBUbrWjTWem/Ziw8CEtszTL+XiUYGYJv7 BsP+B0oF/Lj1FZwZJqUCmzJBKV1y28cI/R6G6CKVnqIfk4OfQTOLQ5AlXfTDGyXz4/ 0598mKJlgvN7E5S27seBH/wkMN1+y279EKja7AzCALguGG1fOPGMYTUWz7piz7w5Lt eAjX0Ugz50xMg== Date: Wed, 22 Mar 2023 11:26:17 -0700 From: Josh Poimboeuf To: Peter Zijlstra Cc: Mark Rutland , x86@kernel.org, linux-kernel@vger.kernel.org, Jason Baron , Steven Rostedt , Ard Biesheuvel , Christophe Leroy , Paolo Bonzini , Sean Christopherson , Sami Tolvanen , 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: <20230322182617.eyfphw4o2tm5yqi2@treble> References: <3d8c9e67a7e29f3bed4e44429d953e1ac9c6d5be.1679456900.git.jpoimboe@kernel.org> <20230322141933.GD2357380@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230322141933.GD2357380@hirez.programming.kicks-ass.net> 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 03:19:33PM +0100, Peter Zijlstra wrote: > On Wed, Mar 22, 2023 at 12:22:07PM +0000, Mark Rutland wrote: > > On Tue, Mar 21, 2023 at 09:00:14PM -0700, Josh Poimboeuf wrote: > > > > +++ b/arch/arm64/include/asm/static_call.h > > > @@ -0,0 +1,29 @@ > > > +/* SPDX-License-Identifier: GPL-2.0 */ > > > +#ifndef _ASM_ARM64_STATIC_CALL_H > > > +#define _ASM_ARM64_STATIC_CALL_H > > > + > > > +/* > > > + * 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 > > > + > > > + > > > +/* Generate a CFI-compliant static call NOP function */ > > > +#define __ARCH_DEFINE_STATIC_CALL_CFI(name, insns) \ > > > + asm(".align 4 \n" \ > > Should this ^ be: > > __ALIGN_STR "\n" \ Ah right, you did mention that before. Will do. -- Josh