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

James Clark
2026-02-17T13:59:02Z

On 17/02/2026 12:26 pm, Will Deacon wrote:
> On Tue, Feb 17, 2026 at 12:20:14PM +0000, James Clark wrote:
>> On 16/02/2026 5:32 pm, Will Deacon wrote:
>>> On Mon, Feb 16, 2026 at 02:29:31PM +0000, Marc Zyngier wrote:
>>>> And even then, I'm tempted to simply get rid of any sort of
>>>> guest-only tracing, given that TRBE is not capable of representing
>>>> exceptions that are synthesised by the host, making it the resulting
>>>> traces useless.
>>>
>>> I think that effectively means reverting the series merged from here:
>>>
>>> https://lore.kernel.org/all/20250106142446.628923-1-james.clark@linaro.org/
>>>
>>> but then we still need to clear TRBLIMITR_EL1.E.
>>>
>>
>> Removing that series would actually have the effect of turning guest trace
>> on in nVHE for non-TRBE sinks. The reason for implementing the filtering was
>> to turn guest trace off because a user didn't want to see it.
>
> What I meant was, revert that series and then also ensure that both TRFCR
> and TRBLIMITR are always zero while running in the guest. Is that not
> sufficient?
>
> Will

Yes that would work. Although if someone is currently tracing guests
from the host then obviously that will break that. I'm still not
convinced that tracing guests from the host is broken enough to be
completely useless. But there is a chance nobody is doing it, or waiting
for them to scream might help in understanding their use case.

It doesn't seem like the combination of the TRFCR filtering stuff and
zeroing TRBLIMITR is too messy either though. I suppose you could also
skip the TRFCR switch if you've disabled TRBE if you wanted to save a
register write, but that makes it slightly more complicated.