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

Re: [PATCH v2 4/8] tools/arm: Introduce the "nr_spis" xl config entry


  • To: Jason Andryuk <jason.andryuk@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Tue, 21 May 2024 07:19:50 +0800
  • 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=L7ZttqjF7bjrJVSr5FUkjnklGVSPmyTjxCFezK3B7A4=; b=gUmJzHenHCWXoNkOLB+VFOJkT7bVD9UxdtW5C2HXgSgoPo4EwJkq4JY3yr8zAlncYsk7jENYui1JaSO4hGYKqN/4DgnNPxQm2hBoVnPyksHBZeEwfhTvfyJlM4HRbUx2w8r4tcFMYIvj8Oke4CO3FK4hFnC189HtmvgxcVOajAZ1wSuywzeqa6FQggfmFCUprQXSxG6+GOxDpfD+5hKhmX8iLtTL8gqTUgxGWzGNT1ot6ficrEFQWrEPstkeflGlC2nUQTyRbVvqoBJL5beWxEmkexzPbhO9hLnZ1wa2R2QkqBqknDtBxADMeFILL8IHOkM3+b0W9zipqAp+NKsX7g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nMvGLiV16EisY5V/scVTZ6cvRWJmGM8qr6LJF4tu+lgKCXmFTXAy70whLrg/h6PG1qh5f8Y+6fRs+Mp+Y0crAVkftuyi6bQilqyTyB2iTDzqTnhbACcXclm4MDEgNfzRE150b91U4IDETq9awaWZ9wdvfMvO/ySVGls4eJMkpAoPeH6zV1FM/V305c+9XM2hzR7rRmEazdihrZFcVzAubU2G399jHUYFRsW/qcNBD1ATGckS0EuK5gjPdqyWdhaOyCCIhqcroeKaAeB5CnyIhVwqfJs6By3X8Wd0qP6YyRgLLc+PUQ2voyrI5e58E5n3Lm92Vgskeb/Epc+EG0abxw==
  • Cc: Anthony PERARD <anthony@xxxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Nick Rosbrook <rosbrookn@xxxxxxxxx>, "Juergen Gross" <jgross@xxxxxxxx>
  • Delivery-date: Mon, 20 May 2024 23:20:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Jason,

On 5/21/2024 3:13 AM, Jason Andryuk wrote:
+
+=item B<nr_spis="NR_SPIS">
+
+A 32-bit optional integer parameter specifying the number of SPIs (Shared

I'd phrase it "An optional 32-but integer"

+Peripheral Interrupts) to allocate for the domain. If the `nr_spis` parameter +is missing, the max number of SPIs calculated by the toolstack based on the
+devices allocated for the domain will be used.

This text says the maximum only applies if xl.cfg nr_spis is not setup.

+
+=back
+
  =head3 x86
    =over 4

diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index 1cb89fa584..a4029e3ac8 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -181,8 +181,8 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
        LOG(DEBUG, "Configure the domain");
  -    config->arch.nr_spis = nr_spis;
-    LOG(DEBUG, " - Allocate %u SPIs", nr_spis);
+    config->arch.nr_spis = max(nr_spis, d_config->b_info.arch_arm.nr_spis);
+    LOG(DEBUG, " - Allocate %u SPIs", config->arch.nr_spis);

But this is always taking the max.  Should it instead be:

config->arch.nr_spis = d_config->b_info.arch_arm.nr_spis ?: nr_spis;

However, I don't know if that makes sense for ARM.  Does the hardware nr_spis need to be a minimum for a domain?

Really, we just want the documentation to match the code.

Before you pointed this out, I didn't realize the ambiguity in the doc about the "max". The "max" in the doc have different meanings compared to the "max()" in the code. I will drop the "max" in the doc and reword the doc to "If the `nr_spis` parameter is missing, the number of SPIs calculated by the toolstack based on the  devices allocated for the domain will be used.". Thanks for pointing it out.

Kind regards,
Henry


Thanks,
Jason




 


Rackspace

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