lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190620091233.22731-1-lecopzer.chen@mediatek.com>
Date:   Thu, 20 Jun 2019 17:12:33 +0800
From:   Lecopzer Chen <lecopzer.chen@...iatek.com>
To:     <linux-kernel@...r.kernel.org>
CC:     <linux-arm-kernel@...ts.infradead.org>,
        Lecopzer Chen <lecopzer.chen@...iatek.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Marc Zyngier <marc.zyngier@....com>,
        Julien Thierry <julien.thierry@....com>,
        YJ Chiang <yj.chiang@...iatek.com>
Subject: [PATCH] genirq: Remove warning on preemptible in prepare_percpu_nmi()

prepare_percpu_nmi() acquires lock first by irq_get_desc_lock(),
no matter whether preempt enabled or not, acquiring lock forces preempt off.

This simplifies the usage of prepare_percpu_nmi() and we don't need to
acquire extra lock or explicitly call preempt_[disable,enable]().

Signed-off-by: Lecopzer Chen <lecopzer.chen@...iatek.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Marc Zyngier <marc.zyngier@....com>
Cc: Julien Thierry <julien.thierry@....com>
Cc: YJ Chiang <yj.chiang@...iatek.com>
Cc: Lecopzer Chen <lecopzer.chen@...iatek.com>
---
 kernel/irq/manage.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 78f3ddeb7fe4..aa03640cd7fb 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -2509,9 +2509,6 @@ int request_percpu_nmi(unsigned int irq, irq_handler_t handler,
  *	This call prepares an interrupt line to deliver NMI on the current CPU,
  *	before that interrupt line gets enabled with enable_percpu_nmi().
  *
- *	As a CPU local operation, this should be called from non-preemptible
- *	context.
- *
  *	If the interrupt line cannot be used to deliver NMIs, function
  *	will fail returning a negative value.
  */
@@ -2521,8 +2518,6 @@ int prepare_percpu_nmi(unsigned int irq)
 	struct irq_desc *desc;
 	int ret = 0;
 
-	WARN_ON(preemptible());
-
 	desc = irq_get_desc_lock(irq, &flags,
 				 IRQ_GET_DESC_CHECK_PERCPU);
 	if (!desc)
@@ -2554,17 +2549,12 @@ int prepare_percpu_nmi(unsigned int irq)
  *	This call undoes the setup done by prepare_percpu_nmi().
  *
  *	IRQ line should not be enabled for the current CPU.
- *
- *	As a CPU local operation, this should be called from non-preemptible
- *	context.
  */
 void teardown_percpu_nmi(unsigned int irq)
 {
 	unsigned long flags;
 	struct irq_desc *desc;
 
-	WARN_ON(preemptible());
-
 	desc = irq_get_desc_lock(irq, &flags,
 				 IRQ_GET_DESC_CHECK_PERCPU);
 	if (!desc)
-- 
2.18.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