From patchwork Thu Jun 30 08:54:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12901443 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 54B81C43334 for ; Thu, 30 Jun 2022 08:56:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.358349.587559 (Exim 4.92) (envelope-from ) id 1o6pyg-0000zV-88; Thu, 30 Jun 2022 08:56:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 358349.587559; Thu, 30 Jun 2022 08:56:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6pyg-0000zK-1f; Thu, 30 Jun 2022 08:56:46 +0000 Received: by outflank-mailman (input) for mailman id 358349; Thu, 30 Jun 2022 08:56:44 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6pye-0007Q3-IW for xen-devel@lists.xenproject.org; Thu, 30 Jun 2022 08:56:44 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8daf9869-f852-11ec-bdce-3d151da133c5; Thu, 30 Jun 2022 10:56:40 +0200 (CEST) Received: from mail-sn1anam02lp2043.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.57.43]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Jun 2022 04:56:40 -0400 Received: from DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) by SJ0PR03MB6699.namprd03.prod.outlook.com (2603:10b6:a03:402::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Thu, 30 Jun 2022 08:56:39 +0000 Received: from DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::40af:d5f4:95eb:d534]) by DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::40af:d5f4:95eb:d534%7]) with mapi id 15.20.5395.015; Thu, 30 Jun 2022 08:56:39 +0000 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: 8daf9869-f852-11ec-bdce-3d151da133c5 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1656579403; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=M9sDkqyoWe8u+1pJDvGlTJ+8UF/5g6xliqOyamJnVWI=; b=AIznX0cxbymzrphChpHVajbD5zPYTBNjfo/fsXMBX0JFetxlDxDjze2F CDdIpZygV5q/SjWKJo/xrB7wrw/xm+xObK1panzBQk2F/zccflueRruJs yzZmFTJZJeVfDcnamkkXx70q6d3+yOcIeplUFtbdTUYhH1QXlR1RvRPbV I=; X-IronPort-RemoteIP: 104.47.57.43 X-IronPort-MID: 74098140 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:FRdqHasHUmZMSD5f/173jcrJs+fnVCJfMUV32f8akzHdYApBsoF/q tZmKW6AbquNYTD0f9l0aNvgoUlTvZCBxtJ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lBIVr1Pyw16RhnXu5ebjQighNsZHjYVFNjPE9ksJprhHoe 529lPck6ASIQLLnSz76dSNfQptjFCIrX0rlvNWp2BDULEZdKRaoeUkjQ5o+a87bWzHAb0cYa hT5Jm23ocXTbraVQGSgoBX+q3iYpxpdS32AXTruaSuokprdT5CvgklLfck7wY9HaIGOud5Dt v/Q9RVfcl1P6krhIJGdZM8qJiMexvwaCOJFl6uCnLaM4xCE07xivfMkcYIDaeRCdc18Kc= X-IronPort-AV: E=Sophos;i="5.92,233,1650945600"; d="scan'208";a="74098140" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VbG8SbLt/zTeVZhfR3rNJP6yMc7lq6nzCcHws5sKZgxynrbjTTNWbKjIgA1M4OPN74cTHgzO86vyCO2lEGS4bF+iv+WMBBOasylBKz/Q0cjG4eOX1Pc4QFySaPCWReuhSBUPk595qqpNiYnT7bBwAJ02FoDL6crdmPcDdZ5X0OKf+6HR5LT5Tqtg5SspyNvihxrF83LGaZiNudezt7/Q0ese2He4TE9QDtGZdXs15XMAwUwZS3ylPOdykDmzRiO1abv6N3+23udK2BOkbNP05pSFBZDay1oOlR9LxmxNHncCPODxzdwZtukL1rK7qYD0eHK0HSxeMxUxVUgR4pMZUA== 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=f+VcW6quQIs1mH4she5NONTPj4PREd8r33VA4ThvE2Y=; b=F1Qr4bEYhzaA69MHXDNH1/yRaqqqwxtHv6c1cyk5xsSpMH0QZxPDyI7fJjFAweHYjkQEv+gShzPe/PXFTGLOVk8tbGsYEjJdbGNRUYxOewhKvQWL5if/ZPQnxph1xi5qd+2t87XuRZvmO3WhB7Kr3dafIKXF/VkEdMNap+r9jTkj85wVJ5qL1ELMLHwLuONlT18OimOwf11yyXf0JHGkWX//25wBEA0xu7xecbTX+VDUFixFV07LQY5FEwgJNA80/BJYg8AFVS4seZH0cEsMb1d6EWzJ1N4yD3fRTebdXRAEw3PjeIg9xTjWcDlkGdw3vRpS2q+Zm6T0i45u6wD1KQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f+VcW6quQIs1mH4she5NONTPj4PREd8r33VA4ThvE2Y=; b=J+1gMRfNFxCZ/fldV2/RIUkcQIOnx6sWedQ8bSN2rz0Llz5z5xrc/qG1qyfQiL+tJkzUZ5VlLRN7pldo4u7ZhmywnCOSNbnK4D2hvi3BIiyfXl+dZkW4tCnVdj14WKZUPrwsl4Ut1btttfv+V29QLDUC5pyLU4y2wvYBwdHuv38= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH v2 6/6] x86/irq: do not set nr_irqs based on nr_irqs_gsi in APIC mode Date: Thu, 30 Jun 2022 10:54:39 +0200 Message-Id: <20220630085439.83193-7-roger.pau@citrix.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220630085439.83193-1-roger.pau@citrix.com> References: <20220630085439.83193-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0609.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:314::11) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 895b7875-2d61-4f85-5a55-08da5a7671e8 X-MS-TrafficTypeDiagnostic: SJ0PR03MB6699:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BTzb38rTcOX68Xk4ctm8mkJYqsVAjffjmVPggNes2IlFsnovPzmbPEV7cOzu3yhZaijCHMG9APi5OGDG5+sSfMJPrHClxfkJIHIlfQ/SUJp4lKr3nVVyxQDoTDDh066J67nuhyiz1Rp8ThsMAPfGALtbccXPEOXkEJewGpBqUlDriVqBg/nEnA7Tg8Vuz5NUAFGJYmATR/vixkGQhMa21JlcRsdmiN5hjTFO23+aXL6HshvJpjvdtIDY7lwq61hj5oktXYWrSaR7+H5YXo5RqtvPj+0Zs3akWCvmT5puJ68d+9gqfR9i7LHgFEnApN6vCL0tQXgo4ZR4dI36x7SfHCG/rMquxeBooeNTyXP66Wgqto0FcJG4C2wzeZulRIGbETq72vUeTiqoK+T5t5jqu9QHFBomNsiDp9XB0Ao20/kC+O3WnDgaCd0xBkKthfnbtBKWAZLNf7zdtIo/TxM4yDIUwurpHpXjfw+qIAPg6OBgXGRwQR1ajwYHEi6VfemnzyLYc2EE413ZAfgmwHlK6jPHqijVvX/fvQQ9CQAB9/PHzA4rLLc1h9/ZCFZg1G3DO8bLayszdhKnGbWboaknJuSjGGyjbFzRZJc8o/MePeR7M3G8tXrDFowbUrl/Brau9CO2K0udIB2PAtuoeDMb/lbhwE1T2torbd9JlNF1biE2qCEH8+EOjDPB+3pxm/f/Q9BhLiQbmfIpKsxgIv11WXNGd53gOQF5ba5IdTIpJMaXIgTFb8Mcg2qi928UbKL45AiUdooVr5Jhe631J2wXlg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(376002)(396003)(366004)(346002)(136003)(186003)(36756003)(316002)(2906002)(6506007)(86362001)(54906003)(41300700001)(2616005)(4744005)(38100700002)(6916009)(66556008)(66476007)(26005)(66946007)(4326008)(5660300002)(8936002)(8676002)(6512007)(1076003)(478600001)(6486002)(82960400001)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?RaY7d1REn6D7ybaMqiz6RoKB3G6u?= =?utf-8?q?AJcepefrm1OdwA6wej78Q04+pH/YqjWLtNVvLDu7yQcgolh76NpUM08s27aQDwQCH?= =?utf-8?q?8mxMJ7im4J+wNc1349J8bC5BJaDvwmsItgzrmkhwROQdU/3H0hA3d34ikK/sxKuuX?= =?utf-8?q?lH+USrlVl1A58fWpYjLia0BbrB2xeikmtMQGBa+uuya7yrAcND+SOLI8r0thjg6gV?= =?utf-8?q?AHLIibQLDWhiV3NGndhjDc4oiST+9KBmXi8Cy1GLxVysOwDWh+BIYNWnmkZvBoI0w?= =?utf-8?q?b4XNIl/E115cUE1hghKOlzwFrhaXZowqyKt6Lp92yNIeVyMbsPTFvwd41K5IuBXyA?= =?utf-8?q?ppHXlqK6bdWDaJAL9fGNXxcS3QV5GmC6CMk1FJ6De/TQ9z6YLsWMqLcYj7S8XKHfj?= =?utf-8?q?vbADpyzD3ef99MHF5LElqy2zo9qrbr43g9AW9FYFMAac2pkCRCusySjzkNIk3vaNH?= =?utf-8?q?MwnP2RdJN5pj/NisRUp7+8Fqgr9sYlEFWCIqzEhXrKkfmenHOg7i7k4vPDxNYjuNm?= =?utf-8?q?Y6CcLkJ9Izrrg405waCnDj4+SirEP5TIMqBfl/iKDhF99dVAuo4Sx6EJnUFJi7aAg?= =?utf-8?q?6mHK6Pe2XRNCvAP4Ew/xEt04SLd7xnjCpKsnzWRxR4Tfgvqmf8oM12vRRr0qY8Usl?= =?utf-8?q?QzpnUNN6x1jeTCfFO6FkWBGWqbmc/bwzNZYm7D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-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 895b7875-2d61-4f85-5a55-08da5a7671e8 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2022 08:56:39.2071 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jGEhCFpryh4CfPmJ8Kiiii/VdSf6JS0dnhrhwdQUMUuV5lTluoLh62viBUNY+WVwk0ta306MdAMgytpgBhMuPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6699 When using an APIC do not set nr_irqs based on a factor of nr_irqs_gsi (currently x8), and instead do so exclusively based on the amount of available vectors on the system. There's no point in setting nr_irqs to a value higher than the available set of vectors, as vector allocation will fail anyway. Fixes: e99d45da8a ('x86/x2apic: properly implement cluster mode') Signed-off-by: Roger Pau Monné --- xen/arch/x86/irq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 7f75ec8bcc..e3b0bee527 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -426,8 +426,7 @@ int __init init_irq_data(void) (x2apic_enabled && !x2apic_phys) ? x2apic_max_cluster_id + 1 : num_present_cpus(); - nr_irqs = cpu_has_apic ? max(vec_spaces * NR_DYNAMIC_VECTORS, - 8 * nr_irqs_gsi) + nr_irqs = cpu_has_apic ? vec_spaces * NR_DYNAMIC_VECTORS : nr_irqs_gsi; } else if ( nr_irqs < 16 )