Re: [PATCH 04/12] KVM: arm64: Force GICv3 traps activa when no irqchip is configured on VHE

Marc Zyngier
2024-08-21T11:14:00Z

On Wed, 21 Aug 2024 00:33:40 +0100,
Oliver Upton <oliver.upton@linux.dev> wrote:
>
> s/activa/active/
>
> On Tue, Aug 20, 2024 at 11:03:41AM +0100, Marc Zyngier wrote:
> > On a VHE system, no GICv3 traps get configured when no irqchip is
> > present. This is not quite matching the "no GICv3" semantics that
> > we want to present.
> >
> > Force such traps to be configured in this case.
> >
> > Signed-off-by: Marc Zyngier <maz@kernel.org>
> > ---
> > arch/arm64/kvm/vgic/vgic.c | 14 ++++++++++----
> > 1 file changed, 10 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c
> > index 974849ea7101..2caa64415ff3 100644
> > --- a/arch/arm64/kvm/vgic/vgic.c
> > +++ b/arch/arm64/kvm/vgic/vgic.c
> > @@ -917,10 +917,13 @@ void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu)
> >
> > void kvm_vgic_load(struct kvm_vcpu *vcpu)
> > {
> > - if (unlikely(!vgic_initialized(vcpu->kvm)))
> > + if (unlikely(!irqchip_in_kernel(vcpu->kvm) || !vgic_initialized(vcpu->kvm))) {
>
> Doesn't !vgic_initialized(vcpu->kvm) also cover the case of no irqchip
> in kernel?

It does, but that's purely accidental. I can drop that, but it is
really fragile.

Thanks,

M.

--
Without deviation from the norm, progress is not possible.