Re: [PATCH v4 07/48] KVM: arm64: gic-v5: Extract host IRS caps from IRS config frame

Sascha Bischoff <[email protected]>
Newsgroups dev.linux.lists.kvmarm,dev.linux.lists.sashiko-reviews,org.kernel.vger.kvm
Message-ID <[email protected]>
On Fri, 2026-07-24 at 11:19 +0000, [email protected] wrote:
> > +	idr = irs_readl_relaxed(GICV5_IRS_IDR3);
> > +
> > +	irs_caps.max_vms =
> > BIT(FIELD_GET(GICV5_IRS_IDR3_VM_ID_BITS, idr));
> 
> [Severity: Medium]
> Should this have a + 1 applied to the field value, similar to how
> VPE_ID_BITS
> is handled below? 
> 
> GIC architecture ID bit fields canonically store the number of bits
> minus 1.
> If VM_ID_BITS follows the same pattern, omitting the + 1 will result
> in KVM
> calculating exactly half of the actual maximum number of VMs
> supported by the
> hardware, leading to premature resource exhaustion.

The field does NOT follow that pattern. Some fields have that, and
others do not. This one does not as adding an offset of +1 would break
things.

Thanks,
Sascha
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.