From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f42.google.com (mail-dl1-f42.google.com [74.125.82.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48D223264EF for ; Thu, 12 Mar 2026 00:16:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773274569; cv=none; b=L7bAP9OJUFc+mxTDcc7+i5aF8TxJQagGRhT4MwWDf8bW9tgQO2LpusKQR9gCDClNZFEV+QZXZ7U6lGRSyYUmy0NSlLKbfqJtarb0mx5hYqiCQtHNSvwqqYCtuO4Z+4i9YE5LyjghgTOe52orH1DUjPsTJEzJ0SDJTBxwQTcc/dE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773274569; c=relaxed/simple; bh=v4zcyFwLddeczA8kJLb832z7ZBDX94bYAHurxSf86Y0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s0TxKptTfP/DmbF/3MOgrH3fz57pJrJs1zFs6TWC4ecCQdYp3TLUIC2niQ/Gq7fLusWdFV2xKI3BpigqyhhfyUNZJC+GsE+lR/Ss+B23KqBeMVS7IeBH4BDrKsEzVWyTWbhTXPUSxbCKfNMIgfXS1Ih0GEIvb3WNe0Gz1IHVxYs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=pONldkPL; arc=none smtp.client-ip=74.125.82.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pONldkPL" Received: by mail-dl1-f42.google.com with SMTP id a92af1059eb24-1270fc2bdf2so5571c88.0 for ; Wed, 11 Mar 2026 17:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1773274567; x=1773879367; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=bMrrvcXulRZkoBfi9FaZ3WzGUIx2J4qRVHmF1FKtVWA=; b=pONldkPL05aKfO667Ol4iLMqhGZ2Y5pcNSWnzsTkzjNCMGYAmc0PwBTf3i53hHtOBR 1AcqGsddJBzlqM9belDRP/5CILcSl6egJo5MxDwNv/CfqCo/m0mwQjp2ltSh3WIB/490 ie7H7SfFHxq8Exvob4onXXg8frlQPJiCZRNnXuLdtDCvCA/H+rVseLEnURVD+a0VKJBu l03LjRCRkLB2l3DsmXJX5dxl6FLntkgI0BPQitPpsn7NhkNbhUfwf038wiZ509anx0lb oG5oCw0M1uJ/Oh4waNJU5DCvtgBPQC2S7v+XbdP/G0bqy+KCTphXiqadq7hrsa05LBgB R63g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773274567; x=1773879367; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bMrrvcXulRZkoBfi9FaZ3WzGUIx2J4qRVHmF1FKtVWA=; b=JnfioQ+TtAVJ79EEgJAPpg/O+PuolIb6BWoAXJXGa31LvoaaASz2l2jlingXKEFeGK Bxleuwo71wLikaLXIkcXmJ60UrXFqBOvI2b231nxohmM7GaXowFkyl83bN0G52z2TI97 ocB8Wou0H1zzkhJIBUXqBRTb/jzQ0THcy/Q642eIqguJNeCimycEpRnRtBaXTmCpwJbU d41zk6SLLr7ZaoN5EcP/LN0zVycpUepSdVHwIB3fo7CHdBmeprGg+h72nooaugFBDCzc pmiFp94PIyCGjp6K8zwpP9wWylWb60Fs0sG4Z7jEM+qke3V9POQDhyexRU+t47wPyi7R ODGA== X-Forwarded-Encrypted: i=1; AJvYcCUSLNp4z0LMgU5Hcea4s0sev+zfBaHUs210VpKCcVF1kQ8oJckWrXubk+OYDlpE9Mn80FcjQIlpUSX37jo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1F7HgdKYy6ikykpHTxw9FCa6EtRcJheRcZ5Ubbo/sY/1E3Fja EwhOt87+yA2bnT0ayjsKPsu+0+mYDpbVeOxp9Z+HzBXFRJc81lDq1RXiI86y+c96KQ== X-Gm-Gg: ATEYQzxXwYYOYY5BO6TJud6IZFwdnqx0qKhgYcRpyIMJohX5BbMDu3Fr7SzxfFhB7vn ntw+yk1gi13W5nNt4uwzzU1UhQE+cE5aOJ2cVxGYyTa7zt61TCWVoqDWNNY/1zS//juUZT7ptUr Bx6EnwFRy1e1JNoaIL4N+kirk7JC5+oq2S7Ahk9sBYiSPWLz85AEcskSVvpQCtD71hmsvm/XMw1 rHdxQICINAGYgWHn3IDzT9HcJYhHzTICbj97wmTZre+i6qFPLm3fUJSpwBZsJLsrWf1vOhwg7Od R2WlfQg7qFemnNMZHSvSWDzsYjnlwHt6r+3h9+VEVgV0THjoup8xorLOMHCZa9tob5gwdmflm2s qzlglec30tcEe8nZO+lX94uVv8Esx3RNclZziWKco/D/FfX84MI960gYJ1HFFcpIme1Iv96FEz3 p2k21IETBXwfezKr8IB4KXtv0DI/j6EunClcCtlbJgPoT1nG0a5KhX+lMdJpJgeg== X-Received: by 2002:a05:701b:4243:20b0:119:e55a:808a with SMTP id a92af1059eb24-128edc2f354mr29180c88.7.1773274566569; Wed, 11 Mar 2026 17:16:06 -0700 (PDT) Received: from google.com (154.52.125.34.bc.googleusercontent.com. [34.125.52.154]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2be8aa4ecbdsm4377079eec.16.2026.03.11.17.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 17:16:06 -0700 (PDT) Date: Thu, 12 Mar 2026 00:16:01 +0000 From: Carlos Llamas To: Peter Zijlstra 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: References: <20260309223156.GA73501@google.com> <20260311225822.1565895-1-cmllamas@google.com> <20260311231406.GZ606826@noisy.programming.kicks-ass.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260311231406.GZ606826@noisy.programming.kicks-ass.net> On Thu, Mar 12, 2026 at 12:14:06AM +0100, Peter Zijlstra wrote: > 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? > Right, the range for the jump is very limited. I _think_ tracepoints have managed to implement the trampoline work-around: arch/arm64/kernel/ftrace.c So it looks do-able I think but a much complex route. -- Carlos Llamas