From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=90.155.50.34 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796219723; b=XVLWI/BMs4KF5xmNWu+SV+O7du3H6vUHY/W+X4+bHZrjq1u4jkFRGe1QL5htFxJbMuGP Ab+KWUN29Go2df8F7QHHPERQQ+J4++nPDQJ40lKotn07T4HlarbCRJBw+xFWCtpZM0bIw j7bTdEHqqvrgqnnlpWJb/SqprGuU3aQRI00fyaBaefIIwEezXYiIy1f7okCBz+gp4HTyS /fu+lNxKuydcCKwlmvlbLqxJA7MAnxeQAC1y+JTnerJr3ENUHDI3AvzjizDiZs3NFnIqu Pxuf5A+0/Iuxl2QpQcggNUjvwdUXXcQBf5yXySf05Kihv3j1egX/5I+Wi2g6suJNpFw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796219723; h=DMARC-Filter:DKIM-Signature:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=D/8pkoOwCDsRx1rMQiVkKBPHQ7nmWFDXof2gw5rd9M4=; b=VoNogKPnP2NKwDG7RUcCe5BC5vM5IZhErKiuby+iSX1S9XrVfFiRYSufgfvse+bJpOzC eXORS4Q6D/2EldVDW5vow7O+FaTRcYb1Vx8cUBxJzFK7gcb+TCp5Z7gdJgiA3HA9+ZaOp OPtqpkuRGS2jCHLgxYWkM8GQmgUXt6T8EfOFxMet3gl7+trCufrfY5G12XYZwhZS7M/qK 9nt26Iyc+FerGNl1j4zuIR2FwEzhQB6Yzv9Gx2h/TTZXgKvFR4jsq+/z3Vs/O2Mk6VnG9 DPyFTnMajZEBolwA4jSTU5Ia8x1F9cNZUj8TRWJzDRPcpmXfyNouOef3O3Z1URSCNgw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=bv3rnLNc; arc=none smtp.remote-ip=90.155.50.34 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2F24606A322; Wed, 2 Dec 2026 13:55:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A2F24606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=bv3rnLNc 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=D/8pkoOwCDsRx1rMQiVkKBPHQ7nmWFDXof2gw5rd9M4=; b=bv3rnLNc4+rdr9XdBJrPXuZWZB PYOa2wsVBonwirnCaGfTETqkaVaMlOi4DYLVYrCbu7iw2Zom68aCvVv0i4YM+gztrfFRDlpdCjdx5 by3JTuBgW+k4cIVd8otMjokMnMK6NeGvLZt+8CTIAu+nt5keal0mvci3t2Nio4TTIYnrr00Lkh0zs dBIXu4N8eU2x+FXwC3WngwhDq+dUpLrZeR5j/gN223LtV7nJU/ONmen197/JXfsmgosW5R9f6+p8j O3rKpaWLV2OqqYMvoQXXt3ZBCQ4vrnBegK0XGJvQdDk52h/2z8zNpniPqZIpGCV8Bv1yNGyKJmqoI 5IoV/eiA==; 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.100.1 #2 (Red Hat Linux)) id 1xYknh-0000000GRtr-17EA; Wed, 02 Dec 2026 13:55:13 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id B3EF6300428; Wed, 02 Dec 2026 14:55:12 +0100 (CET) Date: Wed, 2 Dec 2026 14:55:12 +0100 From: Peter Zijlstra To: Steven Rostedt Cc: Song Liu , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, live-patching@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, bpf@vger.kernel.org, mhiramat@kernel.org, mark.rutland@arm.com, tglx@kernel.org, frederic@kernel.org, paulmck@kernel.org, catalin.marinas@arm.com, will@kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, ojeda@kernel.org, kernel-team@meta.com Subject: Re: [PATCH v3 01/22] x86/paravirt: Mark native pv_ops helpers notrace Message-ID: <20261202135512.GB677025@noisy.programming.kicks-ass.net> References: <20261201042201.3199928-1-song@kernel.org> <20261201042201.3199928-2-song@kernel.org> <20261201074353.GB2883950@noisy.programming.kicks-ass.net> <20261201093642.57ab2300@gandalf.local.home> X-Mailing-List: live-patching@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201093642.57ab2300@gandalf.local.home> On Tue, Dec 01, 2026 at 09:36:42AM -0500, Steven Rostedt wrote: > On Tue, 1 Dec 2026 08:43:53 +0100 > Peter Zijlstra wrote: > > > On Mon, Nov 30, 2026 at 08:21:40PM -0800, Song Liu wrote: > > > The native implementations of several pv_ops are static inline functions > > > in headers. pv_ops stores their address, so with CONFIG_PARAVIRT_XXL the > > > compiler emits an out-of-line copy of each one, and pv_ops calls go to > > > that copy. Today these copies are not traced only because the inline > > > macro implies notrace. > > > > > > Some callers of these helpers must not be traced: > > > restore_processor_state() is notrace and runs during resume, > > > __switch_to() is __notrace_funcgraph, and arch/x86/kernel/cpu/common.c > > > and arch/x86/kernel/tsc.c, which call several of them, are built > > > without -pg. > > > > > > Mark these helpers notrace explicitly, like native_write_msr() and > > > native_write_msr_safe() already are, so they stay untraced if inline no > > > longer implies notrace. No functional change. > > > > I must say.. I hate this with a passion. This is unmaintainable garbage. > > Can you elaborate more? What exactly do you hate? It's not much different > than the noinstr code. That is, basically everything that should be noinstr > should also be notrace. notrace may have a little bigger scope than noinstr > but not by much. > > Note, if you really want something inlined, use "__always_inline" which > will never be traced. But "inline" itself is leaving it up to the compiler > to decide. Like noinstr, this means if you really do not want something > traced, you need to use __always_inline or explicitly state notrace. noinstr is validated by objtool. Nothing tells me if notrace is correct or not. This patch adds a gazillion non-obvious notrace annotations that *will* get lost/broken/etc. as code changes. There is no correctness guarantee anywhere near here.