From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F551C25B77 for ; Mon, 20 May 2024 23:20:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.726410.1130689 (Exim 4.92) (envelope-from ) id 1s9CIR-0007Ol-Nb; Mon, 20 May 2024 23:19:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 726410.1130689; Mon, 20 May 2024 23:19:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s9CIR-0007Oe-JU; Mon, 20 May 2024 23:19:59 +0000 Received: by outflank-mailman (input) for mailman id 726410; Mon, 20 May 2024 23:19:58 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s9CIQ-0007OY-U3 for xen-devel@lists.xenproject.org; Mon, 20 May 2024 23:19:58 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20601.outbound.protection.outlook.com [2a01:111:f403:2418::601]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7915e3e9-16ff-11ef-909f-e314d9c70b13; Tue, 21 May 2024 01:19:57 +0200 (CEST) Received: from BN8PR04CA0065.namprd04.prod.outlook.com (2603:10b6:408:d4::39) by LV3PR12MB9141.namprd12.prod.outlook.com (2603:10b6:408:1a7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Mon, 20 May 2024 23:19:53 +0000 Received: from BN2PEPF000044A1.namprd02.prod.outlook.com (2603:10b6:408:d4:cafe::ae) by BN8PR04CA0065.outlook.office365.com (2603:10b6:408:d4::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36 via Frontend Transport; Mon, 20 May 2024 23:19:53 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF000044A1.mail.protection.outlook.com (10.167.243.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7611.14 via Frontend Transport; Mon, 20 May 2024 23:19:53 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 20 May 2024 18:19:52 -0500 Received: from [172.31.124.47] (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 20 May 2024 18:19:51 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7915e3e9-16ff-11ef-909f-e314d9c70b13 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== 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-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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L7ZttqjF7bjrJVSr5FUkjnklGVSPmyTjxCFezK3B7A4=; b=r1hbhMkoZgF/hINvFRS/7nKOB27snjbUsBt7gd1NQzubZYjravCqI/AuJRYZInT9XCgIiYz2vUFi0VY5oQjzLXjQ41nOryRawFpsQrfMhXs9IEqn6ohn7qzzIvtRvisRlG3E7cSjqXy7E128KJJJut61NGdqRGMJZkCJJSm5Dos= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Message-ID: Date: Tue, 21 May 2024 07:19:50 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 4/8] tools/arm: Introduce the "nr_spis" xl config entry To: Jason Andryuk , CC: Anthony PERARD , George Dunlap , Nick Rosbrook , "Juergen Gross" References: <20240516100330.1433265-1-xin.wang2@amd.com> <20240516100330.1433265-5-xin.wang2@amd.com> <0a87ccc8-4262-4122-8142-2f64a174bab2@amd.com> Content-Language: en-US From: Henry Wang In-Reply-To: <0a87ccc8-4262-4122-8142-2f64a174bab2@amd.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: None (SATLEXMB04.amd.com: xin.wang2@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A1:EE_|LV3PR12MB9141:EE_ X-MS-Office365-Filtering-Correlation-Id: e73761d7-6620-46cc-88d8-08dc79235ab6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|82310400017|376005|36860700004; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YW1DQ216TU1xRjBDQm5ZZG12MGhjaUhpNk9LV3FDY0NlckxSV1NWUTB0K0Np?= =?utf-8?B?TURMM09vcnhMVlYwQjRVSGQySzVxQVJQVDM5T0NqeGRNenR1OEVvM2pnV3Vw?= =?utf-8?B?aTRHZDVGM3ZxK3gyb2tZU0RKTFpjRkE4MnlCUzhMV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CL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(1800799015)(82310400017)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2024 23:19:53.2027 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e73761d7-6620-46cc-88d8-08dc79235ab6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044A1.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9141 Hi Jason, On 5/21/2024 3:13 AM, Jason Andryuk wrote: >> + >> +=item B >> + >> +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