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

Re: [PATCH 05/15] tools/libs/light: Increase nr_spi to 160


  • To: Anthony PERARD <anthony.perard@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Mon, 6 May 2024 13:17:02 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=cloud.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=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=l6c0h+MggjM7sWpoLtoclczD4wvLJnexioR+AiveNI4=; b=ftRgA9MrG6oqra166S4KqhZNVf0esKHHlUsKxT1glwW+zBjqYVTwwR+n4XgH0jD+DfIRCiAf1bkDDXfcePZJsmo91nsANqL89EKoJUhI6xhbflqv/nv25fYWKzn2FLjGnQo/3z4zabFoqc4g5YJAcLcJJ5H8G0pi5GN/vTtGCdezEHjpbnMjqLRoyNiN1iAarLgNu9gbkKdKoalXF5XPy3Qo1m/2j5Vh8wPBpGy81WVzurwZHqbWx+gVJOjD0tKe1Gy2/0ctsHaNxwOyBkkg0aJ58LES0IX+rPIk/vfHXpzV+4bMloZMA8QYeJoRSnn4lyr/NC1n/ynpRVasnwt22w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aPKwCA4a3uwF0v3DdYtyqEuNJJBJoIj7ell6THp9eRXIPM/cNd65A+RULXv5w2V3BxyapUV3x9cyfiMzpvm39vOKJ6FRAygA988r7v/+mN9wHdpLgEl34yjUquAsW1BNVlvEWKkjLPoq545dIbS+whEwuJo3Hp9mSlFTgQwunq6oEvjhL+BT2lWPzxnpriblWOaijS9ptLkVO1LCbeN0A73ddbf5anIDVn1RY31/7TqqoU64Kj3BBfpgYmPHLdEwqzJifDNc9Qq4I5dVlI2PcMPUhAF0gx6IU3+bUTrvkdDfRDRhnus2Z766FaOgY3GY7+M+7TvWyQo2xQ0984ZeQw==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Vikram Garhwal <fnu.vikram@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 06 May 2024 05:17:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Anthony,

(+Arm maintainers)

On 5/1/2024 9:58 PM, Anthony PERARD wrote:
On Wed, Apr 24, 2024 at 11:34:39AM +0800, Henry Wang wrote:
Increase number of spi to 160 i.e. gic_number_lines() for Xilinx ZynqMP - 32.
This was done to allocate and assign IRQs to a running domain.

Signed-off-by: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
Signed-off-by: Henry Wang <xin.wang2@xxxxxxx>
---
  tools/libs/light/libxl_arm.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index dd5c9f4917..50dbd0f2a9 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -181,7 +181,8 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
LOG(DEBUG, "Configure the domain"); - config->arch.nr_spis = nr_spis;
+    /* gic_number_lines() is 192 for Xilinx ZynqMP. min nr_spis = 192 - 32. */
+    config->arch.nr_spis = MAX(nr_spis, 160);
Is there a way that that Xen or libxl could find out what the minimum
number of SPI needs to be?

I am afraid currently there is none.

Are we going to have to increase that minimum
number every time a new platform comes along?

It doesn't appear that libxl is using that `nr_spis` value and it is
probably just given to Xen. So my guess is that Xen could simply take
care of the minimum value, gic_number_lines() seems to be a Xen
function.

Xen will take care of the value of nr_spis for dom0 in create_dom0()
dom0_cfg.arch.nr_spis = min(gic_number_lines(), (unsigned int) 992) - 32;
and also for dom0less domUs in create_domUs().

However, it looks like Xen will not take care of the mininum value for libxl guests, the value from config->arch.nr_spis in guest config file will be directly passed to the domain_vgic_init() function from arch_domain_create().

I agree with you that we shouldn't just bump the number everytime when we have a new platform. Therefore, would it be a good idea to move the logic in this patch to arch_sanitise_domain_config()?

Kind regards,
Henry


Thanks,





 


Rackspace

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