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

[PATCH for-4.20] xen/arm: dom0less: Add #redistributor-regions property to GICv3 node


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 4 Jul 2024 09:54:19 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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=arcselector9901; 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=Cn0TjFAKHF8HGar+yx4yKFzfxkU7wFq9wqkb/IYEq0o=; b=jsrX9pxiAUCkBMsVQKUfLvsF1eqf3BdJgNv99FIjw9eQF4Zv7nniPq+JDQpmEaEcvfWny12nYatjg81QTQp7hpqQK7VjQIi4ssrLZXNd/ZAkEebSJJTP50OOYATTCj7fRO/SKKyOKZ+FOjCBysh3p+fMtowhEwRYlI5gTu5W+ovJ9MkCfX1h7KYmky3UtV5MeeVdA/c9m7m2Pu4+Ir/nW8ma9j8pFyTqLUWoaFr7sGDHw77cubLg1vQSVoxLRrmC/NTnKwnLpAGZ4sCTWby7PCxCOTQZqbgJUMcaKgzbO9KeNpPchJnPd5P7xQ+i9GmhyytYJgfZ2e3qpOkl3AqSWA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QaDRFcVD2YSMincS0EwP3v0FhY4sn4VMuhaIHoaD7bypT37aHrCL4N+qf3UmgpBLn/ZlWbl4j652jiEMlS3z8F+Z4oRJvrrqT5IgTlPUW/hp3t4pMEWcZHy55hQqWYjAtpdjcEcLJ0amQh4CAw+1D5jWVNyICnlmyl0Z4OX36OW/D0IRfjJICxLOuW69vmYte+nbKbkPCC2TljerpGZT2yauIdp5UDPqACBzH7QtoRcUAn88GH2TiOSsbZv9/1jTRZ4AMqXZjPiUlpbFvLzt/hnVEwOYu9iD9rf3BFUXHHr3nYeOvhR11ifo7IN/sjkVu+qzacHpMlSsgWGfA2ueag==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 04 Jul 2024 07:54:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Dom0less domain using host memory layout may use more than one
re-distributor region (d->arch.vgic.nr_regions > 1). In that case Xen
will add them in a "reg" property of a GICv3 domU node. Guest needs to
know how many regions to search for, and therefore the GICv3 dt binding
[1] specifies that "#redistributor-regions" property is required if more
than one redistributor region is present. However, Xen does not add this
property which makes guest believe, there is just one such region. This
can lead to guest boot failure when doing GIC SMP initialization. Fix it
by adding this property, which matches what we do for hwdom.

[1] Linux: 
Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml

Fixes: 4809f9ec7d71 ("xen/arm: if direct-map domain use native addresses for 
GICv3")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
Tested with Qemu 8.2, virt machine with nr cpus > 123 which requires to use a
second redistributor region.
---
 xen/arch/arm/dom0less-build.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index f919d3acf976..09b65e44aed3 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -176,6 +176,11 @@ static int __init make_gicv3_domU_node(struct kernel_info 
*kinfo)
     if ( res )
         return res;
 
+    res = fdt_property_cell(fdt, "#redistributor-regions",
+                            d->arch.vgic.nr_regions);
+    if ( res )
+        return res;
+
     /* reg specifies all re-distributors and Distributor. */
     len = (GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) *
           (d->arch.vgic.nr_regions + 1) * sizeof(__be32);
-- 
2.25.1




 


Rackspace

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