[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260129123333.0fd202f7@gandalf.local.home>
Date: Thu, 29 Jan 2026 12:33:33 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Vincent Donnefort <vdonnefort@...gle.com>
Cc: mhiramat@...nel.org, mathieu.desnoyers@...icios.com,
linux-trace-kernel@...r.kernel.org, maz@...nel.org, oliver.upton@...ux.dev,
joey.gouly@....com, suzuki.poulose@....com, yuzenghui@...wei.com,
kvmarm@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
jstultz@...gle.com, qperret@...gle.com, will@...nel.org,
aneesh.kumar@...nel.org, kernel-team@...roid.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v10 18/30] tracing: Check for undefined symbols in
simple_ring_buffer
On Mon, 26 Jan 2026 10:44:07 +0000
Vincent Donnefort <vdonnefort@...gle.com> wrote:
> The simple_ring_buffer implementation must remain simple enough to be
> used by the pKVM hypervisor. Prevent the object build if unresolved
> symbols are found.
>
> Signed-off-by: Vincent Donnefort <vdonnefort@...gle.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@...dmis.org>
-- Steve
>
> diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
> index 9e86c43bf320..9f675d5d27c7 100644
> --- a/kernel/trace/Makefile
> +++ b/kernel/trace/Makefile
> @@ -131,4 +131,20 @@ obj-$(CONFIG_TRACE_REMOTE) += trace_remote.o
> obj-$(CONFIG_SIMPLE_RING_BUFFER) += simple_ring_buffer.o
> obj-$(CONFIG_TRACE_REMOTE_TEST) += remote_test.o
>
> +#
> +# simple_ring_buffer is used by the pKVM hypervisor which does not have access
> +# to all kernel symbols. Fail the build if forbidden symbols are found.
> +#
> +UNDEFINED_ALLOWLIST := memset alt_cb_patch_nops __x86 __ubsan __asan __kasan __gcov __aeabi_unwind
> +UNDEFINED_ALLOWLIST += __stack_chk_fail stackleak_track_stack __ref_stack __sanitizer
> +UNDEFINED_ALLOWLIST := $(addprefix -e , $(UNDEFINED_ALLOWLIST))
> +
> +quiet_cmd_check_undefined = NM $<
> + cmd_check_undefined = test -z "`$(NM) -u $< | grep -v $(UNDEFINED_ALLOWLIST)`"
> +
> +$(obj)/%.o.checked: $(obj)/%.o FORCE
> + $(call if_changed,check_undefined)
> +
> +always-$(CONFIG_SIMPLE_RING_BUFFER) += simple_ring_buffer.o.checked
> +
> libftrace-y := ftrace.o
Powered by blists - more mailing lists