[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: Mykola Kvach <mykola_kvach@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: "Orzel, Michal" <michal.orzel@xxxxxxx>
- Date: Fri, 19 Jun 2026 08:09:14 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Woyuh5skBkAG4+lxLY5ewg4jVeiU4PUKSuZlis341MM=; b=njO0pzeNb4AsBJVqX83xmjg29zJ45nfcN/Cm8go2nOD/J+EF0cPgUwA/CrLskTZ/vvhHhFYBiw64eLT5Aon4TWGQtHWI0QGxgJzxvAQUtbDwoigOiwA8AhRI73BlflxhzAFaIazfJXCQjS5eq+ChBsWjDyWtFyYiqQB5ZXnrVpnqeBhsdANtZm3ytYkwzjEujha58XGkJgxgbnL3lpsvdv7+hg6CX/osawKSlrkVxOBuHFiFcoNQZQopHv6bYeB5VLjfvM5iMQQV8MIe5oqajAV2v7e5LTpJWpyn3ZWah5p4+FG64OV7FKrRoN6VUrmYj61JLEyIlITIRd8ATiCQ6Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tG7SqUDJQlQh3R1v1vBC3LQbndB8NFDNWDkJwC5v94WoeKGCR4sym6++z4mdPD9o/XA7wHBl4Xw+KUyGy6JtNQLIC2BRe879ZVl7tqJ3sM67wU4BkCXNUW7IFsMqFY2K4+C1bv8AbiPC1O/1RoOJGPHOsQ7n2OMgGVK3nUszk0wB6RzYKKDIEwyXBp49S1XtTjzEE6IDRqbua45O/wuG4EPuuTrFQmObFhDTA0sKEFTjPYk7K578eVrtRKNsgeYqDtB1CAYZAcSHNTxmKmtMYROv+dW+opbFSG+GJ30+axmGUyBQ6WFV8SeMkJtFkASC2DSKAKv0yhb+QaiUPU9y1g==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>, "Mykola Kvach" <xakep.amatop@xxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
- Delivery-date: Fri, 19 Jun 2026 06:09:40 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 19-Jun-26 07:45, Mykola Kvach wrote:
> gicv3_lpi_init_host_lpis() allocates host LPI state, including the
> host LPI lookup table, CPU notifier state and the boot CPU pending table.
> Those allocations use gicv3_its_get_memflags().
>
> ITS quirks are discovered by gicv3_its_init(), so allocating host LPI
> state from gicv3_dist_init() can happen before the memory restrictions
> required by the ITS are known. On affected systems this can leave
> Redistributor LPI state allocated and programmed with the default memory
> policy.
>
> Move host LPI initialization after gicv3_its_init(), and only run it when
> a host ITS was found. The old call ignored the return value. Now that the
> call is made from gicv3_init(), check it and panic on failure because
> Redistributor LPI initialization relies on that state being available.
>
> This also narrows the condition for host LPI initialization from
> "GICD advertises LPIs" to "a host ITS was discovered". This is
> intentional: Xen currently has no supported LPI path without a host ITS,
> and gicv3_lpi_init_rdist() already rejects that case with -ENODEV.
> Therefore, on systems where GICD_TYPE_LPIS is set but no host ITS is
> present, skipping gicv3_lpi_init_host_lpis() only avoids allocating host
> LPI state that cannot be used by a supported Xen LPI path.
>
> Fixes: dcb6cb263689 ("ARM: GICv3 ITS: introduce host LPI array")
> Fixes: 751ec850ec1d ("ARM: ITS: implement quirks and add support for Renesas
> Gen4 ITS")
> Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
> Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
~Michal
|