linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] genirq/irqdomain: Make sure all irq domain flags are distinct
@ 2020-02-21  2:07 Zenghui Yu
  2020-02-21 10:13 ` Marc Zyngier
  2020-02-21 10:31 ` [tip: irq/urgent] " tip-bot2 for Zenghui Yu
  0 siblings, 2 replies; 4+ messages in thread
From: Zenghui Yu @ 2020-02-21  2:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: maz, tglx, wanghaibin.wang, 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")
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
---
 include/linux/irqdomain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index b2d47571ab67..8d062e86d954 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -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),
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] genirq/irqdomain: Make sure all irq domain flags are distinct
  2020-02-21  2:07 [PATCH] genirq/irqdomain: Make sure all irq domain flags are distinct Zenghui Yu
@ 2020-02-21 10:13 ` Marc Zyngier
  2020-02-24 11:30   ` Thomas Gleixner
  2020-02-21 10:31 ` [tip: irq/urgent] " tip-bot2 for Zenghui Yu
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2020-02-21 10:13 UTC (permalink / raw)
  To: Zenghui Yu; +Cc: linux-kernel, tglx, wanghaibin.wang

On 2020-02-21 02:07, Zenghui Yu wrote:
> 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")

> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
> ---
>  include/linux/irqdomain.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
> index b2d47571ab67..8d062e86d954 100644
> --- a/include/linux/irqdomain.h
> +++ b/include/linux/irqdomain.h
> @@ -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),

Acked-by: Marc Zyngier <maz@kernel.org>

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


         M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip: irq/urgent] genirq/irqdomain: Make sure all irq domain flags are distinct
  2020-02-21  2:07 [PATCH] genirq/irqdomain: Make sure all irq domain flags are distinct Zenghui Yu
  2020-02-21 10:13 ` Marc Zyngier
@ 2020-02-21 10:31 ` tip-bot2 for Zenghui Yu
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Zenghui Yu @ 2020-02-21 10:31 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Zenghui Yu, Thomas Gleixner, stable, x86, LKML

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 <yuzenghui@huawei.com>
AuthorDate:    Fri, 21 Feb 2020 10:07:25 +08:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
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")
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20200221020725.2038-1-yuzenghui@huawei.com
---
 include/linux/irqdomain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index b2d4757..8d062e8 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -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),

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] genirq/irqdomain: Make sure all irq domain flags are distinct
  2020-02-21 10:13 ` Marc Zyngier
@ 2020-02-24 11:30   ` Thomas Gleixner
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2020-02-24 11:30 UTC (permalink / raw)
  To: Marc Zyngier, Zenghui Yu; +Cc: linux-kernel, wanghaibin.wang

Marc Zyngier <maz@kernel.org> writes:
> On 2020-02-21 02:07, Zenghui Yu wrote:
>> 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 :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-24 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-21  2:07 [PATCH] genirq/irqdomain: Make sure all irq domain flags are distinct Zenghui Yu
2020-02-21 10:13 ` Marc Zyngier
2020-02-24 11:30   ` Thomas Gleixner
2020-02-21 10:31 ` [tip: irq/urgent] " tip-bot2 for Zenghui Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).