From: Marc Zyngier <maz@kernel.org>
To: Vincent Donnefort <vdonnefort@google.com>
Cc: rostedt@goodmis.org, mhiramat@kernel.org,
mathieu.desnoyers@efficios.com,
linux-trace-kernel@vger.kernel.org, oliver.upton@linux.dev,
joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com,
kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
jstultz@google.com, qperret@google.com, will@kernel.org,
aneesh.kumar@kernel.org, kernel-team@android.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 26/28] KVM: arm64: Add hyp_enter/hyp_exit events to pKVM hyp
Date: Mon, 01 Dec 2025 16:33:28 +0000 [thread overview]
Message-ID: <86o6oip3fr.wl-maz@kernel.org> (raw)
In-Reply-To: <aS28dyrKgZaOmMNr@google.com>
On Mon, 01 Dec 2025 16:04:07 +0000,
Vincent Donnefort <vdonnefort@google.com> wrote:
>
> On Sun, Nov 30, 2025 at 07:00:52PM +0000, Marc Zyngier wrote:
> > On Fri, 07 Nov 2025 09:38:38 +0000,
> > Vincent Donnefort <vdonnefort@google.com> wrote:
> > >
> > > The hyp_enter and hyp_exit events are logged by the hypervisor any time
> > > it is entered and exited.
> > >
> > > Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
> > >
> > > diff --git a/arch/arm64/include/asm/kvm_hypevents.h b/arch/arm64/include/asm/kvm_hypevents.h
> > > index d6e033c96c52..ce3953bc884a 100644
> > > --- a/arch/arm64/include/asm/kvm_hypevents.h
> > > +++ b/arch/arm64/include/asm/kvm_hypevents.h
> > > @@ -7,4 +7,21 @@
> > > #include <nvhe/trace.h>
> > > #endif
> > >
> > > +HYP_EVENT(hyp_enter,
> > > + HE_PROTO(void),
> > > + HE_STRUCT(
> > > + ),
> > > + HE_ASSIGN(
> > > + ),
> > > + HE_PRINTK()
> > > +);
> > > +
> > > +HYP_EVENT(hyp_exit,
> > > + HE_PROTO(void),
> > > + HE_STRUCT(
> > > + ),
> > > + HE_ASSIGN(
> > > + ),
> > > + HE_PRINTK()
> > > +);
> > > #endif
> > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/arm-smccc.h b/arch/arm64/kvm/hyp/include/nvhe/arm-smccc.h
> > > new file mode 100644
> > > index 000000000000..4b69d33e4f2d
> > > --- /dev/null
> > > +++ b/arch/arm64/kvm/hyp/include/nvhe/arm-smccc.h
> > > @@ -0,0 +1,13 @@
> > > +/* SPDX-License-Identifier: GPL-2.0-only */
> > > +
> > > +#include <asm/kvm_hypevents.h>
> > > +
> > > +#include <linux/arm-smccc.h>
> > > +
> > > +#undef arm_smccc_1_1_smc
> > > +#define arm_smccc_1_1_smc(...) \
> > > + do { \
> > > + trace_hyp_exit(); \
> > > + __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__); \
> > > + trace_hyp_enter(); \
> > > + } while (0)
> >
> > Huh. No, please. Don't override existing kernel constructs behind
> > everybody's back. I know that tracing folks love to play that sort of
> > game, but I really don't want any of that here.
>
> And you haven't seen what I had for arm_smccc_1_2_smc()
I have the feeling that I don't want to see it at all!
> > Just define a wrapper that is KVM-specific, and use that.
> >
> > Then from a semantic perspective, an SMC call, an ERET back to EL1
> > host, and an ERET back to EL1 guest are all very different events that
> > you lump under the "exit" category. That's not right. Same thing for
> > "enter".
>
> The idea of those events is just to know when we enter and exit the hypervisor,
> purely from a timing point of view. In ACK, we already have other separated
> events that can give the "cause" for entering or exiting the hypervisor. I
> haven't added them to that series because I thought it was big enough.
>
> So happy to add now or do a follow-up, once we're done with that one?
Fixed trace points are ABI AFAIC, so I'd rather we make them useful
from the very start. What you have here is not very interesting,
because it makes all entry and exit points equal -- they very much
aren't.
So get rid of these and implement the real thing.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2025-12-01 16:33 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 9:38 [PATCH v8 00/28] Tracefs support for pKVM Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 01/28] ring-buffer: Add page statistics to the meta-page Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 02/28] ring-buffer: Store bpage pointers into subbuf_ids Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 03/28] ring-buffer: Introduce ring-buffer remotes Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 04/28] ring-buffer: Add non-consuming read for " Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 05/28] tracing: Introduce trace remotes Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 06/28] tracing: Add reset to " Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 07/28] tracing: Add non-consuming read " Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 08/28] tracing: Add init callback " Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 09/28] tracing: Add events " Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 10/28] tracing: Add events/ root files " Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 11/28] tracing: Add helpers to create trace remote events Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 12/28] ring-buffer: Export buffer_data_page and macros Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 13/28] tracing: Introduce simple_ring_buffer Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 14/28] tracing: Add a trace remote module for testing Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 15/28] tracing: selftests: Add trace remote tests Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 16/28] Documentation: tracing: Add tracing remotes Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 17/28] tracing: load/unload page callbacks for simple_ring_buffer Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 18/28] tracing: Check for undefined symbols in simple_ring_buffer Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 19/28] KVM: arm64: Support unaligned fixmap in the pKVM hyp Vincent Donnefort
2025-11-19 15:38 ` Marc Zyngier
2025-11-20 9:55 ` Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 20/28] KVM: arm64: Add clock support for " Vincent Donnefort
2025-11-19 15:44 ` Marc Zyngier
2025-11-20 11:36 ` Vincent Donnefort
2025-11-30 18:15 ` Marc Zyngier
2025-11-07 9:38 ` [PATCH v8 21/28] KVM: arm64: Add tracing capability " Vincent Donnefort
2025-11-19 17:06 ` Marc Zyngier
2025-11-20 12:01 ` Vincent Donnefort
2025-11-30 18:23 ` Marc Zyngier
2025-11-25 11:22 ` Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 22/28] KVM: arm64: Add trace remote " Vincent Donnefort
2025-11-19 17:31 ` Marc Zyngier
2025-11-20 12:27 ` Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 23/28] KVM: arm64: Sync boot clock with " Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 24/28] KVM: arm64: Add trace reset to " Vincent Donnefort
2025-11-30 18:33 ` Marc Zyngier
2025-11-07 9:38 ` [PATCH v8 25/28] KVM: arm64: Add event support to the pKVM hyp and trace remote Vincent Donnefort
2025-11-30 18:54 ` Marc Zyngier
2025-11-07 9:38 ` [PATCH v8 26/28] KVM: arm64: Add hyp_enter/hyp_exit events to pKVM hyp Vincent Donnefort
2025-11-30 19:00 ` Marc Zyngier
2025-12-01 16:04 ` Vincent Donnefort
2025-12-01 16:33 ` Marc Zyngier [this message]
2025-11-07 9:38 ` [PATCH v8 27/28] KVM: arm64: Add selftest event support " Vincent Donnefort
2025-11-07 9:38 ` [PATCH v8 28/28] tracing: selftests: Add pKVM trace remote tests Vincent Donnefort
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86o6oip3fr.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=aneesh.kumar@kernel.org \
--cc=joey.gouly@arm.com \
--cc=jstultz@google.com \
--cc=kernel-team@android.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=qperret@google.com \
--cc=rostedt@goodmis.org \
--cc=suzuki.poulose@arm.com \
--cc=vdonnefort@google.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).