Subject: [PATCH v2 0/3] KVM: arm64: Fix SPE and TRBE nVHE world switch

From: Will Deacon <[email-masked]>
Date: Fri, 27 Feb 2026 21:21:32 +0000

Hi folks,

This is version two of the patch that I originally sent here:

  https://lore.kernel.org/r/[email-masked]

Changes since v1 include:

  * Add missing memory barriers and comments for each step
  * Work around known CPU errata in TRBE draining / enabling sequences
  * Fix SPE as well!
  * Minor clean up to BRBE so that it smells the same as SPE and TRBE

As before, I've not been able to test this as-is.

Cheers,

Will

Cc: Marc Zyngier <[email-masked]>
Cc: Oliver Upton <[email-masked]>
Cc: James Clark <[email-masked]>
Cc: Leo Yan <[email-masked]>
Cc: Suzuki K Poulose <[email-masked]>
Cc: Fuad Tabba <[email-masked]>
Cc: Alexandru Elisei <[email-masked]>
Cc: Yabin Cui <[email-masked]>

--->8

Will Deacon (3):
  KVM: arm64: Disable TRBE Trace Buffer Unit when running in guest
    context
  KVM: arm64: Disable SPE Profiling Buffer when running in guest context
  KVM: arm64: Don't pass host_debug_state to BRBE world-switch routines

 arch/arm64/include/asm/kvm_host.h  |   2 +
 arch/arm64/kvm/hyp/nvhe/debug-sr.c | 118 +++++++++++++++++++++++------
 arch/arm64/kvm/hyp/nvhe/switch.c   |   2 +-
 3 files changed, 96 insertions(+), 26 deletions(-)

-- 
2.53.0.473.g4a7958ca14-goog