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 05EB8103E2F1 for ; Wed, 11 Mar 2026 23:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eVXn+Bxh0tcCavT748ERcPpFO7MJkNREEPJ3NP1c5Qg=; b=rshtRirqCIo+a+gyPZF5Lm/9wW UQgrwubR0oVcA6qPskcSyW1NFZS6bQ7cpIFCfpB9feXYWW072MFdsRiaoy9nrf0yNO8/BYI27GA7X /3sEZjy45Rvb0UDEpuysUiH+NtgugniQ/vvkrLhTRQUi9nKxl6S5wELVOksQzf/WT4gfe+J9uTfhG sSHUCxh6oPGPSlUewGVxtel8UBGENwfICUGWJPs9ZTbwdf2R3ifZ9AxMPC/TRjpccjdyJsypdcWJ5 dDudp5Nttfq5iBGfwCye47ZPWhf5CWO8DD56kNfnZSpYJ5qUew9aDUWxv5eQJmdMg56P+4w8OU+EG juUt5wLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0Skw-0000000CmBr-3GF2; Wed, 11 Mar 2026 23:14:22 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0Sku-0000000CmAe-3HEq for linux-arm-kernel@bombadil.infradead.org; Wed, 11 Mar 2026 23:14:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=eVXn+Bxh0tcCavT748ERcPpFO7MJkNREEPJ3NP1c5Qg=; b=UfpF0uo0FDgd7R0MDjKkcRKS7U cdQhSBvIrBkvZ7epa1i/Av2klUvrcaXeRJ10syoBuITEGN8rgFnxXrwtKA8y4f2FsOUZH2/KldYls Ddwye10mIBnhxYaC+US4Mc5xlsA7aCPM8flPYoxAvfVlgbns7R0wGM9U//5bjPN3yKA6H3HqpIUeA G9olTQ1p9+h5su/n5Qc9gMiGqYmMSmuf2HCJTyhye0HX0xwlIi+LddV+oivZa8Ti8jy9rOnOemlsJ 5J7Q1DgOhij7XsHdLEmSGzFFKGLCl4uF2LXIDiW3kZq/chpZlUtM6BwVOMTnHQT2zRdb2abYL+4Uq uxoL5nxw==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0Skh-0000000ARqF-2AyW; Wed, 11 Mar 2026 23:14:07 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id F0C0C301150; Thu, 12 Mar 2026 00:14:06 +0100 (CET) Date: Thu, 12 Mar 2026 00:14:06 +0100 From: Peter Zijlstra To: Carlos Llamas Cc: Sami Tolvanen , Catalin Marinas , Will Deacon , Josh Poimboeuf , Jason Baron , Alice Ryhl , Steven Rostedt , Ard Biesheuvel , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Kees Cook , Linus Walleij , "Borislav Petkov (AMD)" , Nathan Chancellor , Thomas Gleixner , Mathieu Desnoyers , Shaopeng Tan , Jens Remus , Juergen Gross , Conor Dooley , David Kaplan , Lukas Bulwahn , Jinjie Ruan , James Morse , Thomas Huth , Sean Christopherson , Paolo Bonzini , kernel-team@android.com, linux-kernel@vger.kernel.org, Will McVicker , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , "open list:PERFORMANCE EVENTS SUBSYSTEM" Subject: Re: [PATCH] static_call: use CFI-compliant return0 stubs Message-ID: <20260311231406.GZ606826@noisy.programming.kicks-ass.net> References: <20260309223156.GA73501@google.com> <20260311225822.1565895-1-cmllamas@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260311225822.1565895-1-cmllamas@google.com> 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Mar 11, 2026 at 10:57:40PM +0000, Carlos Llamas wrote: > Architectures with !HAVE_STATIC_CALL (such as arm64) rely on the generic > static_call implementation via indirect calls. In particular, users of > DEFINE_STATIC_CALL_RET0, default to the generic __static_call_return0 > stub to optimize the unset path. > > However, __static_call_return0 has a fixed signature of "long (*)(void)" > which may not match the expected prototype at callsites. This triggers > CFI failures when CONFIG_CFI is enabled. A trivial linux-perf command > does it: *sigh*... And ARM64 can't really do the inline thing because its immediate range is too small and it all turns into a mess constructing the address in a register and doing an indirect call anyway, right? I'll stare at it in more detail tomorrow.