arm64: KVM: Add workaround for errata 1319367 and 1319537
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 7 repliesIn review
- v15 patches 7 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | arm64: Add ARM64_WORKAROUND_1319367 for all A57 and A72 versionsarch/ arch/ | +12 | 0 replies | |
| 2/5 | arm64: KVM: Reorder system register restoration and stage-2 activationarch/ | +11 | 1 reply | |
| 3/5 | arm64: KVM: Disable EL1 PTW when invalidating S2 TLBsarch/ | +23 | 1 reply | |
| 4/5 | arm64: KVM: Prevent speculative S1 PTW when restoring vcpu contextarch/ arch/ | +64 | 5 replies | |
| 5/5 | arm64: Enable and document ARM errata 1319367 and 1319537Documentation/ arch/ | +14 | 0 replies |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Catalin Marinas | Suzuki K Poulose | James Morse |
|---|---|---|---|
| 1/5 | A-b | R-b | |
| 2/5 | R-b | ||
| 3/5 | R-b | ||
| 4/5 | R-b | ||
| 5/5 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v2 0/5] arm64: KVM: Add workaround for errata 1319367 and 1319537
Similarily to erratum 1165522 that affects Cortex-A76, our good old friends A57 and A72 respectively suffer from errata 1319537 and 1319367, potentially resulting in TLB corruption if the CPU speculates an AT instruction while switching guests.
The fix is slightly more involved since we don't have VHE to help us here, but the idea is the same: When switching a guest in, we must prevent any speculated AT from being able to parse the page tables until S2 is up and running. Only at this stage can we allow AT to take place.
For this, we always restore the guest sysregs first, except for its SCTLR and TCR registers, which must be set with SCTLR.M=1 and TCR.EPD{0,1} = {1, 1}, effectively disabling the PTW and TLB allocation. Once S2 is setup, we restore the guest's SCTLR and TCR. Similar things must be done on TLB invalidation... Fun.
This has been tested on an AMD Seattle box.
* From v1 [1]:
- Reworked patch 4 to close the speculation window on the host
- Fixed comments
- Collected ABs/RBs
[1] https://lore.kernel.org/kvmarm/[email protected]/
Marc Zyngier (5):
arm64: Add ARM64_WORKAROUND_1319367 for all A57 and A72 versions
arm64: KVM: Reorder system register restoration and stage-2 activation
arm64: KVM: Disable EL1 PTW when invalidating S2 TLBs
arm64: KVM: Prevent speculative S1 PTW when restoring vcpu context
arm64: Enable and document ARM errata 1319367 and 1319537
Documentation/arm64/silicon-errata.rst | 4 +++ arch/arm64/Kconfig | 10 ++++++ arch/arm64/include/asm/cpucaps.h | 3 +- arch/arm64/kernel/cpu_errata.c | 13 +++++-- arch/arm64/kvm/hyp/switch.c | 48 ++++++++++++++++++++++---- arch/arm64/kvm/hyp/sysreg-sr.c | 35 +++++++++++++++++-- arch/arm64/kvm/hyp/tlb.c | 23 ++++++++++++ 7 files changed, 124 insertions(+), 12 deletions(-)
Signature · 6 lines
2.20.1 _______________________________________________ kvmarm mailing list [email protected] https://lists.cs.columbia.edu/mailman/listinfo/kvmarm