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

Re: [PATCH v2 3/6] x86/setup: init nr_irqs after having detected x2APIC support


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 5 Jul 2022 15:35:19 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=kpdN2iSuPLfZw0yb6nsx8h0cV09fOyx50ifL7ES5vMs=; b=esJW5BsFWWIIkw5VFNDSCTtfhECIHdIARUiVXn5epG9oaZSK3382nqSZ4FOFn4qX21jyKoJSmhAtKBoV5i1KcyrJ3byrEvAH26j1VQcFIb9Jn1jmLUb0c9Ul+OlIrL9jymY+zPrLKXQzfP0O6hFfyCyaiCANe5x1cclyDv5nVsA7qMOkB7eBhVjwmHLfa4uhdD+3d3/kKcWyk+bK8Jm1s34akVWUdv/Yys3JK9DW7bpSi9jOgH4WMwGCBfGTWlc9vvg0rtv/Z1Gn2JYqFG5UivRL5gOQQe3krdX6zFLgbtftetYXxO4C6Gn1gh6mtiCxpliQxYnMOLp9uel6acotoQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kcb1quNf7/GmF/oeIXgBio3Qhrr6B9rrpNocPHqBQNpc1hq8DyaQVVfGulhMNDwXLr07vzrYbuI3lK3xszjWvC9iClWdioJiaASocqLM7NLw/sSXDdXf2z6FtvI02oXM9dRTVyBIzoh5LCS7Z15y5yeq9bk/hEJVF9RqaC4qgCpxuCGOIMt11EfcbH1eRx18aaH1hGczH19HEXiaXoskShVTWyHelH/zVZIpvrVTx4YhrviDYN1RV5pquMI/s78Jukez5zj1upQsthAr3T3IfmamXe3QbGpIWTs049Skt5Rfx0DNJQkCpZS2NnLxP4GGdCgobVNldpFQZ/vDcqZ5Sg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 05 Jul 2022 13:35:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.06.2022 10:54, Roger Pau Monne wrote:
> 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.

"requires" reads as if this was the case already, which I don't think
is true. The dependency likely appears with the next patch (didn't
look there, yet).

> --- 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)
> --- 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;

Splitting a function argument across lines and then putting the next
argument on the same line is, well, confusing. May I suggest to either
stick to the original line splitting or to go to

    if ( nr_irqs == 0 )
        nr_irqs = cpu_has_apic
                  ? max(0U + num_present_cpus() * NR_DYNAMIC_VECTORS,
                        8 * nr_irqs_gsi)
                  : nr_irqs_gsi;

?

Jan



 


Rackspace

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