From nobody Wed Jun 17 05:13:08 2026 Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) (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 9A7312D877B for ; Wed, 22 Apr 2026 19:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776887231; cv=none; b=hNCAz1xSr6MAdNBz/05UiRzKGo+97axNx+J494vofW6G4mgjqIw0VK5StH/Gxi2ndxpeiqXaR3/2v7EkwZqrshaWTp40l/4JrWOLyV1qAbcK6kJQa4FYzRjw8+Un4R+Bx7zthEOhPG70t0xZuVC2pJMCvp+5WekRs7o5tF37DPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776887231; c=relaxed/simple; bh=z2q6kv+kZXHTvNDCAhXRxc3Dxpio3u2WmHfU/vPBQ9k=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=nzz24UgnHdjB74lZXObGKPheiHNX3pQ3xKUhDTBj2kyHH/JbdJW2hO62z9evp6KrlvaN3Kw3E+LtjKtKJ3THbJPju20/wzvO0PO2cjZAtzj2eS6Oo03QzzCEoRKN5lmSTp87FDXqgHbK4PINvaIRe/Wmxa+DAv5fjtHA8SonGXs= 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.13 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 omf02.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C42BBA0128; Wed, 22 Apr 2026 19:47:07 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf02.hostedemail.com (Postfix) with ESMTPA id C9B3880015; Wed, 22 Apr 2026 19:47:05 +0000 (UTC) Date: Wed, 22 Apr 2026 15:47:06 -0400 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Mathieu Desnoyers , Paolo Bonzini , Marc Zyngier , Arnd Bergmann , Vincent Donnefort Subject: [GIT PULL] ring-buffer: Fix for v7.1 Message-ID: <20260422154706.118cf73d@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: C9B3880015 X-Stat-Signature: 3m9b8fgoqq4eac1twip1inuutr6w3u8m X-Rspamd-Server: rspamout03 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX18rYr9a4TgRTwuQ0e6uatjYe8bd49zMj1M= X-HE-Tag: 1776887225-864451 X-HE-Meta: U2FsdGVkX1/ZEPXd27Wdd61MSEPoqdDfuWOkgoYK3JQjHgb3JjztDjiYh53VyjKc93fYJKGFshPcPn/lcqUByCGajHa36SfOg2OrPEvUd4X1kXd8qwlHWMEDC/WyH16x+/siLYzstTZTbjrRcS8anpmUCP836713CWNhdqS+yl/gzoUbAa3LI2it/EtIuU/AC52JU/4r1onlK28QL1UHICNWLv5K5+g1Arp4AxMrSjcdMbohC9xTfabPP5OeU6sj6TyEQMf6JGWdFO77LpSDZoav55ytsFCw5Kk0rLh/KKN2Zo4mqqzCEeGMx1jpEb3W/oOlpItOZawDqrNlPnNx+DkL/FNyrtn7B+Kfuv0Dh3SkwkPrrNlu75hqgrIZWBVNC2FPdETbcAReV1B/cYlxmrQwYAjc6srcsA7+PmsOGtkhRCuKTlz3COdu8TteH3AH78+fxa2WtuY7czLU3uzS0ELcszacbeKS9mj0nbRefxB/QPANr7bQ9yFgBdBDonVv37GRwPq7i4m2v0w6u1mXNMk0GEXBY6kFHnuld+KmxYbJhYqHjJPOEpqsZ59ENb2fjACPJ2UNSVtpyXlpMq/5/g== Content-Type: text/plain; charset="utf-8" Linus, ring-buffer fix for v7.1 - Make undefsyms_base.c into a real file The file undefsyms_base.c is used to catch any symbols used by a remote ring buffer that is made for use of a pKVM hypervisor. As it doesn't share the same text as the rest of the kernel, referencing any symbols within the kernel will make it fail to be built for the standalone hypervisor. A file was created by the Makefile that checked for any symbols that could cause issues. There's no reason to have this file created by the Makefile, just create it as a normal file instead. Please pull the latest trace-ring-buffer-v7.1-2 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-ring-buffer-v7.1-2 Tag SHA1: 9a447b7a6cfc48217db5be369fa2f0dc8e4eb273 Head SHA1: 5335e318ad3cf12d905de27e3be4e7fd7b1c6746 Paolo Bonzini (1): tracing: Make undefsyms_base.c a first-class citizen ---- kernel/trace/.gitignore | 1 - kernel/trace/Makefile | 35 ++++------------------------------- kernel/trace/undefsyms_base.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 kernel/trace/.gitignore create mode 100644 kernel/trace/undefsyms_base.c --------------------------- commit 5335e318ad3cf12d905de27e3be4e7fd7b1c6746 Author: Paolo Bonzini Date: Tue Apr 21 11:04:55 2026 +0100 tracing: Make undefsyms_base.c a first-class citizen =20 Linus points out that dumping undefsyms_base.c form the Makefile is rather ugly, and that a much better course of action would be to have this file as a first-class citizen in the git tree. =20 This allows some extra cleanup in the Makefile, and the removal of the .gitignore file in kernel/trace. =20 Cc: Marc Zyngier Cc: Arnd Bergmann Link: https://lore.kernel.org/r/CAHk-=3DwieqGd_XKpu8UxDoyADZx8TDe8CF3Rm= kUXt5N_9t5Pf_w@mail.gmail.com Link: https://lore.kernel.org/all/20260421095446.2951646-1-maz@kernel.o= rg/ Link: https://patch.msgid.link/20260421100455.324333-1-pbonzini@redhat.= com Reported-by: Linus Torvalds Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Paolo Bonzini Signed-off-by: Steven Rostedt diff --git a/kernel/trace/.gitignore b/kernel/trace/.gitignore deleted file mode 100644 index 6adbb09d6deb..000000000000 --- a/kernel/trace/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/undefsyms_base.c diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile index 4d4229e5eec4..1decdce8cbef 100644 --- a/kernel/trace/Makefile +++ b/kernel/trace/Makefile @@ -133,41 +133,14 @@ obj-$(CONFIG_TRACE_REMOTE) +=3D trace_remote.o obj-$(CONFIG_SIMPLE_RING_BUFFER) +=3D simple_ring_buffer.o obj-$(CONFIG_TRACE_REMOTE_TEST) +=3D remote_test.o =20 -# # simple_ring_buffer is used by the pKVM hypervisor which does not have ac= cess # to all kernel symbols. Fail the build if forbidden symbols are found. -# -# undefsyms_base generates a set of compiler and tooling-generated symbols= that can -# safely be ignored for simple_ring_buffer. -# -filechk_undefsyms_base =3D \ - echo '$(pound)include '; \ - echo '$(pound)include '; \ - echo '$(pound)include '; \ - echo 'static char page[PAGE_SIZE] __aligned(PAGE_SIZE);'; \ - echo 'void undefsyms_base(void *p, int n);'; \ - echo 'void undefsyms_base(void *p, int n) {'; \ - echo ' char buffer[256] =3D { 0 };'; \ - echo ' u32 u =3D 0;'; \ - echo ' memset((char * volatile)page, 8, PAGE_SIZE);'; \ - echo ' memset((char * volatile)buffer, 8, sizeof(buffer));'; \ - echo ' memcpy((void * volatile)p, buffer, sizeof(buffer));'; \ - echo ' cmpxchg((u32 * volatile)&u, 0, 8);'; \ - echo ' WARN_ON(n =3D=3D 0xdeadbeef);'; \ - echo '}' - -$(obj)/undefsyms_base.c: FORCE - $(call filechk,undefsyms_base) - -clean-files +=3D undefsyms_base.c - -$(obj)/undefsyms_base.o: $(obj)/undefsyms_base.c =20 +# Basic compiler and tooling-generated symbols that can safely be left +# undefined. Ensure KASAN is enabled to avoid logic that may disable +# FORTIFY_SOURCE when KASAN is not enabled. undefsyms_base.o does not +# automatically get KASAN flags because it is not linked into vmlinux. targets +=3D undefsyms_base.o - -# Ensure KASAN is enabled to avoid logic that may disable FORTIFY_SOURCE w= hen -# KASAN is not enabled. undefsyms_base.o does not automatically get KASAN = flags -# because it is not linked into vmlinux. KASAN_SANITIZE_undefsyms_base.o :=3D y =20 UNDEFINED_ALLOWLIST =3D __asan __gcov __kasan __kcsan __hwasan __sancov __= sanitizer __tsan __ubsan __x86_indirect_thunk \ diff --git a/kernel/trace/undefsyms_base.c b/kernel/trace/undefsyms_base.c new file mode 100644 index 000000000000..e65baf58e6ff --- /dev/null +++ b/kernel/trace/undefsyms_base.c @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * simple_ring_buffer is used by the pKVM hypervisor which does not have a= ccess + * to all kernel symbols. Whatever is undefined when compiling this file = is + * compiler and tooling-generated symbols that can safely be ignored for + * simple_ring_buffer. + */ + +#include +#include +#include + +void undefsyms_base(void *p, int n); + +static char page[PAGE_SIZE] __aligned(PAGE_SIZE); + +void undefsyms_base(void *p, int n) +{ + char buffer[256] =3D { 0 }; + + u32 u =3D 0; + memset((char * volatile)page, 8, PAGE_SIZE); + memset((char * volatile)buffer, 8, sizeof(buffer)); + memcpy((void * volatile)p, buffer, sizeof(buffer)); + cmpxchg((u32 * volatile)&u, 0, 8); + WARN_ON(n =3D=3D 0xdeadbeef); +}