Skip to content

Commit cc73437

Browse files
committed
Merge tag 'x86-irq-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 irq updates from Thomas Gleixner: "Surgery of the MSI interrupt handling to prepare the support of upcoming devices which require non-PCI based MSI handling: - Cleanup historical leftovers all over the place - Rework the code to utilize more core functionality - Wrap XEN PCI/MSI interrupts into an irqdomain to make irqdomain assignment to PCI devices possible. - Assign irqdomains to PCI devices at initialization time which allows to utilize the full functionality of hierarchical irqdomains. - Remove arch_.*_msi_irq() functions from X86 and utilize the irqdomain which is assigned to the device for interrupt management. - Make the arch_.*_msi_irq() support conditional on a config switch and let the last few users select it" * tag 'x86-irq-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (40 commits) PCI: MSI: Fix Kconfig dependencies for PCI_MSI_ARCH_FALLBACKS x86/apic/msi: Unbreak DMAR and HPET MSI iommu/amd: Remove domain search for PCI/MSI iommu/vt-d: Remove domain search for PCI/MSI[X] x86/irq: Make most MSI ops XEN private x86/irq: Cleanup the arch_*_msi_irqs() leftovers PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable x86/pci: Set default irq domain in pcibios_add_device() iommm/amd: Store irq domain in struct device iommm/vt-d: Store irq domain in struct device x86/xen: Wrap XEN MSI management into irqdomain irqdomain/msi: Allow to override msi_domain_alloc/free_irqs() x86/xen: Consolidate XEN-MSI init x86/xen: Rework MSI teardown x86/xen: Make xen_msi_init() static and rename it to xen_hvm_msi_init() PCI/MSI: Provide pci_dev_has_special_msi_domain() helper PCI_vmd_Mark_VMD_irqdomain_with_DOMAIN_BUS_VMD_MSI irqdomain/msi: Provide DOMAIN_BUS_VMD_MSI x86/irq: Initialize PCI/MSI domain at PCI init time x86/pci: Reducde #ifdeffery in PCI init code ...
2 parents c457cc8 + 981aa1d commit cc73437

44 files changed

Lines changed: 597 additions & 523 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

arch/ia64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ config IA64
5656
select NEED_DMA_MAP_STATE
5757
select NEED_SG_DMA_LENGTH
5858
select NUMA if !FLATMEM
59+
select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
5960
default y
6061
help
6162
The Itanium Processor Family is Intel's 64-bit successor to

arch/mips/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ config MIPS
8686
select MODULES_USE_ELF_REL if MODULES
8787
select MODULES_USE_ELF_RELA if MODULES && 64BIT
8888
select PERF_USE_VMALLOC
89+
select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
8990
select RTC_LIB
9091
select SYSCTL_EXCEPTION_TRACE
9192
select VIRT_TO_BUS

arch/powerpc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ config PPC
245245
select OLD_SIGACTION if PPC32
246246
select OLD_SIGSUSPEND
247247
select PCI_DOMAINS if PCI
248+
select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
248249
select PCI_SYSCALL if PCI
249250
select PPC_DAWR if PPC64
250251
select RTC_LIB

arch/s390/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ config S390
185185
select OLD_SIGSUSPEND3
186186
select PCI_DOMAINS if PCI
187187
select PCI_MSI if PCI
188+
select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
188189
select SPARSE_IRQ
189190
select SYSCTL_EXCEPTION_TRACE
190191
select THREAD_INFO_IN_TASK

arch/sparc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ config SPARC
4343
select GENERIC_STRNLEN_USER
4444
select MODULES_USE_ELF_RELA
4545
select PCI_SYSCALL if PCI
46+
select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
4647
select ODD_RT_SIGACTION
4748
select OLD_SIGSUSPEND
4849
select CPU_NO_EFFICIENT_FFS

arch/x86/include/asm/apic.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,14 @@ static inline bool apic_id_is_primary_thread(unsigned int id) { return false; }
519519
static inline void apic_smt_update(void) { }
520520
#endif
521521

522+
struct msi_msg;
523+
524+
#ifdef CONFIG_PCI_MSI
525+
void x86_vector_msi_compose_msg(struct irq_data *data, struct msi_msg *msg);
526+
#else
527+
# define x86_vector_msi_compose_msg NULL
528+
#endif
529+
522530
extern void ioapic_zap_locks(void);
523531

524532
#endif /* _ASM_X86_APIC_H */

arch/x86/include/asm/hw_irq.h

Lines changed: 42 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -36,61 +36,56 @@ struct msi_desc;
3636
enum irq_alloc_type {
3737
X86_IRQ_ALLOC_TYPE_IOAPIC = 1,
3838
X86_IRQ_ALLOC_TYPE_HPET,
39-
X86_IRQ_ALLOC_TYPE_MSI,
40-
X86_IRQ_ALLOC_TYPE_MSIX,
39+
X86_IRQ_ALLOC_TYPE_PCI_MSI,
40+
X86_IRQ_ALLOC_TYPE_PCI_MSIX,
4141
X86_IRQ_ALLOC_TYPE_DMAR,
4242
X86_IRQ_ALLOC_TYPE_UV,
43+
X86_IRQ_ALLOC_TYPE_IOAPIC_GET_PARENT,
44+
X86_IRQ_ALLOC_TYPE_HPET_GET_PARENT,
4345
};
4446

