* [PATCH v5 for-4.19? 1/2] amend 'cmdline: document and enforce "extra_guest_irqs" upper bounds'
2024-07-03 8:43 [PATCH v5 for-4.19? 0/2] new extra_guest_irqs adjustment Jan Beulich
@ 2024-07-03 8:44 ` Jan Beulich
2024-07-03 8:47 ` Jan Beulich
2024-07-03 8:45 ` [PATCH v5 for-4.19? 2/2] cmdline: "extra_guest_irqs" is inapplicable to PVH Jan Beulich
2024-07-03 10:21 ` [PATCH v5 for-4.19? 0/2] new extra_guest_irqs adjustment Oleksii
2 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2024-07-03 8:44 UTC (permalink / raw)
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Wei Liu,
Roger Pau Monné, Oleksii Kurochko
Address late review comments for what is now commit 17f6d398f765:
- bound max_irqs right away against nr_irqs
- introduce a #define for a constant used twice
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v5: New.
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2663,15 +2663,16 @@ void __init ioapic_init(void)
unsigned int __hwdom_init arch_hwdom_irqs(const struct domain *d)
{
unsigned int n = fls(num_present_cpus());
- /* Bounded by the domain pirq EOI bitmap gfn. */
- const unsigned int max_irqs = PAGE_SIZE * BITS_PER_BYTE;
+ /* Bounding by the domain pirq EOI bitmap capacity. */
+ const unsigned int max_irqs = min_t(unsigned int, nr_irqs,
+ PAGE_SIZE * BITS_PER_BYTE);
if ( is_system_domain(d) )
return max_irqs;
if ( !d->domain_id )
n = min(n, dom0_max_vcpus());
- n = min(nr_irqs_gsi + n * NR_DYNAMIC_VECTORS, min(nr_irqs, max_irqs));
+ n = min(nr_irqs_gsi + n * NR_DYNAMIC_VECTORS, max_irqs);
printk("%pd has maximum %u PIRQs\n", d, n);
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -353,7 +353,8 @@ static int late_hwdom_init(struct domain
#ifdef CONFIG_HAS_PIRQ
static unsigned int __read_mostly extra_hwdom_irqs;
-static unsigned int __read_mostly extra_domU_irqs = 32;
+#define DEFAULT_EXTRA_DOMU_IRQS 32U
+static unsigned int __read_mostly extra_domU_irqs = DEFAULT_EXTRA_DOMU_IRQS;
static int __init cf_check parse_extra_guest_irqs(const char *s)
{
@@ -839,7 +840,8 @@ void __init setup_system_domains(void)
extra_hwdom_irqs = n - nr_static_irqs;
printk(XENLOG_WARNING "hwdom IRQs bounded to %u\n", n);
}
- if ( extra_domU_irqs > max(32U, n - nr_static_irqs) )
+ if ( extra_domU_irqs >
+ max(DEFAULT_EXTRA_DOMU_IRQS, n - nr_static_irqs) )
{
extra_domU_irqs = n - nr_static_irqs;
printk(XENLOG_WARNING "domU IRQs bounded to %u\n", n);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v5 for-4.19? 1/2] amend 'cmdline: document and enforce "extra_guest_irqs" upper bounds'
2024-07-03 8:44 ` [PATCH v5 for-4.19? 1/2] amend 'cmdline: document and enforce "extra_guest_irqs" upper bounds' Jan Beulich
@ 2024-07-03 8:47 ` Jan Beulich
2024-07-03 9:22 ` Roger Pau Monné
0 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2024-07-03 8:47 UTC (permalink / raw)
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Wei Liu,
Roger Pau Monné, Oleksii Kurochko
On 03.07.2024 10:44, Jan Beulich wrote:
> Address late review comments for what is now commit 17f6d398f765:
> - bound max_irqs right away against nr_irqs
> - introduce a #define for a constant used twice
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Actually should also have added
Requested-by: Roger Pau Monné <roger.pau@citrix.com>
above the S-o-b.
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v5 for-4.19? 1/2] amend 'cmdline: document and enforce "extra_guest_irqs" upper bounds'
2024-07-03 8:47 ` Jan Beulich
@ 2024-07-03 9:22 ` Roger Pau Monné
0 siblings, 0 replies; 7+ messages in thread
From: Roger Pau Monné @ 2024-07-03 9:22 UTC (permalink / raw)
To: Jan Beulich
Cc: xen-devel@lists.xenproject.org, Andrew Cooper, Julien Grall,
Stefano Stabellini, Wei Liu, Oleksii Kurochko
On Wed, Jul 03, 2024 at 10:47:36AM +0200, Jan Beulich wrote:
> On 03.07.2024 10:44, Jan Beulich wrote:
> > Address late review comments for what is now commit 17f6d398f765:
> > - bound max_irqs right away against nr_irqs
> > - introduce a #define for a constant used twice
> >
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> Actually should also have added
>
> Requested-by: Roger Pau Monné <roger.pau@citrix.com>
>
> above the S-o-b.
Sorry, didn't realize this was already committed.
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Thanks for addressing the comments!
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v5 for-4.19? 2/2] cmdline: "extra_guest_irqs" is inapplicable to PVH
2024-07-03 8:43 [PATCH v5 for-4.19? 0/2] new extra_guest_irqs adjustment Jan Beulich
2024-07-03 8:44 ` [PATCH v5 for-4.19? 1/2] amend 'cmdline: document and enforce "extra_guest_irqs" upper bounds' Jan Beulich
@ 2024-07-03 8:45 ` Jan Beulich
2024-07-03 9:23 ` Roger Pau Monné
2024-07-03 10:21 ` [PATCH v5 for-4.19? 0/2] new extra_guest_irqs adjustment Oleksii
2 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2024-07-03 8:45 UTC (permalink / raw)
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Wei Liu,
Roger Pau Monné, Oleksii Kurochko
PVH in particular has no (externally visible) notion of pIRQ-s. Mention
that in the description of the respective command line option and have
arch_hwdom_irqs() also reflect this (thus suppressing the log message
there as well, as being pretty meaningless in this case anyway).
Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v5: Remove has_pirq() check; update comment accordingly.
v4: New.
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1183,7 +1183,8 @@ versa. For example to change dom0 witho
hardware domain is architecture dependent. The upper limit for both values on
x86 is such that the resulting total number of IRQs can't be higher than 32768.
Note that specifying zero as domU value means zero, while for dom0 it means
-to use the default.
+to use the default. Note further that the Dom0 setting has no useful meaning
+for the PVH case; use of the option may have an adverse effect there, though.
### ext_regions (Arm)
> `= <boolean>`
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2670,6 +2670,10 @@ unsigned int __hwdom_init arch_hwdom_irq
if ( is_system_domain(d) )
return max_irqs;
+ /* PVH (generally: HVM) can't use PHYSDEVOP_pirq_eoi_gmfn_v{1,2}. */
+ if ( is_hvm_domain(d) )
+ return nr_irqs;
+
if ( !d->domain_id )
n = min(n, dom0_max_vcpus());
n = min(nr_irqs_gsi + n * NR_DYNAMIC_VECTORS, max_irqs);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v5 for-4.19? 2/2] cmdline: "extra_guest_irqs" is inapplicable to PVH
2024-07-03 8:45 ` [PATCH v5 for-4.19? 2/2] cmdline: "extra_guest_irqs" is inapplicable to PVH Jan Beulich
@ 2024-07-03 9:23 ` Roger Pau Monné
0 siblings, 0 replies; 7+ messages in thread
From: Roger Pau Monné @ 2024-07-03 9:23 UTC (permalink / raw)
To: Jan Beulich
Cc: xen-devel@lists.xenproject.org, Andrew Cooper, Julien Grall,
Stefano Stabellini, Wei Liu, Oleksii Kurochko
On Wed, Jul 03, 2024 at 10:45:41AM +0200, Jan Beulich wrote:
> PVH in particular has no (externally visible) notion of pIRQ-s. Mention
> that in the description of the respective command line option and have
> arch_hwdom_irqs() also reflect this (thus suppressing the log message
> there as well, as being pretty meaningless in this case anyway).
>
> Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Thanks, Roger.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v5 for-4.19? 0/2] new extra_guest_irqs adjustment
2024-07-03 8:43 [PATCH v5 for-4.19? 0/2] new extra_guest_irqs adjustment Jan Beulich
2024-07-03 8:44 ` [PATCH v5 for-4.19? 1/2] amend 'cmdline: document and enforce "extra_guest_irqs" upper bounds' Jan Beulich
2024-07-03 8:45 ` [PATCH v5 for-4.19? 2/2] cmdline: "extra_guest_irqs" is inapplicable to PVH Jan Beulich
@ 2024-07-03 10:21 ` Oleksii
2 siblings, 0 replies; 7+ messages in thread
From: Oleksii @ 2024-07-03 10:21 UTC (permalink / raw)
To: Jan Beulich, xen-devel@lists.xenproject.org
Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Wei Liu,
Roger Pau Monné
On Wed, 2024-07-03 at 10:43 +0200, Jan Beulich wrote:
> New patch 1 addresses late review comments raised by Roger for a
> change
> that was already committed.
>
> 1: amend 'cmdline: document and enforce "extra_guest_irqs" upper
> bounds'
> 2: cmdline: "extra_guest_irqs" is inapplicable to PVH
>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
~ Oleksii
^ permalink raw reply [flat|nested] 7+ messages in thread