Re: [PATCH] KVM: arm64: Disable TRBE Trace Buffer Unit when running in guest context

Marc Zyngier
2026-02-24T11:22:43Z

On Fri, 20 Feb 2026 15:48:20 +0000,
Leo Yan <leo.yan@arm.com> wrote:
>
> On Mon, Feb 16, 2026 at 04:49:02PM +0000, Marc Zyngier wrote:
>
> [...]
>
> > > > But that's *not* working. If you trace EL1 only, even with a VHE host,
> > > > the result is not usable.
> > > >
> > >
> > > Do you mean not working because of the missing exceptions? I did a bit
> > > of testing before and the trace did seem somewhat usable to me. It had
> > > EL1 and EL0 atoms in there.
> >
> > Sure. Now try to look at what that means for NV, where all the
> > EL1->EL2 exceptions are emulated, where all the EL2->EL1 exception
> > returns are emulated.
> >
> > What does it give you? A bag of nonsense.
>
> Sorry for jumping in.
>
> If we enable TRBE in a VM, whether nested or not, why is it necessary to
> capture trace data for the exception transition between the VM and its
> higher level host(s)?

Because that's what the architecture guarantees. If you can't honour
what the architecture guarantees, then you don't have an
implementation.

> Seems to me, regardless of what happens during exception emulation, once
> the VM is switched out, tracing will be stopped, and then re-enabled
> when the VM is switched back. In that case, we should be able to record
> the complete trace data for whatever occurs while the VM is running.

And that's breaking the architecture when the exception return is
emulated.

Really, I'm getting tired of having to argue this.

M.

--
Without deviation from the norm, progress is not possible.