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

[PATCH v2 6/6] x86/irq: do not set nr_irqs based on nr_irqs_gsi in APIC mode


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 30 Jun 2022 10:54:39 +0200
  • 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
  • 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-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VbG8SbLt/zTeVZhfR3rNJP6yMc7lq6nzCcHws5sKZgxynrbjTTNWbKjIgA1M4OPN74cTHgzO86vyCO2lEGS4bF+iv+WMBBOasylBKz/Q0cjG4eOX1Pc4QFySaPCWReuhSBUPk595qqpNiYnT7bBwAJ02FoDL6crdmPcDdZ5X0OKf+6HR5LT5Tqtg5SspyNvihxrF83LGaZiNudezt7/Q0ese2He4TE9QDtGZdXs15XMAwUwZS3ylPOdykDmzRiO1abv6N3+23udK2BOkbNP05pSFBZDay1oOlR9LxmxNHncCPODxzdwZtukL1rK7qYD0eHK0HSxeMxUxVUgR4pMZUA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 30 Jun 2022 08:56:46 +0000
  • Ironport-data: A9a23:FRdqHasHUmZMSD5f/173jcrJs+fnVCJfMUV32f8akzHdYApBsoF/q tZmKW6AbquNYTD0f9l0aNvgoUlTvZCBxtJiTApk/iwxFSwV+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQywYbVvqYy2YLjW13W4 YuryyHiEATNNwBcYzp8B52r8HuDjNyq0N/PlgVjDRzjlAa2e0g9VPrzF4noR5fLatA88tqBb /TC1NmEElbxpH/BPD8HfoHTKSXmSpaKVeSHZ+E/t6KK2nCurQRquko32WZ1he66RFxlkvgoo Oihu6BcRi8TPIblqtQCdCB6PABAZrca9pz6IXGw5Jn7I03uKxMAwt1IJWRuZ8gj3L8yBmtDs /sFNDoKcxaPwfqsx662QfVtgcJlK9T3OIQYuTdryjSx4fQOGMifBfmVo4IHmmtr7ixNNa+2i 84xcz1gYQ6GexRSElwWFIg/jKGjgXyXnzhw9w7N9PpuvzC7IApZ16bKFfDMKvawV8xejHq1m kzG9W39DURPXDCY4X/fmp62vcffkCW+VI8MGbmQ8v9xnEbV1mEVEAcRV1awvb++kEHWc9BVJ lEQ+yEuhbMv70HtRd74NzWnpFaUsxhaXMBfe9DW8ymIw6vQph2fX2ECRzsZMtg+7pdqHnoty 0ODmM7vCXp3qrqJRHmB97CS6zSvJSwSKmxEbigBJecY3+TeTEgIpkqnZr5e/GSd17UZxRmYL +i2kRUD
  • Ironport-hdrordr: A9a23:33wGB6AjpdJyNKrlHeg3sceALOsnbusQ8zAXPh9KJCC9I/bzqy nxpp8mPH/P5wr5lktQ++xoX5PwO080lKQFmrX5WI3PYOCIghrNEGgP1+vfKnjbalTDH41mpN hdmtZFebrN5DFB5K6VgTVQUexQuOVvmJrY+ds2pE0dKD2CBZsQjDuQXW2gYzBLrUR9dOwEPa vZwvACiyureHwRYMj+Ln4ZX9Lbr9mOsJ79exYJCzMu9QHL1FqTmfbHOind+i1bfyJEwL8k/2 SAuwvl5p+7u/X+7hPHzWfc47lfhdOk4NpeA86njNQTN1zX+0+VTbUkf4fHkCE+oemp5lpvuN 7Qoy04N8A20H/VdnHdm2qZ5yDQlBIVr1Pyw16RhnXu5ebjQighNsZHjYVFNjPE9ksJprhHoe 529lPck6ASIQLLnSz76dSNfQptjFCIrX0rlvNWp2BDULEZdKRaoeUkjQ5o+a87bWzHAb0cYa hT5Jm23ocXTbraVQGSgoBX+q3iYpxpdS32AXTruaSuokprdT5CvgklLfck7wY9HaIGOud5Dt v/Q9RVfcl1P6krhIJGdZM8qJiMexvwaCOJFl6uCnLaM4xCE07xivfMkcYIDaeRCdc18Kc=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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é <roger.pau@xxxxxxxxxx>
---
 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 )
-- 
2.36.1




 


Rackspace

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