arch/arm64/kvm/sys_regs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Prior to commit 70ed7238297f ("KVM: arm64: Sanitise ID_AA64MMFR3_EL1")
we just exposed the santised view of ID_AA64MMFR3_EL1 to guests, meaning
that they saw both TCRX and S1PIE if present on the host machine. That
commit added VMM control over the contents of the register and exposed
S1POE but removed S1PIE, meaning that the extension is no longer visible
to guests. Reenable support for S1PIE with VMM control.
Fixes: 70ed7238297f ("KVM: arm64: Sanitise ID_AA64MMFR3_EL1")
Signed-off-by: Mark Brown <broonie@kernel.org>
---
arch/arm64/kvm/sys_regs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index dad88e31f9537fe02e28b117d6a740f15572e0ba..d48f89ad6aa7139078e7991ce6c8ebc4a0543551 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -1550,7 +1550,8 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu,
val &= ~ID_AA64MMFR2_EL1_CCIDX_MASK;
break;
case SYS_ID_AA64MMFR3_EL1:
- val &= ID_AA64MMFR3_EL1_TCRX | ID_AA64MMFR3_EL1_S1POE;
+ val &= ID_AA64MMFR3_EL1_TCRX | ID_AA64MMFR3_EL1_S1POE |
+ ID_AA64MMFR3_EL1_S1PIE;
break;
case SYS_ID_MMFR4_EL1:
val &= ~ARM64_FEATURE_MASK(ID_MMFR4_EL1_CCIDX);
@@ -2433,6 +2434,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
ID_AA64MMFR2_EL1_NV |
ID_AA64MMFR2_EL1_CCIDX)),
ID_WRITABLE(ID_AA64MMFR3_EL1, (ID_AA64MMFR3_EL1_TCRX |
+ ID_AA64MMFR3_EL1_S1PIE |
ID_AA64MMFR3_EL1_S1POE)),
ID_SANITISED(ID_AA64MMFR4_EL1),
ID_UNALLOCATED(7,5),
---
base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
change-id: 20241004-kvm-arm64-fix-s1pie-a6d85b4b3274
Best regards,
--
Mark Brown <broonie@kernel.org>
On Sat, 05 Oct 2024 00:19:37 +0100, Mark Brown wrote: > Prior to commit 70ed7238297f ("KVM: arm64: Sanitise ID_AA64MMFR3_EL1") > we just exposed the santised view of ID_AA64MMFR3_EL1 to guests, meaning > that they saw both TCRX and S1PIE if present on the host machine. That > commit added VMM control over the contents of the register and exposed > S1POE but removed S1PIE, meaning that the extension is no longer visible > to guests. Reenable support for S1PIE with VMM control. > > [...] Applied to fixes, thanks! [1/1] KVM: arm64: Expose S1PIE to guests commit: d4a89e5aee23eaebdc45f63cb3d6d5917ff6acf4 Cheers, M. -- Without deviation from the norm, progress is not possible.
Hi, On Sat, Oct 05, 2024 at 12:19:37AM +0100, Mark Brown wrote: > Prior to commit 70ed7238297f ("KVM: arm64: Sanitise ID_AA64MMFR3_EL1") > we just exposed the santised view of ID_AA64MMFR3_EL1 to guests, meaning > that they saw both TCRX and S1PIE if present on the host machine. That > commit added VMM control over the contents of the register and exposed > S1POE but removed S1PIE, meaning that the extension is no longer visible > to guests. Reenable support for S1PIE with VMM control. > > Fixes: 70ed7238297f ("KVM: arm64: Sanitise ID_AA64MMFR3_EL1") > Signed-off-by: Mark Brown <broonie@kernel.org> > --- > arch/arm64/kvm/sys_regs.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > index dad88e31f9537fe02e28b117d6a740f15572e0ba..d48f89ad6aa7139078e7991ce6c8ebc4a0543551 100644 > --- a/arch/arm64/kvm/sys_regs.c > +++ b/arch/arm64/kvm/sys_regs.c > @@ -1550,7 +1550,8 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu, > val &= ~ID_AA64MMFR2_EL1_CCIDX_MASK; > break; > case SYS_ID_AA64MMFR3_EL1: > - val &= ID_AA64MMFR3_EL1_TCRX | ID_AA64MMFR3_EL1_S1POE; > + val &= ID_AA64MMFR3_EL1_TCRX | ID_AA64MMFR3_EL1_S1POE | > + ID_AA64MMFR3_EL1_S1PIE; > break; > case SYS_ID_MMFR4_EL1: > val &= ~ARM64_FEATURE_MASK(ID_MMFR4_EL1_CCIDX); > @@ -2433,6 +2434,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { > ID_AA64MMFR2_EL1_NV | > ID_AA64MMFR2_EL1_CCIDX)), > ID_WRITABLE(ID_AA64MMFR3_EL1, (ID_AA64MMFR3_EL1_TCRX | > + ID_AA64MMFR3_EL1_S1PIE | > ID_AA64MMFR3_EL1_S1POE)), > ID_SANITISED(ID_AA64MMFR4_EL1), > ID_UNALLOCATED(7,5), > > --- Sorry, silly mistake by me. Reviewed-by: Joey Gouly <joey.gouly@arm.com> Thanks, Joey
© 2016 - 2024 Red Hat, Inc.