[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 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, 23 Jun 2022 10:24:25 +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=GZEpsL9d8KrvWll+fUW/Z+Omgq152MKC2I5k3qFGSFoN5zrk3CG/r/3YxC5VvKX036SXbECGG7+JOzcT8PRP9NTouN431/oyUIZ4wMYwYorxTCkI9eqrTRJGcOmOVUQO1FrgI9pQd8wZPgRV2vSQf6jmIAAv5cKyIYbHf2rGskyAgSJXgynobOJLk6yS0zbXgu4IqpMT2bLTQmqsIHY+TM/xwACKEoPIwRiLMxptPbfbdfxE47CxpSXhf5JPTlB2GQRz2sIS8mRDRjrSAyDGDT4iGTCkxMjc/8JucV77PWG4tLmalBjptbmYb+GaddCkF7JhvfCyhJLJFabeC0+1gw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iL8aIN3wJ7cPzXI8qHuc0KZdMsJ6gd5qgRwlmV3lLnmeluQrSx73IX4mUBP86RAXqS4tPRtShIAVczzS86jbaq7p3BbH/cH9vwgtyO12RWJ2rK5BjEIPXBH+DJdJdJ/q6eRh94PwzUK2sEtHSTWbyC+z+RQvwhjVIUj/OGLivVi/ZbJHQ5Bu6SYwKZfk7UZKPxvCakzT9p0yRNjwluF1Dfs/yxNE0yWx95b0vVAiN8OMB1MKhf36v7uQjM7ZXAR3HIO+VMqSso1ZdRf/dB5DOOfm4onlFiPra/JT3TWZkPliCDKzpr1cmQrKZynwEYQGB4wRPDe4hR5CvYlMm6HIfw==
- 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, 23 Jun 2022 08:25:27 +0000
- Ironport-data: A9a23:jXkjVK77mnKEs5Nl/GGMKgxRtEzGchMFZxGqfqrLsTDasY5as4F+v mdNX27XPqmKZWT9ctl3bYzk8x9XuZCHmNVrTwFpr30yHi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuVGuG96yE6j8lkf5KkYAL+EnkZqTRMFWFw03qPp8Zj2tQy2YbjWVvR0 T/Pi5a31GGNimYc3l08s8pvmDs31BglkGpF1rCWTakjUG72zxH5PrpGTU2CByKQrr1vNvy7X 47+IISRpQs1yfuP5uSNyd4XemVSKlLb0JPnZnB+A8BOiTAazsA+PzpS2FPxpi67hh3Q9+2dx umhurSsTlt1JPXUkt8QdF5KMQdsBJQYyJLIdC3XXcy7lyUqclPK6tA3VgQaGNNd/ex6R2ZT6 fYfNTYBKAiZgP67y666Te8qgdk/KM7sP8UUvXQIITPxVK56B8ycBfibo4YHg1/chegXdRraT 9AeZjd1KgzJfjVEO0sNCYJ4l+Ct7pX6W2IE8g/K/fVni4TV5DZ18KfwDt7XQcSTb4J6ul6dh z6W82usV3n2M/Tak1Jp6EmEluLJ2C/2Ro8WPLm57eJxxk2ewHQJDx8bXkf9puO24ma8Ud9CL 00f+gI1sLM/skesS7HVQBmQsHOC+BkGVLJt//YS7QiMzu/Y5lifD21dFDpZMoV564kxWCAg0 UKPk5XxHztzvbaJSHWbsLCJsTe1PitTJmgHDcMZcTY4DxDYiNlbpnryohxLT8ZZUvWd9enM/ g23
- Ironport-hdrordr: A9a23:kBSp9KN/xIpokcBcT1P155DYdb4zR+YMi2TDiHoddfUFSKalfp 6V98jztSWatN/eYgBDpTnmAtj7fZq8z+8P3WB1B9uftWbdyQ+Vxe1ZjbcKhgeQYhEWldQtqp uIDZIOb+EYZGIS5aia3OD7KadZ/DDuytHVuQ609QYJcegFUdAC0+8vYTzrb3GeCTM2TKYRJd 653I5qtjCgcXMYYoCSAWQEZfHKo5numIj9aRALKhY74E3W5AnYo4LSIly95FMzQjlPybAt/S zslBH43Lyqt7WexgXH32HewpxKkJ/Ky8dFBuaLls8JQw+cwjqAVcBEYfmvrTo1qOag5BIDl8 TNmQ4pO4BJ53bYbgiO0G/Q8jil9Axrx27pyFeej3emi9f+XigGB81Igp8cWgfF6mI71esMn5 5j7ia8jd56HBnAlCPy65zjTBdxjHe5pnIkjKo6k2Ffa40Dc7VcxLZvsH+9KK1wXR4S1bpXUN WHVKrnlbVrmBKhHj3kV1BUsZKRti9ZJGbFfqAA0vblpgS+0koJinfw//Zv70voxKhNNaWs2N 60QpiA7Is+KPP+TZgNc9vpEvHHfFAkf3r3QRGvCGWiMp07EFTwjLOyyIkJxYiRCe41Jd0J6d 78bG8=
- 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
|