Fix setting SVE and SME traps in (h)VHE
Status from this message: Applied to kvmarm/fixes, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest7 patches 3 repliesApplied
- v27 patches 3 repliesSuperseded
- v15 patches 7 repliesSuperseded
Changes in v3 from the cover letter
- 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
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | KVM: arm64: Factor out code for checking E2H into a macroarch/ | +10 | 1 reply | |
| 1/7 | KVM: arm64: Factor out code for checking (h)VHE mode into a macroarch/ | +10 | 0 replies | |
| 2/7 | KVM: arm64: Use the appropriate feature trap register for SVE at EL2 setuparch/ | +9 | 0 replies | |
| 3/7 | KVM: arm64: Disable SME traps for (h)VHE at setuparch/ | +10 | 0 replies | |
| 4/7 | KVM: arm64: Helper to write to appropriate feature trap register based on modearch/ | +9 | 0 replies | |
| 5/7 | KVM: arm64: Use the appropriate feature trap register when activating trapsarch/ | +1 | 0 replies | |
| 6/7 | KVM: arm64: Fix resetting SVE trap values on reset for hVHEarch/ | +4 | 0 replies | |
| 7/7 | KVM: arm64: Fix resetting SME trap values on reset for (h)VHEarch/ | +4 | 0 replies |
Reviews trailers per patch
None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Marc Zyngier |
|---|---|
| Series | R-b |
| 1/7 | |
| 1/7 | |
| 2/7 | |
| 3/7 | |
| 4/7 | |
| 5/7 | |
| 6/7 | |
| 7/7 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/7] Fix setting SVE and SME traps in (h)VHE
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
Signature · 1 line
2.41.0.487.g6d72f3e995-goog