mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
have architectures specify the number of PIRQs a hardware domain gets
The current value of nr_static_irqs + 256 is often too small for larger systems. Make it dependent on CPU count and number of IO-APIC pins on x86, and (until it obtains PCI support) simply NR_IRQS on ARM. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Release-Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle.com>
This commit is contained in:
1 parent
4ef6b5f16c
commit
7e73a6e7f1
7 files changed
+36
-7
No files matched your search
@@ -596,13 +596,16 @@ Force or disable use of EFI runtime services.
|
||||
### extra\_guest\_irqs
|
||||
> `= [<domU number>][,<dom0 number>]`
|
||||
|
||||
> Default: `32,256`
|
||||
> Default: `32,<variable>`
|
||||
|
||||
Change the number of PIRQs available for guests. The optional first number is
|
||||
common for all domUs, while the optional second number (preceded by a comma)
|
||||
is for dom0. Changing the setting for domU has no impact on dom0 and vice
|
||||
versa. For example to change dom0 without changing domU, use
|
||||
`extra_guest_irqs=,512`
|
||||
`extra_guest_irqs=,512`. The default value for Dom0 and an eventual separate
|
||||
hardware domain is architecture dependent.
|
||||
Note that specifying zero as domU value means zero, while for dom0 it means
|
||||
to use the default.
|
||||
|
||||
### flask\_enabled
|
||||
> `= <integer>`
|
||||
|
||||
@@ -101,7 +101,7 @@ static void __init parse_dom0_max_vcpus(const char *s)
|
||||
}
|
||||
custom_param("dom0_max_vcpus", parse_dom0_max_vcpus);
|
||||
|
||||
struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0)
|
||||
unsigned int __init dom0_max_vcpus(void)
|
||||
{
|
||||
unsigned max_vcpus;
|
||||
|
||||
@@ -113,6 +113,13 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0)
|
||||
if ( max_vcpus > MAX_VIRT_CPUS )
|
||||
max_vcpus = MAX_VIRT_CPUS;
|
||||
|
||||
return max_vcpus;
|
||||
}
|
||||
|
||||
struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0)
|
||||
{
|
||||
unsigned int max_vcpus = dom0_max_vcpus();
|
||||
|
||||
dom0->vcpu = xzalloc_array(struct vcpu *, max_vcpus);
|
||||
if ( !dom0->vcpu )
|
||||
return NULL;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <asm/smp.h>
|
||||
#include <asm/desc.h>
|
||||
#include <asm/msi.h>
|
||||
#include <asm/setup.h>
|
||||
#include <mach_apic.h>
|
||||
#include <io_ports.h>
|
||||
#include <public/physdev.h>
|
||||
@@ -2606,3 +2607,14 @@ void __init init_ioapic_mappings(void)
|
||||
nr_irqs_gsi, nr_irqs - nr_irqs_gsi);
|
||||
}
|
||||
|
||||
unsigned int arch_hwdom_irqs(domid_t domid)
|
||||
{
|
||||
unsigned int n = fls(num_present_cpus());
|
||||
|
||||
if ( !domid )
|
||||
n = min(n, dom0_max_vcpus());
|
||||
n = min(nr_irqs_gsi + n * NR_DYNAMIC_VECTORS, nr_irqs);
|
||||
printk("Dom%d has maximum %u PIRQs\n", domid, n);
|
||||
|
||||
return n;
|
||||
}
|
||||
+4
-3
@@ -231,14 +231,14 @@ static int late_hwdom_init(struct domain *d)
|
||||
#endif
|
||||
}
|
||||
|
||||
static unsigned int __read_mostly extra_dom0_irqs = 256;
|
||||
static unsigned int __read_mostly extra_hwdom_irqs;
|
||||
static unsigned int __read_mostly extra_domU_irqs = 32;
|
||||
static void __init parse_extra_guest_irqs(const char *s)
|
||||
{
|
||||
if ( isdigit(*s) )
|
||||
extra_domU_irqs = simple_strtoul(s, &s, 0);
|
||||
if ( *s == ',' && isdigit(*++s) )
|
||||
extra_dom0_irqs = simple_strtoul(s, &s, 0);
|
||||
extra_hwdom_irqs = simple_strtoul(s, &s, 0);
|
||||
}
|
||||
custom_param("extra_guest_irqs", parse_extra_guest_irqs);
|
||||
|
||||
@@ -326,7 +326,8 @@ struct domain *domain_create(
|
||||
if ( !is_hardware_domain(d) )
|
||||
d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
|
||||
else
|
||||
d->nr_pirqs = nr_static_irqs + extra_dom0_irqs;
|
||||
d->nr_pirqs = extra_hwdom_irqs ? nr_static_irqs + extra_hwdom_irqs
|
||||
: arch_hwdom_irqs(domid);
|
||||
if ( d->nr_pirqs > nr_irqs )
|
||||
d->nr_pirqs = nr_irqs;
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ struct arch_irq_desc {
|
||||
|
||||
#define NR_LOCAL_IRQS 32
|
||||
#define NR_IRQS 1024
|
||||
#define nr_irqs NR_IRQS
|
||||
|
||||
#define nr_irqs NR_IRQS
|
||||
#define nr_static_irqs NR_IRQS
|
||||
#define arch_hwdom_irqs(domid) NR_IRQS
|
||||
|
||||
struct irq_desc;
|
||||
struct irqaction;
|
||||
|
||||
@@ -35,6 +35,8 @@ int construct_dom0(
|
||||
unsigned long initial_images_nrpages(void);
|
||||
void discard_initial_images(void);
|
||||
|
||||
unsigned int dom0_max_vcpus(void);
|
||||
|
||||
int xen_in_range(unsigned long mfn);
|
||||
|
||||
void microcode_grab_module(
|
||||
|
||||
@@ -168,4 +168,8 @@ static inline void set_native_irq_info(unsigned int irq, const cpumask_t *mask)
|
||||
|
||||
unsigned int set_desc_affinity(struct irq_desc *, const cpumask_t *);
|
||||
|
||||
#ifndef arch_hwdom_irqs
|
||||
unsigned int arch_hwdom_irqs(domid_t);
|
||||
#endif
|
||||
|
||||
#endif /* __XEN_IRQ_H__ */
|
||||