[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 3/6] x86/setup: init nr_irqs after having detected x2APIC support
- To: xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Date: Thu, 30 Jun 2022 10:54:36 +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=euzhKLQqaFSC2Ezhbo0Ek1xKzO4ctm4oHFntZFUVdLc=; b=PciyX1Ek9nbuXzy+a3j2UOQBO1ZzksZrBnXeq8ttMqJxcRdO1C7ZEFF7aQKBzTlNFQqXONgsPqkEjAY58i8yna+/JPNYeLH6zekYavw/zjOu3EQDsvQVB5tK/U7YOrAAAdBwfE73lAVoZFTZ0rvht2PQ5LUYZOfCpcqlGU0nQVhRkgXO4xdXEpTelQt2X1PZ5Oa4nqbC9enb7TH+33fZEye9ScPPsUGCNAbOJgphcanfLSu1xzJqdYj0KDGGGl5cYjaHGOASFOjIUtPkIiJ8z8PEol0UGnueXpdYoX6t4bqvSJdBFTWPmEn3Y4BTXsn1g5gRan1bzCQIYvKscGy/Gg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PrMfaK7Ad9O6gzvsf9L2fcDv2WVujNAFf4RvRLzS2knmlPSSK5WiVHIoEojUvdkTsJriakhvSdtqQBiBv9Q4AG5TwenNn316t5tBN6RIDVPOycdmSzVJ56N4Cj3OK1uLGROenHL/XTPtQ9bTxF9NPhW4zLOe8IQlRjnkCrIcxvqdG4hS4slyPFQw0EjHFBQqlug+ZMcIwV0ff5APB42t3tiaHBnj3iu4iFstopWi96BCNzkpMmVdPpvVdBKNg5dqGk4BQ1KXPQxhdn8Rd5wUbQB/xGO5emBn1T9e3+T9bouF/L1FYpQdJXM6V4BhsJgseA7ovTo+9ZZEGtrGhE+H1w==
- 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:30 +0000
- Ironport-data: A9a23:fRhvy6AfV+KWZBVW/13iw5YqxClBgxIJ4kV8jS/XYbTApDIi0GEPy DYXWGjVbqqMYGqkLt8lbIrjphgFscPdy9dnQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgH2eIdA970Ug5w7Bi2tYx6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPhpm Php7oTqZTsTL6Pwp+FEbgNmFgFxaPguFL/veRBTsOS15mieKT7X5awrC0s7e4oF5uxwHGdCs +QCLywAZQyCgOTwx6+nTu5rhYIoK8yD0IE34yk8i22GS6t5B8yYK0nJzYYwMDMYnMdBEOyYf 8MEQTFucA7Bc1tEPVJ/5JcWw7jz3SivK2QwRFS9/Ic1xXDKzCJIirmyLcTrZtDJbul0txPNz o7B1yGjav0AD/SPxDzA/n+yi+vnmSLgRJlUBLC+7uRtglCY2ioUEhJ+fVmxrOS9i0W+c8lCM EFS8S0rxYAt8GS7Q9+7WAe3yENopTYZUttUVvY8sQiLw6+MuQKBXDBYFXhGdcAss9IwSXoyz FiVktj1BDtp9rqIVXaa8bTSpjS3UcQIEVI/ieY/ZVNty7HeTEsb1Xojkv4L/HaJs+DI
- Ironport-hdrordr: A9a23:AgQ66KnS8M7KiqQ7Iyc+l14+1HzpDfO3imdD5ihNYBxZY6Wkfp +V8cjzhCWftN9OYhodcLC7V5Voj0msl6KdhrNhR4tKPTOWw1dASbsP0WKM+UyFJ8STzI5gPO JbAtFD4b7LfCdHZLjBkW6F+r8bqbHokZxAx92ut0uFJTsaF52IhD0JbzpzfHcGJzWvUvECZe ehD4d81kydUEVSSv7+KmgOXuDFqdGOvJX6YSQeDxpizAWVlzun5JPzDhDdh34lInty6IZn1V KAvx3y562lvf3+4hjA11XL55ATvNf60NNMCOGFl8BQADTxjQSDYphnRtS5zXkIidDqzGxvvM jHoh8mMcg2w3TNflutqR+o4AXk2CZG0Q6W9XaoxV/Y5eDpTjMzDMRMwahDdAHC1kYmtNZglI pWwmOwrfNsfF/9tRW4w+KNewBhl0Kyr3Znu/UUlWZjXYwXb6IUhZAD/XlSDIwLEEvBmc0a+d FVfY/hDcttABKnhyizhBgu/DXsZAV4Iv6+eDlMhiTPuAIm30yQzCMjtb4idzk7hdAAoqJ/lp X525RT5c9zp/AtHNJA7Z86MK2K40z2MGbx2TGpUCPaPZBCHU7xgLjKx5hwzN2WWfUzvegPcd L6IRhliVI=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Logic in ioapic_init() that sets the number of available vectors for
external interrupts requires knowing the x2APIC Destination Mode. As
such move the call after x2APIC BSP setup.
Do it as part of init_irq_data(), which is called just after x2APIC
BSP init and also makes use of nr_irqs itself.
No functional change intended.
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
xen/arch/x86/io_apic.c | 10 ----------
xen/arch/x86/irq.c | 10 ++++++++++
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index c086f40f63..8d4923ba9a 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2653,16 +2653,6 @@ void __init ioapic_init(void)
max_gsi_irqs, nr_irqs_gsi);
nr_irqs_gsi = max_gsi_irqs;
}
-
- if ( nr_irqs == 0 )
- nr_irqs = cpu_has_apic ?
- max(0U + num_present_cpus() * NR_DYNAMIC_VECTORS,
- 8 * nr_irqs_gsi) :
- nr_irqs_gsi;
- else if ( nr_irqs < 16 )
- nr_irqs = 16;
- printk(XENLOG_INFO "IRQ limits: %u GSI, %u MSI/MSI-X\n",
- nr_irqs_gsi, nr_irqs - nr_irqs_gsi);
}
unsigned int arch_hwdom_irqs(domid_t domid)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index de30ee7779..b51e25f696 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -420,6 +420,16 @@ int __init init_irq_data(void)
struct irq_desc *desc;
int irq, vector;
+ if ( nr_irqs == 0 )
+ nr_irqs = cpu_has_apic ? max(0U + num_present_cpus() *
+ NR_DYNAMIC_VECTORS, 8 * nr_irqs_gsi)
+ : nr_irqs_gsi;
+ else if ( nr_irqs < 16 )
+ nr_irqs = 16;
+
+ printk(XENLOG_INFO "IRQ limits: %u GSI, %u MSI/MSI-X\n",
+ nr_irqs_gsi, nr_irqs - nr_irqs_gsi);
+
for ( vector = 0; vector < X86_NR_VECTORS; ++vector )
this_cpu(vector_irq)[vector] = INT_MIN;
--
2.36.1
|