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: <1409131832-11317-1-git-send-email-byungchul.park@lge.com>
Date:	Wed, 27 Aug 2014 18:30:32 +0900
From:	byungchul.park@....com
To:	will.deacon@....com
Cc:	sudeep.holla@....com, catalin.marinas@....com,
	linux-kernel@...r.kernel.org,
	Byungchul Park <byungchul.park@....com>
Subject: [PATCH 2/2] arm64: take onlined cpus into account when setting irq affinity in migrate_one_irq

From: Byungchul Park <byungchul.park@....com>

This patch ensures that the cpu being offlined is not present in the affinity mask.

Signed-off-by: Byungchul Park <byungchul.park@....com>
---
 arch/arm64/kernel/irq.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/kernel/irq.c b/arch/arm64/kernel/irq.c
index 473e5db..0c7b79e 100644
--- a/arch/arm64/kernel/irq.c
+++ b/arch/arm64/kernel/irq.c
@@ -87,6 +87,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
 {
 	struct irq_data *d = irq_desc_get_irq_data(desc);
 	const struct cpumask *affinity = d->affinity;
+	struct cpumask tmp_affinity;
 	struct irq_chip *c;
 	bool ret = false;
 
@@ -100,6 +101,14 @@ static bool migrate_one_irq(struct irq_desc *desc)
 	if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
 		affinity = cpu_online_mask;
 		ret = true;
+	} else {
+		/*
+		 * when using forced irq_set_affinity we must ensure that the cpu
+		 * being offlined is not present in the affinity mask, it may be
+		 * selected as the target CPU otherwise
+		 */
+		cpumask_and(&tmp_affinity, affinity, cpu_online_mask);
+		affinity = &tmp_affinity;
 	}
 
 	c = irq_data_get_irq_chip(d);
-- 
1.7.9.5

--
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