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>] [day] [month] [year] [list]
Date:	Fri, 01 Feb 2013 20:05:14 +0800
From:	Chuansheng Liu <chuansheng.liu@...el.com>
To:	agordeev@...hat.com, yinghai@...nel.org, joerg.roedel@....com,
	suresh.b.siddha@...el.com, tglx@...utronix.de, mingo@...hat.com,
	hpa@...or.com
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org,
	chuansheng.liu@...el.com
Subject: [PATCH] x86/io_apic: Do not unmask the masked-irq when migrating
 irq in ack_apic_level()


In ack_apic_level(), when there is pending affinity setting for current irq,
ioapic_irqd_mask()/ioapic_irqd_unmask() will try to mask the irq and do the
irq affinity setting.

But at this time, it is possibility that the irq has been masked, in this case,
we should not unmask it directly in ioapic_irqd_unmask().

One real case is one threaded interrupt with ONE_SHOT, the irq has been masked in
handle_fasteoi_irq().

Signed-off-by: liu chuansheng <chuansheng.liu@...el.com>
---
 arch/x86/kernel/apic/io_apic.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b739d39..5c0fe25 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2429,7 +2429,8 @@ static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg)
 {
 	/* If we are moving the irq we need to mask it */
 	if (unlikely(irqd_is_setaffinity_pending(data))) {
-		mask_ioapic(cfg);
+		if (!irqd_irq_masked(data))
+			mask_ioapic(cfg);
 		return true;
 	}
 	return false;
@@ -2467,7 +2468,13 @@ static inline void ioapic_irqd_unmask(struct irq_data *data,
 		 */
 		if (!io_apic_level_ack_pending(cfg))
 			irq_move_masked_irq(data);
-		unmask_ioapic(cfg);
+		/*
+		 * For the threaded interrupt with ONE_SHOT flag,
+		 * the irq has been masked in handle_fasteoi_irq().
+		 * We should be careful not to unmask it here.
+		 */
+		if (!irqd_irq_masked(data))
+			unmask_ioapic(cfg);
 	}
 }
 #else
-- 
1.7.0.4



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