Re: [PATCH v2] irqchip/irq-gic-v3-its: Add the checking of ITS version for KVM

From: Marc Zyngier
Date: Mon Jul 19 2021 - 06:39:56 EST

On Mon, 19 Jul 2021 06:39:50 +0100,
Shaokun Zhang <zhangshaokun@xxxxxxxxxxxxx> wrote:
> Hi Marc,
> A gentle ping.
> Thanks,
> Shaokun
> On 2021/6/22 14:12, Shaokun Zhang wrote:
> > From: wangwudi <wangwudi@xxxxxxxxxxxxx>
> >
> > The version of GIC used by KVM is provided by gic_v3_kvm_info. The
> > KVM that supports GICv4 or GICv4.1 only checks GIC version. Actually,
> > the GIC and ITS need to work together. If we have multiple ITSs and
> > GIC supports v4, there are two cases:
> > 1. None of the ITS supports GICv4, gic_v3_kvm_info.has_v4is false,
> > so the KVM will use GICv3;
> > 2. At least one ITS supports GICv4, gic_v3_kvm_info has_v4 is true,
> > so the KVM can use GICv4;
> >
> > It is the same as GICv4.1. For the first case that the KVM can use
> > GICv4, it seems non-sensible. If we do check the ITS version, it
> > will give correct version for KVM. So add the checking of ITS
> > version for KVM: If and only if both GIC & ITS support GICv4,
> > gic_kvm_info.has_v4 is true. If and only if both GIC & ITS support
> > GICv4.1, gic_kvm_info.has_v4_1 is true.

What you don't explain here is what goes wrong. If there is no ITS
that supports GICv4.1 while the CPU interfaces and the RDs are
advertising this support, so be it.

So please explain what goes wrong, and whether there is any platform
in the wild that is showing this problem.



Without deviation from the norm, progress is not possible.