47+
struct ioapic_alloc_info {
48+
int pin;
49+
int node;
50+
u32 trigger : 1;
51+
u32 polarity : 1;
52+
u32 valid : 1;
53+
struct IO_APIC_route_entry *entry;
54+
};
55+
56+
struct uv_alloc_info {
57+
int limit;
58+
int blade;
59+
unsigned long offset;
60+
char *name;
61+
62+
};
63+
64+
/**
65+
* irq_alloc_info - X86 specific interrupt allocation info
66+
* @type: X86 specific allocation type
67+
* @flags: Flags for allocation tweaks
68+
* @devid: Device ID for allocations
69+
* @hwirq: Associated hw interrupt number in the domain
70+
* @mask: CPU mask for vector allocation
71+
* @desc: Pointer to msi descriptor
72+
* @data: Allocation specific data
73+
*
74+
* @ioapic: IOAPIC specific allocation data
75+
* @uv: UV specific allocation data
76+
*/
4577
struct irq_alloc_info {
4678
enum irq_alloc_type type;
4779
u32 flags;
48-
const struct cpumask *mask; /* CPU mask for vector allocation */
80+
u32 devid;
81+
irq_hw_number_t hwirq;
82+
const struct cpumask *mask;
83+
struct msi_desc *desc;
84+
void *data;
85+
4986
union {
50-
int unused;
51-
#ifdef CONFIG_HPET_TIMER
52-
struct {
53-
int hpet_id;
54-
int hpet_index;
55-
void *hpet_data;
56-
};
57-
#endif
58-
#ifdef CONFIG_PCI_MSI
59-
struct {
60-
struct pci_dev *msi_dev;
61-
irq_hw_number_t msi_hwirq;
62-
};
63-
#endif
64-
#ifdef CONFIG_X86_IO_APIC
65-
struct {
66-
int ioapic_id;
67-
int ioapic_pin;
68-
int ioapic_node;
69-
u32 ioapic_trigger : 1;
70-
u32 ioapic_polarity : 1;
71-
u32 ioapic_valid : 1;
72-
struct IO_APIC_route_entry *ioapic_entry;
73-
};
74-
#endif
75-
#ifdef CONFIG_DMAR_TABLE
76-
struct {
77-
int dmar_id;
78-
void *dmar_data;
79-
};
80-
#endif
81-
#ifdef CONFIG_X86_UV
82-
struct {
83-
int uv_limit;
84-
int uv_blade;
85-
unsigned long uv_offset;
86-
char *uv_name;
87-
};
88-
#endif
89-
#if IS_ENABLED(CONFIG_VMD)
90-
struct {
91-
struct msi_desc *desc;
92-
};
93-
#endif
87+
struct ioapic_alloc_info ioapic;
88+
struct uv_alloc_info uv;
9489
};
9590
};
9691

arch/x86/include/asm/irq_remapping.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ extern int irq_remapping_reenable(int);
4444
extern int irq_remap_enable_fault_handling(void);
4545
extern void panic_if_irq_remap(const char *msg);
4646

47-
extern struct irq_domain *
48-
irq_remapping_get_ir_irq_domain(struct irq_alloc_info *info);
4947
extern struct irq_domain *
5048
irq_remapping_get_irq_domain(struct irq_alloc_info *info);
5149

@@ -73,12 +71,6 @@ static inline void panic_if_irq_remap(const char *msg)
7371
{
7472
}
7573

76-
static inline struct irq_domain *
77-
irq_remapping_get_ir_irq_domain(struct irq_alloc_info *info)
78-
{
79-
return NULL;
80-
}
81-
8274
static inline struct irq_domain *
8375
irq_remapping_get_irq_domain(struct irq_alloc_info *info)
8476
{

arch/x86/include/asm/irqdomain.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ extern int mp_irqdomain_ioapic_idx(struct irq_domain *domain);
5151
#endif /* CONFIG_X86_IO_APIC */
5252

5353
#ifdef CONFIG_PCI_MSI
54-
extern void arch_init_msi_domain(struct irq_domain *domain);
54+
void x86_create_pci_msi_domain(void);
55+
struct irq_domain *native_create_pci_msi_domain(void);
56+
extern struct irq_domain *x86_pci_msi_default_domain;
5557
#else
56-
static inline void arch_init_msi_domain(struct irq_domain *domain) { }
58+
static inline void x86_create_pci_msi_domain(void) { }
59+
#define native_create_pci_msi_domain NULL
60+
#define x86_pci_msi_default_domain NULL
5761
#endif
5862

5963
#endif

arch/x86/include/asm/mpspec.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,11 @@ static inline void find_smp_config(void)
6767
#ifdef CONFIG_X86_MPPARSE
6868
extern void e820__memblock_alloc_reserved_mpc_new(void);
6969
extern int enable_update_mptable;
70-
extern int default_mpc_apic_id(struct mpc_cpu *m);
71-
extern void default_smp_read_mpc_oem(struct mpc_table *mpc);
72-
# ifdef CONFIG_X86_IO_APIC
73-
extern void default_mpc_oem_bus_info(struct mpc_bus *m, char *str);
74-
# else
75-
# define default_mpc_oem_bus_info NULL
76-
# endif
7770
extern void default_find_smp_config(void);
7871
extern void default_get_smp_config(unsigned int early);
7972
#else
8073
static inline void e820__memblock_alloc_reserved_mpc_new(void) { }
8174
#define enable_update_mptable 0
82-
#define default_mpc_apic_id NULL
83-
#define default_smp_read_mpc_oem NULL
84-
#define default_mpc_oem_bus_info NULL
8575
#define default_find_smp_config x86_init_noop
8676
#define default_get_smp_config x86_init_uint_noop
8777
#endif

0 commit comments

Comments
 (0)