The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Kajetan Puchalski <kajetan.puchalski@arm.com>
Cc: oupton@kernel.org, fuad.tabba@linux.dev, joey.gouly@arm.com,
	seiden@linux.ibm.com, suzuki.poulose@arm.com,
	yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org,
	jic23@kernel.org, Sascha.Bischoff@arm.com, zenghui.yu@linux.dev,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	stable@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: vgic: Fix detection of MI on no pending LR
Date: Mon, 10 Aug 2026 12:32:54 +0100	[thread overview]
Message-ID: <86v79i1a8p.wl-maz@kernel.org> (raw)
In-Reply-To: <20260810102923.2426475-2-kajetan.puchalski@arm.com>

[Fixing up the initial recipient list...]

On Mon, 10 Aug 2026 11:29:24 +0100,
Kajetan Puchalski <kajetan.puchalski@arm.com> wrote:
> 
> As per the ARM GICv3 spec, the maintenance interrupt identified by
> ICH_MISR_EL2.NP is asserted when it is enabled and no List register is
> in pending state. This is further described in the document as "no List
> registers with the State field set to 0b01 (pending)". By checking only
> the pending bit of the LR (bit 62), KVM currently asserts the MI when
> there are no LRs in "pending" or "pending and active" states.
> Fix the detection logic to consider only the "pending" state.
> 
> Cc: stable@vger.kernel.org
> Fixes: 96c2f03311de ("KVM: arm64: nv: Plumb handling of GICv3 EL2 accesses")
> Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
> ---
>  arch/arm64/kvm/vgic/vgic-v3-nested.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/vgic/vgic-v3-nested.c b/arch/arm64/kvm/vgic/vgic-v3-nested.c
> index 5c69fa615823..e3e84d7f5ad5 100644
> --- a/arch/arm64/kvm/vgic/vgic-v3-nested.c
> +++ b/arch/arm64/kvm/vgic/vgic-v3-nested.c
> @@ -152,7 +152,7 @@ static void vgic_compute_mi_state(struct kvm_vcpu *vcpu, struct mi_state *mi_sta
>  			eisr |= BIT(i);
>  		if (!(lr & ICH_LR_STATE))
>  			elrsr |= BIT(i);
> -		pend |= (lr & ICH_LR_PENDING_BIT);
> +		pend |= (lr & ICH_LR_STATE) == ICH_LR_PENDING_BIT;
>  	}
>  
>  	mi_state->eisr	= eisr;

Thanks for catching this.

Reviewed-by: Marc Zyngier <maz@kernel.org>

	M.

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

      reply	other threads:[~2026-08-10 11:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 10:29 [PATCH] KVM: arm64: vgic: Fix detection of MI on no pending LR Kajetan Puchalski
2026-08-10 11:32 ` Marc Zyngier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86v79i1a8p.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=Sascha.Bischoff@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=fuad.tabba@linux.dev \
    --cc=jic23@kernel.org \
    --cc=joey.gouly@arm.com \
    --cc=kajetan.puchalski@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oupton@kernel.org \
    --cc=seiden@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    --cc=zenghui.yu@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox