[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.22 v2.5] xen/arm: gic: defer host LPI allocation until after ITS init


  • To: Julien Grall <julien@xxxxxxx>
  • From: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • Date: Fri, 19 Jun 2026 17:55:17 +0300
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kmu9QKKfh3nVMnrE7wgqORZB1L1F/iwZCnIMkBW2pGk=; fh=aSZkuWeigIJCrae/Wb+6PXZ+hiibTT2ihTXZEANuOJE=; b=aLtXlveU0NTx3V2E5gaPy7eHzX0Y9HYUXLbghYIQfIM4c1o90t0/Skydtl9e8+xE6/ meQfiQDnG4Z0HvF8FVqBFRUZKbOKDUBT/7p94yln4NKMQOiHdufuPhCffkePdkuVdTM/ h+DmMqUYfBt/WfwAgt39ZeT7Znslo3F0/BSmubEGzWWJuuHYeBSpFY24hQ74idaGQKgB OTWRcbWo6z+Bzm/xbAUlHxZXEeIqvuRe6ersTYfLGxlu2h6vvgDAunbtKZDO4Cej7+FN HJthE4qi07hXFfWf3a2Tv8mER64qzRKH75nr7+eTmEvCT1RFMYU1NoYmgc8GCPxtpKxU ogHg==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1781880929; cv=none; d=google.com; s=arc-20240605; b=Xg3HZAeJADRWTAGHuBv0LTFvj2294mYY9P0lHpG+FRaUqVnVi92KLdNnilu31lD2wa sPEKl4mVYXuvgEVpBY6DNTDJccggNi71qiyqUYOlg9tgVzGqH0sLtjjj7nfJmK07vmJu X5rXaMyv/urIF5mx/J8Tb4nYklK8H3GsckvO4hky5ZbOkPbjg/xdNDRGABYPwpNMiu/p nZ50qwfv9QCMyf+XLJjthXc1nXYC3XC7w7tRlfmjQ3+E9801wSdA8n6SJqw4HKy5flmr wLAtdhxsX9SSG4I5Ta8GBzEahm7dBpRgF8BdBElc7GiBU14hxSj3eG4t+TrcvOFHlEZE SnLw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: "Orzel, Michal" <michal.orzel@xxxxxxx>, Mykola Kvach <mykola_kvach@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
  • Delivery-date: Fri, 19 Jun 2026 14:55:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien, Oleksii,

On Fri, Jun 19, 2026 at 2:52 PM Julien Grall <julien@xxxxxxx> wrote:
>
>
>
> On 19/06/2026 12:34, Orzel, Michal wrote:
> >
> >
> > On 19-Jun-26 13:23, Julien Grall wrote:
> >> Hi Michal,
> >>
> >> On 19/06/2026 10:48, Orzel, Michal wrote:
> >>> @Oleksii, can we ask for a release ack here?
> >>
> >> Can you explain the pros/cons of introducing this patch quite late?
> > The advantage is that it fixes the broken LPIs on affected hardware.
>
>  > The disadvantage is the reordering risk but I don't think there is
> any issue.
>
> See more below.
> >>
> >> One of the risk here is that we are now initializing the LPIs *after*
> >> the ITSes. I understand this is because we want to know the workaround.
> >> However, I vaguely recall that there was a dependency in the
> >> configuration. So are we confident the new ordering will not bring other
> >> issues? Ideally this should have been explained in the commit message.
> > gic-v3-its.c never references host LPI state, so ITS init has no dependency 
> > on LPIs.
>
> My concern is at the HW level. The ITS is using LPIs. But we will
> configure the ITS first and then the LPIs.
>
> What probaly saves us is the fact gicv3_lpi_init_host_lpis() only seem
> to allocate memory. This is a bit fragile though.

Regarding the ordering concern, the only operation moved by this patch
is gicv3_lpi_init_host_lpis(). It does not program either the
Redistributor or the ITS. It initializes Xen-side host LPI bookkeeping,
registers the CPU notifier, and allocates the boot CPU pending table.

gicv3_its_init() programs the ITS tables and command queue and enables
the ITS, but Xen does not enqueue any ITS command there. The first
MAPC/SYNC commands are issued by gicv3_its_setup_collection().

The relevant hardware-visible sequence in gicv3_cpu_init() therefore
remains:

    gicv3_lpi_init_rdist()       /* program PENDBASER/PROPBASER */
    gicv3_enable_lpis()          /* set EnableLPIs, followed by wmb() */
    gicv3_its_setup_collection() /* issue MAPC/SYNC */

So the ordering introduced by 95604873cc is preserved: no MAPC command
is submitted before GICR_PENDBASER/GICR_PROPBASER have been programmed
and the write setting GICR_CTLR.EnableLPIs has been made visible.

This matches the relevant architectural requirement: while
GICR_CTLR.EnableLPIs is 0, ITS translation requests or commands
involving LPIs in that Redistributor are ignored. This patch changes
when the backing memory is allocated, not when the Redistributor is
programmed or when the first ITS command is submitted.

The benefit of taking this for 4.22 is that it fixes broken LPIs on
systems where an ITS workaround changes the required memory attributes.
The ordering-specific fragility is that this reasoning relies on
gicv3_lpi_init_host_lpis() remaining allocation/bookkeeping-only. I
agree that this implicit dependency should be documented explicitly.

I will respin the commit message to describe this ordering and explain
why the hardware-visible sequence is unchanged.

Does this address your concern about taking the fix for 4.22?

Best regards,
Mykola



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.