From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D45A32D8391 for ; Wed, 15 Apr 2026 09:04:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776243846; cv=none; b=vBjD6UYxEVEA4iaIAv57qw7po8mmKkQ9povgZglFZo5DVq20yIzk8GU00p7JzI8kKTQX9fVyYb3nDWrFSFLHoHG21ViTu3d1n54IFbV7pW6fir7+I61Q/KyTAW9lK/oaFbzNZzTZhaprPwzdj5bbq8iyYnA9u6TMEs4kSKum47U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776243846; c=relaxed/simple; bh=/Y4SzGThfKDUfTJAFeBavWSdUJP+f9Rvl8JWBoUd0+k=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=IFCW8DgOELt6D+xjkvR6qt1lK4zk7DdkESwX5KfUdeeJD1CY78lNZAoNp4JNFzHbDWLFAtBntpe7Fz+f4zlLaoJYBsyse1rDydmZ9tsmqkf7nmAUjPV5VM0LHZ6fpkAk5rUR8yrBVTjvei9QZ60TrM0bwlTGUbbnhO1CT+43XPk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 00C9F160410; Wed, 15 Apr 2026 09:04:02 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf10.hostedemail.com (Postfix) with ESMTPA id 7DC3C3D; Wed, 15 Apr 2026 09:04:00 +0000 (UTC) Date: Wed, 15 Apr 2026 05:03:54 -0400 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Mathieu Desnoyers , Marc Zyngier , Paolo Bonzini , Cao Ruichuang , "Masami Hiramatsu (Google)" , Vincent Donnefort Subject: [GIT PULL] ring-buffer: Updates for v7.1 Message-ID: <20260415050354.76b8ae73@robin> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) 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-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7DC3C3D X-Rspamd-Server: rspamout06 X-Stat-Signature: t37uswmxgxk83m9sq68jc3q7ztgn78iq X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX1/p0ItvJN2iJ/pbZ4hP3KsqMiMhRaA8tcA= X-HE-Tag: 1776243840-959330 X-HE-Meta: U2FsdGVkX1/B1uaHhicJUf6IVrh0nevvPVdbnO650SxxxOV9+z0JZHa3AxEDfjqMRtej5C6mG5i5zzLTbTMlXs6Pewbmzv3MngzQLHmqQ2RssbPcdr2bdnTedLdd0ppjNBw0olpifMWf2UbDxpw4AqAoIIEGtzs1gl4yjt3qlh9YefV/bRbxn8gPoaZq7LUMNEllgsYap+YiCSulIFHzhC5X1SXhBfkr9skv4S2ZRv/A4nmjiKzqwU9PPni50DrtchdGh1UoyXq8ZEscAu0LXpgys4q4QEPfHonM+ys5ZvRjuhH87JnFSh+pb1jL0c8MxTgcRA2gIGT3fqZvkaUxRTIovQwvbHgz Linus, ring-buffer updates for 7.1: - Add remote buffers for pKVM pKVM has a hypervisor component that is used to protect the guest from the host kernel. This hypervisor is a black box to the kernel as the kernel is to user space. The remote buffers are used to have a memory mapping between the hypervisor and the kernel where kernel may send commands to enable tracing within the hypervisor. Then the kernel will read this memory mapping just like user space can read the memory mapped ring buffer of the kernel tracing system. Since the hypervisor only has a single context, it doesn't need to worry about races between normal context, interrupt context and NMIs like the kernel does. The ring buffer it uses doesn't need to be as complex. The remote buffers are a simple version of the ring buffer that works in a single context. They are still per-CPU and use sub buffers. The data layout is the same as the kernel's ring buffer to share the same parsing. Currently, only ARM64 implements pKVM, but there's work to implement it also in x86. The remote buffer code is separated out from the ARM implementation so that it can be used in the future by x86. The ARM64 updates for pKVM is in the ARM/KVM tree and it merged in the remote buffers of this tree. - Merge commit f35dbac69421 ("ring-buffer: Fix to update per-subbuf entries of persistent ring buffer")` A fix was merged upstream that some new changes depended on. The upstream commit was merged into the ring buffer branch to fulfil the dependency. - Make the backup instance non reusable The backup instance is a copy of the persistent ring buffer so that the persistent ring buffer could start recording again without using the data from the previous boot. The backup isn't for normal tracing. It is made read-only, and after it is consumed, it is automatically removed. - Have backup copy persistent instance before it starts recording To allow the persistent ring buffer to start recording from the kernel command line commands, move the copy of the backup instance to before the the command line options start recording. - Report header_page overwrite field as "char" and not "int' The rust parser of the header_page file was triggering a warning when it defined the overwrite variable as "int" but it was only a single byte in size. - Fix memory barriers for the trace_buffer CPU mask When a CPU comes online, the bit is set to allow readers to know that the CPU buffer is allocated. The bit is set after the allocation is done, and a smp_wmb() is performed after the allocation and before the setting of the bit. But instead of adding a smp_rmb() to all readers, since once a buffer is created for a CPU it is not deleted if that CPU goes offline, so this allocation is almost always done at boot up before any readers exist. If for the unlikely case where a CPU comes online for the first time after the system boot has finished, send an IPI to all CPUs to force the smp_rmb() for each CPU. - Show clock function being used in debugging ring buffer data When the ring buffer checks are enabled and the ring buffer detects an inconsistency in the times of the invents, print out the clock being used when the error occurred. There was a very hard to hit bug that would happen every so often and it ended up being only triggered when the jiffies clock was being used. If the bug showed the clock being used, it would have been much easier to find the problem (which was an internal function was being traced which caused the clock accounting to go off). Please pull the latest trace-ringbuffer-v7.1 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-ringbuffer-v7.1 Tag SHA1: 908796a5b4d184750601b6cb227604427fa8fb80 Head SHA1: 6170922f137231b98fc568571befef63e1edff3f Cao Ruichuang (1): ring-buffer: Report header_page overwrite as char Masami Hiramatsu (Google) (3): tracing: Make the backup instance non-reusable tracing: Remove the backup instance automatically after read tracing/Documentation: Add a section about backup instance Steven Rostedt (3): Merge commit 'f35dbac6942171dc4ce9398d1d216a59224590a9' into trace/ring-buffer/core ring-buffer: Show what clock function is used on timestamp errors tracing: Allow backup to save persistent ring buffer before it starts Vincent Donnefort (20): ring-buffer: Add page statistics to the meta-page ring-buffer: Store bpage pointers into subbuf_ids ring-buffer: Introduce ring-buffer remotes ring-buffer: Add non-consuming read for ring-buffer remotes tracing: Introduce trace remotes tracing: Add reset to trace remotes tracing: Add non-consuming read to trace remotes tracing: Add init callback to trace remotes tracing: Add events to trace remotes tracing: Add events/ root files to trace remotes tracing: Add helpers to create trace remote events ring-buffer: Export buffer_data_page and macros tracing: Introduce simple_ring_buffer tracing: Add a trace remote module for testing tracing: selftests: Add trace remote tests Documentation: tracing: Add tracing remotes tracing: load/unload page callbacks for simple_ring_buffer tracing: Check for undefined symbols in simple_ring_buffer ring-buffer: Enforce read ordering of trace_buffer cpumask and buffers ring-buffer: Prevent off-by-one array access in ring_buffer_desc_page() ---- Documentation/trace/debugging.rst | 19 + Documentation/trace/index.rst | 11 + Documentation/trace/remotes.rst | 66 + fs/tracefs/inode.c | 1 + include/linux/ring_buffer.h | 58 + include/linux/ring_buffer_types.h | 41 + include/linux/simple_ring_buffer.h | 65 + include/linux/trace_remote.h | 48 + include/linux/trace_remote_event.h | 33 + include/trace/define_remote_events.h | 73 ++ include/uapi/linux/trace_mmap.h | 8 +- kernel/trace/Kconfig | 14 + kernel/trace/Makefile | 20 + kernel/trace/remote_test.c | 261 ++++ kernel/trace/remote_test_events.h | 10 + kernel/trace/ring_buffer.c | 387 +++++- kernel/trace/simple_ring_buffer.c | 517 ++++++++ kernel/trace/trace.c | 186 ++- kernel/trace/trace.h | 25 +- kernel/trace/trace_boot.c | 5 +- kernel/trace/trace_events.c | 76 +- kernel/trace/trace_remote.c | 1368 ++++++++++++++++++++ .../selftests/ftrace/test.d/remotes/buffer_size.tc | 25 + .../selftests/ftrace/test.d/remotes/functions | 88 ++ .../selftests/ftrace/test.d/remotes/reset.tc | 90 ++ .../selftests/ftrace/test.d/remotes/trace.tc | 127 ++ .../selftests/ftrace/test.d/remotes/trace_pipe.tc | 127 ++ .../selftests/ftrace/test.d/remotes/unloading.tc | 41 + 28 files changed, 3654 insertions(+), 136 deletions(-) create mode 100644 Documentation/trace/remotes.rst create mode 100644 include/linux/ring_buffer_types.h create mode 100644 include/linux/simple_ring_buffer.h create mode 100644 include/linux/trace_remote.h create mode 100644 include/linux/trace_remote_event.h create mode 100644 include/trace/define_remote_events.h create mode 100644 kernel/trace/remote_test.c create mode 100644 kernel/trace/remote_test_events.h create mode 100644 kernel/trace/simple_ring_buffer.c create mode 100644 kernel/trace/trace_remote.c create mode 100644 tools/testing/selftests/ftrace/test.d/remotes/buffer_size.tc create mode 100644 tools/testing/selftests/ftrace/test.d/remotes/functions create mode 100644 tools/testing/selftests/ftrace/test.d/remotes/reset.tc create mode 100644 tools/testing/selftests/ftrace/test.d/remotes/trace.tc create mode 100644 tools/testing/selftests/ftrace/test.d/remotes/trace_pipe.tc create mode 100644 tools/testing/selftests/ftrace/test.d/remotes/unloading.tc ---------------------------