* [patch 0/2] genirq: Make interrupt context enforcing work unconditionally
@ 2024-12-10 10:20 Thomas Gleixner
2024-12-10 10:20 ` [patch 1/2] genirq: Make handle_enforce_irqctx() unconditionally available Thomas Gleixner
2024-12-10 10:20 ` [patch 2/2] genirq: Remove handle_enforce_irqctx() wrapper Thomas Gleixner
0 siblings, 2 replies; 5+ messages in thread
From: Thomas Gleixner @ 2024-12-10 10:20 UTC (permalink / raw)
To: LKML; +Cc: Marc Zyngier, Valentin Schneider
While looking at GENERIC_PENDING_IRQ I stumbled over the fact, that the
interrupt context enforcement for ARM[64] which was attempted by
commit 1b57d91b969c ("irqchip/gic-v2, v3: Prevent SW resends entirely")
actually never worked because handle_enforce_irqctx() is a wrapper around
the actual check and that wrapper is only providing the informatuib when
GENERIC_PENDING_IRQ is set. That's not the case for ARM[64].
Make it available unconditionally and clean up the now pointless wrapper.
Thanks,
tglx
---
internals.h | 8 --------
irqdesc.c | 2 +-
resend.c | 2 +-
3 files changed, 2 insertions(+), 10 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread* [patch 1/2] genirq: Make handle_enforce_irqctx() unconditionally available
2024-12-10 10:20 [patch 0/2] genirq: Make interrupt context enforcing work unconditionally Thomas Gleixner
@ 2024-12-10 10:20 ` Thomas Gleixner
2025-01-15 10:04 ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2024-12-10 10:20 ` [patch 2/2] genirq: Remove handle_enforce_irqctx() wrapper Thomas Gleixner
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2024-12-10 10:20 UTC (permalink / raw)
To: LKML; +Cc: Marc Zyngier, Valentin Schneider
Commit 1b57d91b969c ("irqchip/gic-v2, v3: Prevent SW resends entirely")
sett the flag which enforces interrupt handling in interrupt context and
prevents software base resends for ARM GIC v2/v3.
But it missed that the helper function which checks the flag was hidden
behind CONFIG_GENERIC_PENDING_IRQ, which is not set by ARM[64].
Make the helper unconditionally available so that the enforcement actually
works.
Fixes: 1b57d91b969c ("irqchip/gic-v2, v3: Prevent SW resends entirely")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Valentin Schneider <vschneid@redhat.com>
---
kernel/irq/internals.h | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -441,10 +441,6 @@ static inline struct cpumask *irq_desc_g
{
return desc->pending_mask;
}
-static inline bool handle_enforce_irqctx(struct irq_data *data)
-{
- return irqd_is_handle_enforce_irqctx(data);
-}
bool irq_fixup_move_pending(struct irq_desc *desc, bool force_clear);
#else /* CONFIG_GENERIC_PENDING_IRQ */
static inline bool irq_can_move_pcntxt(struct irq_data *data)
@@ -471,11 +467,12 @@ static inline bool irq_fixup_move_pendin
{
return false;
}
+#endif /* !CONFIG_GENERIC_PENDING_IRQ */
+
static inline bool handle_enforce_irqctx(struct irq_data *data)
{
- return false;
+ return irqd_is_handle_enforce_irqctx(data);
}
-#endif /* !CONFIG_GENERIC_PENDING_IRQ */
#if !defined(CONFIG_IRQ_DOMAIN) || !defined(CONFIG_IRQ_DOMAIN_HIERARCHY)
static inline int irq_domain_activate_irq(struct irq_data *data, bool reserve)
^ permalink raw reply [flat|nested] 5+ messages in thread* [tip: irq/core] genirq: Make handle_enforce_irqctx() unconditionally available
2024-12-10 10:20 ` [patch 1/2] genirq: Make handle_enforce_irqctx() unconditionally available Thomas Gleixner
@ 2025-01-15 10:04 ` tip-bot2 for Thomas Gleixner
0 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Thomas Gleixner @ 2025-01-15 10:04 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Thomas Gleixner, x86, linux-kernel, maz
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 8d187a77f04c14fb459a5301d69f733a5a1396bc
Gitweb: https://git.kernel.org/tip/8d187a77f04c14fb459a5301d69f733a5a1396bc
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 10 Dec 2024 11:20:43 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 15 Jan 2025 10:56:21 +01:00
genirq: Make handle_enforce_irqctx() unconditionally available
Commit 1b57d91b969c ("irqchip/gic-v2, v3: Prevent SW resends entirely")
sett the flag which enforces interrupt handling in interrupt context and
prevents software base resends for ARM GIC v2/v3.
But it missed that the helper function which checks the flag was hidden
behind CONFIG_GENERIC_PENDING_IRQ, which is not set by ARM[64].
Make the helper unconditionally available so that the enforcement actually
works.
Fixes: 1b57d91b969c ("irqchip/gic-v2, v3: Prevent SW resends entirely")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20241210101811.497716609@linutronix.de
---
kernel/irq/internals.h | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index fe0272c..a29df4b 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -441,10 +441,6 @@ static inline struct cpumask *irq_desc_get_pending_mask(struct irq_desc *desc)
{
return desc->pending_mask;
}
-static inline bool handle_enforce_irqctx(struct irq_data *data)
-{
- return irqd_is_handle_enforce_irqctx(data);
-}
bool irq_fixup_move_pending(struct irq_desc *desc, bool force_clear);
#else /* CONFIG_GENERIC_PENDING_IRQ */
static inline bool irq_can_move_pcntxt(struct irq_data *data)
@@ -471,11 +467,12 @@ static inline bool irq_fixup_move_pending(struct irq_desc *desc, bool fclear)
{
return false;
}
+#endif /* !CONFIG_GENERIC_PENDING_IRQ */
+
static inline bool handle_enforce_irqctx(struct irq_data *data)
{
- return false;
+ return irqd_is_handle_enforce_irqctx(data);
}
-#endif /* !CONFIG_GENERIC_PENDING_IRQ */
#if !defined(CONFIG_IRQ_DOMAIN) || !defined(CONFIG_IRQ_DOMAIN_HIERARCHY)
static inline int irq_domain_activate_irq(struct irq_data *data, bool reserve)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch 2/2] genirq: Remove handle_enforce_irqctx() wrapper
2024-12-10 10:20 [patch 0/2] genirq: Make interrupt context enforcing work unconditionally Thomas Gleixner
2024-12-10 10:20 ` [patch 1/2] genirq: Make handle_enforce_irqctx() unconditionally available Thomas Gleixner
@ 2024-12-10 10:20 ` Thomas Gleixner
2025-01-15 10:04 ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2024-12-10 10:20 UTC (permalink / raw)
To: LKML; +Cc: Marc Zyngier, Valentin Schneider
Now that it is unconditionally available, remove the wrapper.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/irq/internals.h | 5 -----
kernel/irq/irqdesc.c | 2 +-
kernel/irq/resend.c | 2 +-
3 files changed, 2 insertions(+), 7 deletions(-)
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -469,11 +469,6 @@ static inline bool irq_fixup_move_pendin
}
#endif /* !CONFIG_GENERIC_PENDING_IRQ */
-static inline bool handle_enforce_irqctx(struct irq_data *data)
-{
- return irqd_is_handle_enforce_irqctx(data);
-}
-
#if !defined(CONFIG_IRQ_DOMAIN) || !defined(CONFIG_IRQ_DOMAIN_HIERARCHY)
static inline int irq_domain_activate_irq(struct irq_data *data, bool reserve)
{
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -708,7 +708,7 @@ int handle_irq_desc(struct irq_desc *des
return -EINVAL;
data = irq_desc_get_irq_data(desc);
- if (WARN_ON_ONCE(!in_hardirq() && handle_enforce_irqctx(data)))
+ if (WARN_ON_ONCE(!in_hardirq() && irqd_is_handle_enforce_irqctx(data)))
return -EPERM;
generic_handle_irq_desc(desc);
--- a/kernel/irq/resend.c
+++ b/kernel/irq/resend.c
@@ -53,7 +53,7 @@ static int irq_sw_resend(struct irq_desc
* Validate whether this interrupt can be safely injected from
* non interrupt context
*/
- if (handle_enforce_irqctx(&desc->irq_data))
+ if (irqd_is_handle_enforce_irqctx(&desc->irq_data))
return -EINVAL;
/*
^ permalink raw reply [flat|nested] 5+ messages in thread* [tip: irq/core] genirq: Remove handle_enforce_irqctx() wrapper
2024-12-10 10:20 ` [patch 2/2] genirq: Remove handle_enforce_irqctx() wrapper Thomas Gleixner
@ 2025-01-15 10:04 ` tip-bot2 for Thomas Gleixner
0 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Thomas Gleixner @ 2025-01-15 10:04 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Thomas Gleixner, x86, linux-kernel, maz
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 9620301cc27f6dc6197236a55a44fac8e64be0a1
Gitweb: https://git.kernel.org/tip/9620301cc27f6dc6197236a55a44fac8e64be0a1
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 10 Dec 2024 11:20:45 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 15 Jan 2025 10:56:22 +01:00
genirq: Remove handle_enforce_irqctx() wrapper
Now that it is unconditionally available, remove the wrapper.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20241210101811.561078243@linutronix.de
---
kernel/irq/internals.h | 5 -----
kernel/irq/irqdesc.c | 2 +-
kernel/irq/resend.c | 2 +-
3 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index a29df4b..b61fc64 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -469,11 +469,6 @@ static inline bool irq_fixup_move_pending(struct irq_desc *desc, bool fclear)
}
#endif /* !CONFIG_GENERIC_PENDING_IRQ */
-static inline bool handle_enforce_irqctx(struct irq_data *data)
-{
- return irqd_is_handle_enforce_irqctx(data);
-}
-
#if !defined(CONFIG_IRQ_DOMAIN) || !defined(CONFIG_IRQ_DOMAIN_HIERARCHY)
static inline int irq_domain_activate_irq(struct irq_data *data, bool reserve)
{
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 0253e77..2878307 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -708,7 +708,7 @@ int handle_irq_desc(struct irq_desc *desc)
return -EINVAL;
data = irq_desc_get_irq_data(desc);
- if (WARN_ON_ONCE(!in_hardirq() && handle_enforce_irqctx(data)))
+ if (WARN_ON_ONCE(!in_hardirq() && irqd_is_handle_enforce_irqctx(data)))
return -EPERM;
generic_handle_irq_desc(desc);
diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c
index b07a2d7..1b7fa72 100644
--- a/kernel/irq/resend.c
+++ b/kernel/irq/resend.c
@@ -53,7 +53,7 @@ static int irq_sw_resend(struct irq_desc *desc)
* Validate whether this interrupt can be safely injected from
* non interrupt context
*/
- if (handle_enforce_irqctx(&desc->irq_data))
+ if (irqd_is_handle_enforce_irqctx(&desc->irq_data))
return -EINVAL;
/*
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-01-15 10:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-10 10:20 [patch 0/2] genirq: Make interrupt context enforcing work unconditionally Thomas Gleixner
2024-12-10 10:20 ` [patch 1/2] genirq: Make handle_enforce_irqctx() unconditionally available Thomas Gleixner
2025-01-15 10:04 ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2024-12-10 10:20 ` [patch 2/2] genirq: Remove handle_enforce_irqctx() wrapper Thomas Gleixner
2025-01-15 10:04 ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®