[PATCH 2/3] KVM: arm64: vgic: Allow userspace to set IIDR revision 1

David Woodhouse dwmw2 at infradead.org
Wed Apr 8 03:32:06 PDT 2026


On Wed, 2026-04-08 at 08:54 +0100, Marc Zyngier wrote:
> 
> > @@ -93,6 +95,9 @@ static int vgic_mmio_uaccess_write_v2_misc(struct
> > kvm_vcpu *vcpu,
> >   		 */
> >   		reg = FIELD_GET(GICD_IIDR_REVISION_MASK, val);
> >   		switch (reg) {
> > +		case KVM_VGIC_IMP_REV_1:
> > +			dist->implementation_rev = reg;
> > +			return 0;
> >   		case KVM_VGIC_IMP_REV_2:
> >   		case KVM_VGIC_IMP_REV_3:
> >   			vcpu->kvm-
> > >arch.vgic.v2_groups_user_writable = true;
> 
> nit: move the v1 handling down with a fallthrough in v2/v3 so that we
> don't duplicate the basic handling:

I think I actually want to rip out the v2_groups_user_writable flag
completely.

It was specifically added in order to allow the actual behaviour to be
inconsistent with the value in the IIDR.

But it doesn't actually stop the *guest* wrong writing; only userspace.

I'll rip it out in a fourth patch when I resend the series (having
addressed your other comments).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5069 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260408/467c92df/attachment.p7s>


More information about the linux-arm-kernel mailing list