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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <625BA99ED14B2D499DC4E29D8138F1505C8ED7F7E3@shsmsx502.ccr.corp.intel.com>
Date:	Fri, 6 May 2011 14:43:56 +0800
From:	"Tian, Kevin" <kevin.tian@...el.com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"mingo@...hat.com" <mingo@...hat.com>,
	"hpa@...or.com" <hpa@...or.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>
CC:	Ian Campbell <Ian.Campbell@...citrix.com>,
	"JBeulich@...ell.com" <JBeulich@...ell.com>,
	"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>
Subject: [PATCH v2 2/2] x86: don't unmask disabled irqs when migrating them

x86: don't unmask disabled irqs when migrating them

it doesn't make sense to mask/unmask a disabled irq when migrating it
from offlined cpu to another, because it's not expected to handle
any instance of it. Current mask/set_affinity/unmask steps may trigger
unexpected instance on disabled irq which then simply bug on when there
is no handler for it. One failing example is observed in Xen. Xen pvops 
guest marks a special type of irqs as disabled, which are simply used 
as a notification mechanism to wake up blocked guest in event polling
state. Absolutely unmask them may cause the notification instance 
instead injected into the guest and then cause trouble.

Signed-off-by: Fengzhe Zhang <fengzhe.zhang@...el.com>
Signed-off-by: Kevin Tian <kevin.tian@...el.com>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: Ingo Molnar <mingo@...hat.com>
CC: H. Peter Anvin <hpa@...or.com>
CC: Ian Campbell <Ian.Campbell@...rix.com>
CC: Jan Beulich <JBeulich@...ell.com>

--- linux-2.6.39-rc6.orig/arch/x86/kernel/irq.c	2011-05-04 10:59:13.000000000 +0800
+++ linux-2.6.39-rc6/arch/x86/kernel/irq.c	2011-05-06 09:20:25.563963000 +0800
@@ -237,6 +237,7 @@ void fixup_irqs(void)
 	for_each_irq_desc(irq, desc) {
 		int break_affinity = 0;
 		int set_affinity = 1;
+		int do_mask;
 		const struct cpumask *affinity;
 
 		if (!desc)
@@ -268,7 +269,9 @@ void fixup_irqs(void)
 		}
 
 		chip = irq_data_get_irq_chip(data);
-		if (!irqd_can_move_in_process_context(data) && chip->irq_mask)
+		do_mask = !irqd_irq_disabled(data) &&
+			!irqd_can_move_in_process_context(data) && chip->irq_mask;
+		if (do_mask)
 			chip->irq_mask(data);
 
 		if (chip->irq_set_affinity)
@@ -276,7 +279,7 @@ void fixup_irqs(void)
 		else if (!(warned++))
 			set_affinity = 0;
 
-		if (!irqd_can_move_in_process_context(data) && chip->irq_unmask)
+		if (do_mask)
 			chip->irq_unmask(data);
 
 		raw_spin_unlock(&desc->lock);
--
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