History

Merge tag 'irq-core-2020-03-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq updates from Thomas Gleixner: "Updates for the interrupt subsystem: Treewide: - Cleanup of setup_irq() which is not longer required because the memory allocator is available early. Most cleanup changes come through the various maintainer trees, so the final removal of setup_irq() is postponed towards the end of the merge window. Core: - Protection against unsafe invocation of interrupt handlers and unsafe interrupt injection including a fixup of the offending PCI/AER error injection mechanism. Invoking interrupt handlers from arbitrary contexts, i.e. outside of an actual interrupt, can cause inconsistent state on the fragile x86 interrupt affinity changing hardware trainwreck. Drivers: - Second wave of support for the new ARM GICv4.1 - Multi-instance support for Xilinx and PLIC interrupt controllers - CPU-Hotplug support for PLIC - The obligatory new driver for X1000 TCU - Enhancements, cleanups and fixes all over the place" * tag 'irq-core-2020-03-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (58 commits) unicore32: Replace setup_irq() by request_irq() sh: Replace setup_irq() by request_irq() hexagon: Replace setup_irq() by request_irq() c6x: Replace setup_irq() by request_irq() alpha: Replace setup_irq() by request_irq() irqchip/gic-v4.1: Eagerly vmap vPEs irqchip/gic-v4.1: Add VSGI property setup irqchip/gic-v4.1: Add VSGI allocation/teardown irqchip/gic-v4.1: Move doorbell management to the GICv4 abstraction layer irqchip/gic-v4.1: Plumb set_vcpu_affinity SGI callbacks irqchip/gic-v4.1: Plumb get/set_irqchip_state SGI callbacks irqchip/gic-v4.1: Plumb mask/unmask SGI callbacks irqchip/gic-v4.1: Add initial SGI configuration irqchip/gic-v4.1: Plumb skeletal VSGI irqchip irqchip/stm32: Retrigger both in eoi and unmask callbacks irqchip/gic-v3: Move irq_domain_update_bus_token to after checking for NULL domain irqchip/xilinx: Do not call irq_set_default_host() irqchip/xilinx: Enable generic irq multi handler irqchip/xilinx: Fill error code when irq domain registration fails irqchip/xilinx: Add support for multiple instances ...

Linus Torvalds committed 6 years ago

Commit 2d385332 parents 673b41e 8a13b0264 files · +1185 −420Browse files

Showing the changes to include/linux (6 of 64 files). Show all

Unified · Split

6 files
  1. include/linux/cpuhotplug.h +1 −0
  2. include/linux/interrupt.h +2 −0
  3. include/linux/irq.h +13 −0
  4. include/linux/irqchip/arm-gic-common.h +2 −0
  5. include/linux/irqchip/arm-gic-v3.h +22 −1
  6. include/linux/irqchip/arm-gic-v4.h +23 −2
