summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Bischoff <Sascha.Bischoff@arm.com>2026-03-19 15:49:57 +0000
committerMarc Zyngier <maz@kernel.org>2026-03-19 16:25:55 +0000
commit90f0155f8754e75fa29fce02e40d690fb733852d (patch)
tree931acfaad97586930991f235ac08841f7fb4a2eb
parentf338e77383789c0cae23ca3d48adcc5e9e137e3c (diff)
downloadlinux-90f0155f8754e75fa29fce02e40d690fb733852d.tar.gz
linux-90f0155f8754e75fa29fce02e40d690fb733852d.zip
KVM: arm64: vgic-v3: Drop userspace write sanitization for ID_AA64PFR0.GIC on GICv5
Drop a check that blocked userspace writes to ID_AA64PFR0_EL1 for writes that set the GIC field to 0 (NI) on GICv5 hosts. There is no such check for GICv3 native systems, and having inconsistent behaviour both complicates the logic and risks breaking existing userspace software that expects to be able to write the register. This means that userspace is now able to create a GICv3 guest on GICv5 hosts, and disable the guest from seeing that it has a GICv3. This matches the already existing behaviour for GICv3-native VMs, allowing for fewer issues when migrating from GICv3 hosts to compatible GICv5 hosts. Additionally, this allows the trap and FGU infrastucture to kick in as these rely on the state of the feature bits that have been set. Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com> Link: https://patch.msgid.link/20260319154937.3619520-2-sascha.bischoff@arm.com Signed-off-by: Marc Zyngier <maz@kernel.org>
-rw-r--r--arch/arm64/kvm/sys_regs.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index 1b4cacb6e918..4b9f4e5d946b 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -2177,14 +2177,6 @@ static int set_id_aa64pfr0_el1(struct kvm_vcpu *vcpu,
(vcpu_has_nv(vcpu) && !FIELD_GET(ID_AA64PFR0_EL1_EL2, user_val)))
return -EINVAL;
- /*
- * If we are running on a GICv5 host and support FEAT_GCIE_LEGACY, then
- * we support GICv3. Fail attempts to do anything but set that to IMP.
- */
- if (vgic_is_v3_compat(vcpu->kvm) &&
- FIELD_GET(ID_AA64PFR0_EL1_GIC_MASK, user_val) != ID_AA64PFR0_EL1_GIC_IMP)
- return -EINVAL;
-
return set_id_reg(vcpu, rd, user_val);
}