Skip to contentSkip to conversation

KVM: arm64: Advertise MMFR0 TGRAN for pVMs

PATCH New Vincent Donnefort 1 participant 1 message Sep 15

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 KVM: arm64: Advertise MMFR0 TGRAN for pVMs

protected VM ID register emulation leaves unlisted fields at 0. This creates two issues for TGRAN:

* TGRAN16: 0 means non-implemented. It prevents 16KB protected VMs from booting even when the hardware supports it.

* TGRAN4|TGRAN64: 0 means implemented. This may falsely advertise the feature even when the hardware does not support it.

Advertise all the TGRAN fields in pvmid_aa64mmfr0 so that the hardware support is properly propagated.

Fixes 6c30bfb18d0b ("KVM: arm64: Add handlers for protected VM System Registers")
---
 arch/arm64/kvm/hyp/nvhe/sys_regs.c | 3 +++
 1 file changed, 3 insertions(+)

Changelog:

v2:
- Collect Fuad's tags
- Reword commit message (Fuad)

v1 (lore.kernel.org/all/[email protected])

arch/arm64/kvm/hyp/nvhe/sys_regs.c +3 -0
index 8758c6801776..ec469d96516a 100644
@@ -121,6 +121,9 @@ static const struct pvm_ftr_bits pvmid_aa64mmfr0[] = {
 	MAX_FEAT(ID_AA64MMFR0_EL1, SNSMEM, IMP),
 	MAX_FEAT(ID_AA64MMFR0_EL1, BIGENDEL0, IMP),
 	MAX_FEAT(ID_AA64MMFR0_EL1, EXS, IMP),
+	MAX_FEAT(ID_AA64MMFR0_EL1, TGRAN4, IMP),
+	MAX_FEAT(ID_AA64MMFR0_EL1, TGRAN16, IMP),
+	MAX_FEAT(ID_AA64MMFR0_EL1, TGRAN64, IMP),
 	FEAT_END
 };
 

base-commit: fd73f4a6659897191fa0d40695fe370925dd3780

Signature · 1 line
2.55.0.1032.g73a4cd73de-goog