include/linux/cpuhotplug.h+1−0
@@ -102,6 +102,7 @@ enum cpuhp_state { · 101 unmodified lines
102102 CPUHP_AP_IRQ_ARMADA_XP_STARTING,
103103 CPUHP_AP_IRQ_BCM2836_STARTING,
104104 CPUHP_AP_IRQ_MIPS_GIC_STARTING,
105+ CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING,
105106 CPUHP_AP_ARM_MVEBU_COHERENCY,
106107 CPUHP_AP_MICROCODE_LOADER,
107108 CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING,
include/linux/interrupt.h+2−0
@@ -248,6 +248,8 @@ extern void enable_percpu_nmi(unsigned int irq, unsigned int type); · 247 unmodified lines
248248 extern int prepare_percpu_nmi(unsigned int irq);
249249 extern void teardown_percpu_nmi(unsigned int irq);
250250
251+extern int irq_inject_interrupt(unsigned int irq);
252+
251253 /* The following three functions are for the core kernel use only. */
252254 extern void suspend_device_irqs(void);
253255 extern void resume_device_irqs(void);
include/linux/irq.h+13−0
@@ -211,6 +211,8 @@ struct irq_data { · 210 unmodified lines
211211 * IRQD_CAN_RESERVE - Can use reservation mode
212212 * IRQD_MSI_NOMASK_QUIRK - Non-maskable MSI quirk for affinity change
213213 * required
214+ * IRQD_HANDLE_ENFORCE_IRQCTX - Enforce that handle_irq_*() is only invoked
215+ * from actual interrupt context.
214216 */
215217 enum {
216218 IRQD_TRIGGER_MASK = 0xf,
@@ -234,6 +236,7 @@ enum { · 17 unmodified lines
234236 IRQD_DEFAULT_TRIGGER_SET = (1 << 25),
235237 IRQD_CAN_RESERVE = (1 << 26),
236238 IRQD_MSI_NOMASK_QUIRK = (1 << 27),
239+ IRQD_HANDLE_ENFORCE_IRQCTX = (1 << 28),
237240 };
238241
239242 #define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
@@ -303,6 +306,16 @@ static inline bool irqd_is_single_target(struct irq_data *d) · 63 unmodified lines
303306 return __irqd_to_state(d) & IRQD_SINGLE_TARGET;
304307 }
305308
309+static inline void irqd_set_handle_enforce_irqctx(struct irq_data *d)
310+{
311+ __irqd_to_state(d) |= IRQD_HANDLE_ENFORCE_IRQCTX;
312+}
313+
314+static inline bool irqd_is_handle_enforce_irqctx(struct irq_data *d)
315+{
316+ return __irqd_to_state(d) & IRQD_HANDLE_ENFORCE_IRQCTX;
317+}
318+
306319 static inline bool irqd_is_wakeup_set(struct irq_data *d)
307320 {
308321 return __irqd_to_state(d) & IRQD_WAKEUP_STATE;
include/linux/irqchip/arm-gic-common.h+2−0
@@ -32,6 +32,8 @@ struct gic_kvm_info { · 31 unmodified lines
3232 struct resource vctrl;
3333 /* vlpi support */
3434 bool has_v4;
35+ /* rvpeid support */
36+ bool has_v4_1;
3537 };
3638
3739 const struct gic_kvm_info *gic_get_kvm_info(void);
include/linux/irqchip/arm-gic-v3.h+22−1
@@ -57,6 +57,7 @@ · 56 unmodified lines
5757 #define GICD_SPENDSGIR 0x0F20
5858
5959 #define GICD_CTLR_RWP (1U << 31)
60+#define GICD_CTLR_nASSGIreq (1U << 8)
6061 #define GICD_CTLR_DS (1U << 6)
6162 #define GICD_CTLR_ARE_NS (1U << 4)
6263 #define GICD_CTLR_ENABLE_G1A (1U << 1)
@@ -90,6 +91,7 @@ · 27 unmodified lines
9091 #define GICD_TYPER_ESPIS(typer) \
9192 (((typer) & GICD_TYPER_ESPI) ? GICD_TYPER_SPIS((typer) >> 27) : 0)
9293
94+#define GICD_TYPER2_nASSGIcap (1U << 8)
9395 #define GICD_TYPER2_VIL (1U << 7)
9496 #define GICD_TYPER2_VID GENMASK(4, 0)
9597
@@ -320,6 +322,9 @@ · 224 unmodified lines
320322 #define GICR_VPENDBASER_NonShareable \
321323 GIC_BASER_SHAREABILITY(GICR_VPENDBASER, NonShareable)
322324
325+#define GICR_VPENDBASER_InnerShareable \
326+ GIC_BASER_SHAREABILITY(GICR_VPENDBASER, InnerShareable)
327+
323328 #define GICR_VPENDBASER_nCnB GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, nCnB)
324329 #define GICR_VPENDBASER_nC GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, nC)
325330 #define GICR_VPENDBASER_RaWt GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, RaWt)
@@ -343,6 +348,15 @@ · 17 unmodified lines
343348 #define GICR_VPENDBASER_4_1_VGRP1EN (1ULL << 58)
344349 #define GICR_VPENDBASER_4_1_VPEID GENMASK_ULL(15, 0)
345350
351+#define GICR_VSGIR 0x0080
352+
353+#define GICR_VSGIR_VPEID GENMASK(15, 0)
354+
355+#define GICR_VSGIPENDR 0x0088
356+
357+#define GICR_VSGIPENDR_BUSY (1U << 31)
358+#define GICR_VSGIPENDR_PENDING GENMASK(15, 0)
359+
346360 /*
347361 * ITS registers, offsets from ITS_base
348362 */
@@ -366,6 +380,11 @@ · 17 unmodified lines
366380
367381 #define GITS_TRANSLATER 0x10040
368382
383+#define GITS_SGIR 0x20020
384+
385+#define GITS_SGIR_VPEID GENMASK_ULL(47, 32)
386+#define GITS_SGIR_VINTID GENMASK_ULL(3, 0)
387+
369388 #define GITS_CTLR_ENABLE (1U << 0)
370389 #define GITS_CTLR_ImDe (1U << 1)
371390 #define GITS_CTLR_ITS_NUMBER_SHIFT 4
@@ -500,8 +519,9 @@ · 128 unmodified lines
500519 #define GITS_CMD_VMAPTI GITS_CMD_GICv4(GITS_CMD_MAPTI)
501520 #define GITS_CMD_VMOVI GITS_CMD_GICv4(GITS_CMD_MOVI)
502521 #define GITS_CMD_VSYNC GITS_CMD_GICv4(GITS_CMD_SYNC)
503−/* VMOVP and INVDB are the odd ones, as they dont have a physical counterpart */
522+/* VMOVP, VSGI and INVDB are the odd ones, as they dont have a physical counterpart */
504523 #define GITS_CMD_VMOVP GITS_CMD_GICv4(2)
524+#define GITS_CMD_VSGI GITS_CMD_GICv4(3)
505525 #define GITS_CMD_INVDB GITS_CMD_GICv4(0xe)
506526
507527 /*
@@ -650,6 +670,7 @@ · 142 unmodified lines
650670
651671 struct rdists {
652672 struct {
673+ raw_spinlock_t rd_lock;
653674 void __iomem *rd_base;
654675 struct page *pend_page;
655676 phys_addr_t phys_base;
include/linux/irqchip/arm-gic-v4.h+23−2
@@ -49,10 +49,22 @@ struct its_vpe { · 48 unmodified lines
4949 };
5050 /* GICv4.1 implementations */
5151 struct {
52+ struct fwnode_handle *fwnode;
53+ struct irq_domain *sgi_domain;
54+ struct {
55+ u8 priority;
56+ bool enabled;
57+ bool group;
58+ } sgi_config[16];
5259 atomic_t vmapp_count;
5360 };
5461 };
5562
63+ /*
64+ * Ensures mutual exclusion between affinity setting of the
65+ * vPE and vLPI operations using vpe->col_idx.
66+ */
67+ raw_spinlock_t vpe_lock;
5668 /*
5769 * This collection ID is used to indirect the target
5870 * redistributor for this VPE. The ID itself isn't involved in
@@ -93,6 +105,7 @@ enum its_vcpu_info_cmd_type { · 34 unmodified lines
93105 SCHEDULE_VPE,
94106 DESCHEDULE_VPE,
95107 INVALL_VPE,
108+ PROP_UPDATE_VSGI,
96109 };
97110
98111 struct its_cmd_info {
@@ -105,19 +118,27 @@ struct its_cmd_info { · 6 unmodified lines
105118 bool g0en;
106119 bool g1en;
107120 };
121+ struct {
122+ u8 priority;
123+ bool group;
124+ };
108125 };
109126 };
110127
111128 int its_alloc_vcpu_irqs(struct its_vm *vm);
112129 void its_free_vcpu_irqs(struct its_vm *vm);
113−int its_schedule_vpe(struct its_vpe *vpe, bool on);
130+int its_make_vpe_resident(struct its_vpe *vpe, bool g0en, bool g1en);
131+int its_make_vpe_non_resident(struct its_vpe *vpe, bool db);
114132 int its_invall_vpe(struct its_vpe *vpe);
115133 int its_map_vlpi(int irq, struct its_vlpi_map *map);
116134 int its_get_vlpi(int irq, struct its_vlpi_map *map);
117135 int its_unmap_vlpi(int irq);
118136 int its_prop_update_vlpi(int irq, u8 config, bool inv);
137+int its_prop_update_vsgi(int irq, u8 priority, bool group);
119138
120139 struct irq_domain_ops;
121−int its_init_v4(struct irq_domain *domain, const struct irq_domain_ops *ops);
140+int its_init_v4(struct irq_domain *domain,
141+ const struct irq_domain_ops *vpe_ops,
142+ const struct irq_domain_ops *sgi_ops);
122143
123144 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t