[PATCH 02/32] KVM: arm64: gic-v3: Switch vGIC-v3 to use generated ICH_VMCR_EL2

Sascha Bischoff Sascha.Bischoff at arm.com
Mon Dec 15 06:15:03 PST 2025


On Mon, 2025-12-15 at 11:52 +0000, Marc Zyngier wrote:
> On Fri, 12 Dec 2025 15:22:35 +0000,
> Sascha Bischoff <Sascha.Bischoff at arm.com> wrote:
> > 
> > From: Sascha Bischoff <Sascha.Bischoff at arm.com>
> > 
> >  	/* EOImode == 0, nothing to be done here */
> > -	if (!(vmcr & ICH_VMCR_EOIM_MASK))
> > +	if (!FIELD_GET(ICH_VMCR_EL2_VEOIM_MASK, vmcr))
> 
> nit: FIELD_GET() doesn't bring anything here. Similar comment applies
> to most 'if (val & MASK)' constructs that get changed here.

I've reverted all bare instances of `val & MASK` (without shifts) to
not use FIELD_GET(). Anything with an additional shift I've left as a
FIELD_GET().
 
> >  static void __vgic_v3_read_igrpen0(struct kvm_vcpu *vcpu, u32
> > vmcr, int rt)
> >  {
> > -	vcpu_set_reg(vcpu, rt, !!(vmcr & ICH_VMCR_ENG0_MASK));
> > +	vcpu_set_reg(vcpu, rt,
> > !!FIELD_GET(ICH_VMCR_EL2_VENG0_MASK, vmcr));
> 
> Here, !! is actually really superfluous and makes it harder to
> understand what is being done. Similar thing for IRGPEN1.

Dropped those !! as part of this change.

> Apart from these two points, this looks OK to me.
> 
> Thanks,
> 
> 	M.

Thanks,
Sascha



More information about the linux-arm-kernel mailing list