All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: sashiko-reviews@lists.linux.dev, kvmarm@lists.linux.dev,
	Oliver Upton <oupton@kernel.org>
Subject: Re: [PATCH v2 2/4] KVM: arm64: vgic: Don't leak the SPI array when init is retried
Date: Tue, 18 Aug 2026 17:12:28 +0100	[thread overview]
Message-ID: <86a4qj5rwz.wl-maz@kernel.org> (raw)
In-Reply-To: <CA+EHjTyDix+y6NTLTsXP5j9Sn2VLOZcsw94LntQxg_etRBJZuA@mail.gmail.com>

On Tue, 18 Aug 2026 14:22:09 +0100,
Fuad Tabba <fuad.tabba@linux.dev> wrote:
> 
> Hi again Marc,
> 
> On Mon, 17 Aug 2026 at 19:40, Fuad Tabba <fuad.tabba@linux.dev> wrote:
> ...
> > > I really don't want to have to think about the intermediate state.
> >
> > Agreed. I'll drop the idempotent version I sketched and do teardown
> > and reinit instead.
> 
> Here are my thoughts. Three patches, all fixes.
> 
> vgic_init() will undo what it created when it fails, so
> KVM_DEV_ARM_VGIC_CTRL_INIT is all or nothing and a retry starts from
> scratch. Same thing you asked Karl for on the redistributor rollback
> [1].
> 
> That drops the count check I sketched. vgic_v4_init()'s early return
> stays, since vgic_its_create() still calls it for an ITS created after
> init.
> 
> irq-gic-v4.c goes first, as two patches. It removes the domains and
> frees the fwnodes without clearing the pointers, at four sites, and
> the teardown above makes that reachable on a path where it was not.
> The second is a leak in the same error path: when
> its_alloc_vcpu_sgis() fails partway, the SGI domains already allocated
> below it are never unwound.
> 
> What do you think?

Hard to picture when described like this. Please post the patches!

Thanks,

	M.

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

  reply	other threads:[~2026-08-18 16:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 10:40 [PATCH v2 0/4] KVM: arm64: vgic: Fixes for ITS table save and init retry Fuad Tabba
2026-08-07 10:40 ` [PATCH v2 1/4] KVM: arm64: vgic-its: Don't dereference a NULL collection on ITT save Fuad Tabba
2026-08-14 12:36   ` Eric Auger
2026-08-15  0:18     ` Fuad Tabba
2026-08-17  9:00       ` Eric Auger
2026-08-07 10:41 ` [PATCH v2 2/4] KVM: arm64: vgic: Don't leak the SPI array when init is retried Fuad Tabba
2026-08-07 10:55   ` sashiko-bot
2026-08-07 12:15     ` Fuad Tabba
2026-08-07 15:59       ` Marc Zyngier
2026-08-17 18:40         ` Fuad Tabba
2026-08-18 13:22           ` Fuad Tabba
2026-08-18 16:12             ` Marc Zyngier [this message]
2026-08-07 10:41 ` [PATCH v2 3/4] KVM: arm64: vgic-its: Don't save collections the table cannot hold Fuad Tabba
2026-08-08  8:10   ` Marc Zyngier
2026-08-17 18:21     ` Fuad Tabba
2026-08-18 16:06       ` Marc Zyngier
2026-08-07 10:41 ` [PATCH v2 4/4] KVM: arm64: vgic-its: Point saved ITEs at the next valid entry Fuad Tabba
2026-08-08 18:35 ` [PATCH v2 0/4] KVM: arm64: vgic: Fixes for ITS table save and init retry Oliver Upton

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=86a4qj5rwz.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=fuad.tabba@linux.dev \
    --cc=kvmarm@lists.linux.dev \
    --cc=oupton@kernel.org \
    --cc=sashiko-reviews@lists.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 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.