KVM: arm64: Properly advertise !FEAT_LPA2 for NV
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 5 repliesIn review
- v13 patches 7 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | KVM: arm64: nv: Don't advertise FEAT_LPA2 for guest stage-1arch/ | +11 | 1 reply | |
| 2/4 | arm64: sysreg: Add TCR_EL2 to sysreg infrastructurearch/ arch/ arch/ | +125 | 0 replies | |
| 3/4 | KVM: arm64: Reset TCR_EL2 according to guest's E2H modearch/ | +9 | 1 reply | |
| 4/4 | KVM: arm64: Convert TCR_EL2 to config-driven sanitisationarch/ arch/ arch/ | +118 | 3 replies |
Reviews trailers per patch
3 of 4 patches have a Reviewed-by or Acked-by.
| Patch | Mark Brown | Joey Gouly |
|---|---|---|
| 1/4 | ||
| 2/4 | R-b | |
| 3/4 | R-b | |
| 4/4 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/4] KVM: arm64: Properly advertise !FEAT_LPA2 for NV
Hi,
This v2 fixes a few naming and styling issues, collects Mark's Reviewed-by tag, and adds Marc's TCR_EL2 reset patch [1]. Please see details below.
* Changes from v1 [2]:
- Renamed tcr_el2_vhe_* to vhe_tcr_el2_*, rename tcr_el2_nvhe_* to tcr_el2_* to better align with the TCR_EL2 macros. (Marc)
- Added Marc's TCR_EL2 reset patch (thanks!).
- Put each == comparison on one line. (Marc)
- Added Fixes and Cc: stable tags to patch 1.
- Collected Reviewed-by tag from Mark (thanks!).
Series based on v7.3-rc3.
Below is the same cover from v1:
Previously for NV FEAT_LPA2 is accidentally exposed to the guest at stage-1 if hardware supports it. Stage-2 is correctly sanitised out in ID_AA64MMFR0_EL1 but not stage-1. This is wrong on two fronts:
- There is no FEAT_LPA2 support for NV yet.
- It is non-architectural to advertise different FEAT_LPA2 support in stage-1 and stage-2.
This series first removes FEAT_LPA2 from TGRAN4, TGRAN16 for NV, to present a !FEAT_LPA2 system. Then guest TCR_EL2 sanitisation is added, to make the DS bit RES0 for NV guests. Note that this sanitisation can't cover all cases, as we don't trap VHE L1 accesses to the vCPU's TCR_EL2 via TCR_EL1.
TCR_EL2 sanitisation differs slightly from the AARCHMRS, please see the commits for details.
For testing I booted a 4K 52-bit nVHE L1 and checked:
1. It is using 48-bit VAs in stage-1.
2. Writing 1 to TCR_EL2.DS and reading it back reads 0.
Thanks!
[1]: https://lore.kernel.org/kvmarm/[email protected]/
[2]: https://lore.kernel.org/kvmarm/[email protected]/
Marc Zyngier (1):
KVM: arm64: Reset TCR_EL2 according to guest's E2H mode
Wei-Lin Chang (3):
KVM: arm64: nv: Don't advertise FEAT_LPA2 for guest stage-1
arm64: sysreg: Add TCR_EL2 to sysreg infrastructure
KVM: arm64: Convert TCR_EL2 to config-driven sanitisation
arch/arm64/include/asm/kvm_arm.h | 13 ---- arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/include/asm/sysreg.h | 1 - arch/arm64/kvm/config.c | 113 +++++++++++++++++++++++++++ arch/arm64/kvm/nested.c | 15 ++++ arch/arm64/kvm/sys_regs.c | 10 ++- arch/arm64/tools/sysreg | 125 ++++++++++++++++++++++++++++++ 7 files changed, 263 insertions(+), 16 deletions(-)
Signature · 1 line
2.43.0