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

David Woodhouse
2026-04-08T10:32:18Z

[-- Attachment #1: Type: text/plain, Size: 985 bytes --]

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).

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]