Skip to contentSkip to conversation

genirq/irqdomain: Make sure all irq domain flags are distinct

PATCH Applied Zenghui Yu 4 participants 4 messages Feb 21, 2020 – Feb 24, 2020

Subsystems (2)
lore
Share & tools
lore

Zenghui Yu

author
#0 lore raw

PATCH 1/1 genirq/irqdomain: Make sure all irq domain flags are distinct

This was noticed when printing debugfs for MSIs on my ARM64 server. The new dstate IRQD_MSI_NOMASK_QUIRK came out surprisingly while it should only be the x86 stuff for the time being...

It's the overlap in irqdomain flags which leads to this confusion. (1 << 1) might be a good choice for old IRQ_DOMAIN_NAME_ALLOCATED, use it to avoid this overlap.

Fixes 6f1a4891a592 ("x86/apic/msi: Plug non-maskable MSI affinity race")
---
 include/linux/irqdomain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/irqdomain.h +1 -1
index b2d47571ab67..8d062e86d954 100644
@@ -192,7 +192,7 @@ enum {
 	IRQ_DOMAIN_FLAG_HIERARCHY	= (1 << 0),
 
 	/* Irq domain name was allocated in __irq_domain_add() */
-	IRQ_DOMAIN_NAME_ALLOCATED	= (1 << 6),
+	IRQ_DOMAIN_NAME_ALLOCATED	= (1 << 1),
 
 	/* Irq domain is an IPI domain with virq per cpu */
 	IRQ_DOMAIN_FLAG_IPI_PER_CPU	= (1 << 2),
Signature · 1 line
2.19.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Zenghui Yu

This was noticed when printing debugfs for MSIs on my ARM64 server. The new dstate IRQD_MSI_NOMASK_QUIRK came out surprisingly while it should only be the x86 stuff for the time being...

It's the overlap in irqdomain flags which leads to this confusion. (1 << 1) might be a good choice for old IRQ_DOMAIN_NAME_ALLOCATED, use it to avoid this overlap.

Fixes 6f1a4891a592 ("x86/apic/msi: Plug non-maskable MSI affinity race")

To be fair, the real source of the bug is this:

6a6544e520abe ("genirq/irqdomain: Remove auto-recursive hierarchy support")

Quoted 10 lines
---
 include/linux/irqdomain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/irqdomain.h +0 -0
index b2d47571ab67..8d062e86d954 100644

include/linux/irqdomain.h enum { · line 198

Quoted 8 lines
include/linux/irqdomain.h +1 -1
@@ -192,7 +192,7 @@ enum {
 	IRQ_DOMAIN_FLAG_HIERARCHY	= (1 << 0),
 
 	/* Irq domain name was allocated in __irq_domain_add() */
-	IRQ_DOMAIN_NAME_ALLOCATED	= (1 << 6),
+	IRQ_DOMAIN_NAME_ALLOCATED	= (1 << 1),
 
 	/* Irq domain is an IPI domain with virq per cpu */
 	IRQ_DOMAIN_FLAG_IPI_PER_CPU	= (1 << 2),

Thomas, do you mind picking this one up, as I don't have anything else for the time being?

        M.
Signature · 1 line
Jazz is not dead. It just smells funny...
#2 lore raw
Quoted 8 lines · Marc Zyngier
Quoted 2 lines · Zenghui Yu
Fixes 6f1a4891a592 ("x86/apic/msi: Plug non-maskable MSI affinity

race")

To be fair, the real source of the bug is this:

6a6544e520abe ("genirq/irqdomain: Remove auto-recursive hierarchy support")

Yes, but up to the MSI commit it was not a problem :)

merge bot Applied
#3 lore raw
In reply to Zenghui Yu
The following commit has been merged into the irq/urgent branch of tip:

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     2546287c5fb363a0165933ae2181c92f03e701d0
Gitweb:        https://git.kernel.org/tip/2546287c5fb363a0165933ae2181c92f03e701d0
Author:        Zenghui Yu <[email protected]>
AuthorDate:    Fri, 21 Feb 2020 10:07:25 +08:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Fri, 21 Feb 2020 11:29:15 +01:00

genirq/irqdomain: Make sure all irq domain flags are distinct

This was noticed when printing debugfs for MSIs on my ARM64 server. The new dstate IRQD_MSI_NOMASK_QUIRK came out surprisingly while it should only be the x86 stuff for the time being...

The new MSI quirk flag uses the same bit as IRQ_DOMAIN_NAME_ALLOCATED which is oddly defined as bit 6 for no good reason.

Switch it to the non used bit 1.

Fixes 6f1a4891a592 ("x86/apic/msi: Plug non-maskable MSI affinity race")
---
 include/linux/irqdomain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/irqdomain.h +1 -1
index b2d4757..8d062e8 100644
@@ -192,7 +192,7 @@ enum {
 	IRQ_DOMAIN_FLAG_HIERARCHY	= (1 << 0),
 
 	/* Irq domain name was allocated in __irq_domain_add() */
-	IRQ_DOMAIN_NAME_ALLOCATED	= (1 << 6),
+	IRQ_DOMAIN_NAME_ALLOCATED	= (1 << 1),
 
 	/* Irq domain is an IPI domain with virq per cpu */
 	IRQ_DOMAIN_FLAG_IPI_PER_CPU	= (1 << 2),