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 DE7ACC6FD1C for ; Wed, 22 Mar 2023 14:20:35 +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=69I2EI4Gy0YZ0TPHT0/4H6bhvx8U7GbvTfXk724J9dY=; b=mZ7jlr1ZzdQNZO pqi+B357zrf1AC9Coagxy/VjAV2c4frjpdYXZfo7oSDx6xaiZwprPr5o2qS8y6flXFkgBHUJcV2p2 4H2zQKM+h9MRhvwWI2uKEG+IKHuWzEvkpVVq0Xd8UHWpesdccvQAGOVfxyQflTlIN8Qc+fIRHbz9j 8Z70dNtSiDtaljak3pBBo3rh8sJF0qQ5/bcPvxvUfLw/qcjC1VmPB89dWOP24K2hO/egs7HsPU5/N 7PSqsRXZBwYXOpaH5FG3LJgNOvByYc1dvdss0VvYs50mim5sFz/2roSJsHAo3q5qB/dkOsX+ozF2l K1p9rgO3284VuL7GMZ+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pezJX-00GGcC-05; Wed, 22 Mar 2023 14:19:43 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pezJV-00GGbp-1v for linux-arm-kernel@bombadil.infradead.org; Wed, 22 Mar 2023 14:19:41 +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=NE1PIMFkudPTW1JLolSau7zYkTz39Mje7OyjRZD68QI=; b=lI+Lu8mgPcskiOn3h0NWi5OrwF LYWqriodX5VFGezELDig2h3WgiiEwgBEnUOHB+VHGPktNSDDHU8J/D9wxX4PlXHN3nnToeaHB7uQs 1u8VSEugJ6xicm+8mRDcagBa6a8O1YkSrpC8dAO4cYPf3LlPHCb6ISt7F6a/Tc3WD5slsgvA6UUy8 N9bBp7N4iQq9FB8HOZ6ZoDrHOMo2c5Kheb+wXDdLAjyyqGoKRC7b1DrXN+LkNYnyFrm+JAGUj4J1G DwzgGSYL9Es/jnliUFhWr7Czr7QmWrKjA4Om1f3VbmV/oO7YyaQCchx1Z6cbbAN56n80+t0RLgRgb vDVwEW+g==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pezJO-004ZXR-1U; Wed, 22 Mar 2023 14:19:34 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id BB75E30031E; Wed, 22 Mar 2023 15:19:33 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 93AC520106E12; Wed, 22 Mar 2023 15:19:33 +0100 (CET) Date: Wed, 22 Mar 2023 15:19:33 +0100 From: Peter Zijlstra To: Mark Rutland Cc: Josh Poimboeuf , 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: <20230322141933.GD2357380@hirez.programming.kicks-ass.net> References: <3d8c9e67a7e29f3bed4e44429d953e1ac9c6d5be.1679456900.git.jpoimboe@kernel.org> 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 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" \ > > + ".word __kcfi_typeid_" name " \n" \ > > + ".globl " name " \n" \ > > + name ": \n" \ > > + "bti c \n" \ > > + insns " \n" \ > > + "ret \n" \ > > + ".type " name ", @function \n" \ > > + ".size " name ", . - " name " \n") Also, Mark, I think you can remove __ALIGN and __ALIGN_STR from arch/arm64/include/linkage.h they're very similar to the generic one. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel