All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] Fix setting SVE and SME traps in (h)VHE
@ 2023-07-21  9:51 Fuad Tabba
  2023-07-21  9:51 ` [PATCH v2 1/7] KVM: arm64: Factor out code for checking E2H into a macro Fuad Tabba
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Fuad Tabba @ 2023-07-21  9:51 UTC (permalink / raw)
  To: kvmarm
  Cc: maz, oliver.upton, catalin.marinas, james.morse, suzuki.poulose,
	yuzenghui, will, tabba

Hi,

Changes from V1:
- Expanded the cover letter to clarify the reasoning behind being
consistent in writing to the architectural trap register based on
the KVM mode (Marc)
- Factored out the code for checking E2H into a macro (Oliver)
- Factored out the code that selects which register to write to
into a function (Oliver)

The (re)setting and disabling of SVE/SME trap handling (mostly)
done for the hVHE work [*] misses a couple of cases.

This patch series ensures that these traps are disabled on setup
and reset. Moreover, it makes the code consistent in using
CPACR_EL1 or CPTR_EL2, depending on the mode.

CPACR_EL1 aliases to CPTR_EL2 when HCR_EL2.E2H == 1, but by being
consistent we don't need to issue a synchronisation when
alternating between one or the other accessor. Moreover, when
running hVHE under NV, we don't trap unnecessarily on accessing
CPTR_EL2, while CPACR_EL1 can be used directly without any trap.

Based on Linux 6.5-rc2.

Cheers,
/fuad

[*] https://lore.kernel.org/all/20230609162200.2024064-1-maz@kernel.org/

Fuad Tabba (7):
  KVM: arm64: Factor out code for checking E2H into a macro
  KVM: arm64: Use the appropriate feature trap register for SVE at EL2
    setup
  KVM: arm64: Disable SME traps for (h)VHE at setup
  KVM: arm64: Helper to write to appropriate feature trap register based
    on mode
  KVM: arm64: Use the appropriate feature trap register when activating
    traps
  KVM: arm64: Fix resetting SVE trap values on reset for hVHE
  KVM: arm64: Fix resetting SME trap values on reset for (h)VHE

 arch/arm64/include/asm/el2_setup.h   | 44 ++++++++++++++++++----------
 arch/arm64/include/asm/kvm_emulate.h | 21 ++++++++++---
 arch/arm64/kvm/hyp/nvhe/switch.c     |  2 +-
 3 files changed, 47 insertions(+), 20 deletions(-)


base-commit: fdf0eaf11452d72945af31804e2a1048ee1b574c
-- 
2.41.0.487.g6d72f3e995-goog


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-07-22 11:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-21  9:51 [PATCH v2 0/7] Fix setting SVE and SME traps in (h)VHE Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 1/7] KVM: arm64: Factor out code for checking E2H into a macro Fuad Tabba
2023-07-21 21:21   ` Oliver Upton
2023-07-22 11:20     ` Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 2/7] KVM: arm64: Use the appropriate feature trap register for SVE at EL2 setup Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 3/7] KVM: arm64: Disable SME traps for (h)VHE at setup Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 4/7] KVM: arm64: Helper to write to appropriate feature trap register based on mode Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 5/7] KVM: arm64: Use the appropriate feature trap register when activating traps Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 6/7] KVM: arm64: Fix resetting SVE trap values on reset for hVHE Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 7/7] KVM: arm64: Fix resetting SME trap values on reset for (h)VHE Fuad Tabba
2023-07-21 13:41 ` [PATCH v2 0/7] Fix setting SVE and SME traps in (h)VHE Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.