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

Hi,

Changes from V2:
- Rebased onto Linux 6.5-rc3
- s/__check_e2h/__check_hvhe/g (Oliver)
- Fixed bug in calculating CPACR_EL1 reset value for hVHE in
trapping SVE

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-rc3.

Cheers,
/fuad

Fuad Tabba (7):
  KVM: arm64: Factor out code for checking (h)VHE mode 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: 6eaae198076080886b9e7d57f4ae06fa782f90ef
-- 
2.41.0.487.g6d72f3e995-goog


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

end of thread, other threads:[~2023-07-26 19:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24 12:38 [PATCH v3 0/7] Fix setting SVE and SME traps in (h)VHE Fuad Tabba
2023-07-24 12:38 ` [PATCH v3 1/7] KVM: arm64: Factor out code for checking E2H into a macro Fuad Tabba
2023-07-24 12:49   ` Fuad Tabba
2023-07-24 12:38 ` [PATCH v3 1/7] KVM: arm64: Factor out code for checking (h)VHE mode " Fuad Tabba
2023-07-24 12:38 ` [PATCH v3 2/7] KVM: arm64: Use the appropriate feature trap register for SVE at EL2 setup Fuad Tabba
2023-07-24 12:38 ` [PATCH v3 3/7] KVM: arm64: Disable SME traps for (h)VHE at setup Fuad Tabba
2023-07-24 12:38 ` [PATCH v3 4/7] KVM: arm64: Helper to write to appropriate feature trap register based on mode Fuad Tabba
2023-07-24 12:38 ` [PATCH v3 5/7] KVM: arm64: Use the appropriate feature trap register when activating traps Fuad Tabba
2023-07-24 12:38 ` [PATCH v3 6/7] KVM: arm64: Fix resetting SVE trap values on reset for hVHE Fuad Tabba
2023-07-24 12:38 ` [PATCH v3 7/7] KVM: arm64: Fix resetting SME trap values on reset for (h)VHE Fuad Tabba
2023-07-25 14:00 ` [PATCH v3 0/7] Fix setting SVE and SME traps in (h)VHE Marc Zyngier
2023-07-26 19:54 ` (subset) " Oliver Upton

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.