All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: kvmarm@lists.linux.dev, Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	syzbot+cef594105ac7e60c6d93@syzkaller.appspotmail.com
Subject: Re: [PATCH 3/5] KVM: arm64: vgic-v3: Erase LPIs from xarray outside of raw spinlocks
Date: Fri, 05 Sep 2025 08:44:38 +0100	[thread overview]
Message-ID: <87qzwlz6l5.wl-maz@kernel.org> (raw)
In-Reply-To: <20250904062348.223976-4-oliver.upton@linux.dev>

On Thu, 04 Sep 2025 07:23:46 +0100,
Oliver Upton <oliver.upton@linux.dev> wrote:
> 
> diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
> index ed0e96031a65..af224db3cf72 100644
> --- a/include/kvm/arm_vgic.h
> +++ b/include/kvm/arm_vgic.h
> @@ -139,7 +139,11 @@ struct vgic_irq {
>  	bool pending_latch;		/* The pending latch state used to calculate
>  					 * the pending state for both level
>  					 * and edge triggered IRQs. */
> -	bool active;			/* not used for LPIs */
> +	union {
> +		bool active;		/* not used for LPIs */
> +		bool pending_release;	/* LPI pending a release */
> +	};
> +

Err... no. Please don't do that. An activated LPI that hasn't been
EOI'd yet does have the active state in the LR (yes, the original
comment is totally broken, please remove it).

Imagine a case where you'd preempt the guest between the read of IAR
and the write to EOI: pending_release is now set, and that could
result in some funky stuff...

Just add it as a separate field, I don't think anyone will cry over
that.

	M.

-- 
Jazz isn't dead. It just smells funny.

  reply	other threads:[~2025-09-05  7:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04  6:23 [PATCH 0/5] KVM: arm64: vgic-v3: Fix yet another lock ordering turd Oliver Upton
2025-09-04  6:23 ` [PATCH 1/5] KVM: arm64: vgic-v3: Use bare refcount for VGIC LPIs Oliver Upton
2025-09-04  6:23 ` [PATCH 2/5] KVM: arm64: Spin off release helper from vgic_put_irq() Oliver Upton
2025-09-04  6:23 ` [PATCH 3/5] KVM: arm64: vgic-v3: Erase LPIs from xarray outside of raw spinlocks Oliver Upton
2025-09-05  7:44   ` Marc Zyngier [this message]
2025-09-05  7:19     ` Oliver Upton
2025-09-04  6:23 ` [PATCH 4/5] KVM: arm64: vgic-v3: Don't require IRQs be disabled for LPI xarray lock Oliver Upton
2025-09-05  8:13   ` Marc Zyngier
2025-09-05  8:55     ` Oliver Upton
2025-09-04  6:23 ` [PATCH 5/5] KVM: arm64: vgic-v3: Indicate vgic_put_irq() may take " Oliver Upton
2025-09-04 10:25   ` Ben Horgan
2025-09-04  8:19     ` Oliver Upton
2025-09-05  8:29 ` [PATCH 0/5] KVM: arm64: vgic-v3: Fix yet another lock ordering turd Marc Zyngier

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=87qzwlz6l5.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=oliver.upton@linux.dev \
    --cc=suzuki.poulose@arm.com \
    --cc=syzbot+cef594105ac7e60c6d93@syzkaller.appspotmail.com \
    --cc=yuzenghui@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.