Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1670059 > unrolled thread

[patch 41/55] x86/uv: Use default_cpu_mask_to_apicid_and()

Started byThomas Gleixner <tglx@linutronix.de>
First post2017-06-20 02:10 +0200
Last post2017-06-22 19:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [patch 41/55] x86/uv: Use default_cpu_mask_to_apicid_and() Thomas Gleixner <tglx@linutronix.de> - 2017-06-20 02:10 +0200
    [tip:irq/core] x86/uv: Use default_cpu_mask_to_apicid_and() tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-06-22 19:10 +0200

#1670059 — [patch 41/55] x86/uv: Use default_cpu_mask_to_apicid_and()

FromThomas Gleixner <tglx@linutronix.de>
Date2017-06-20 02:10 +0200
Subject[patch 41/55] x86/uv: Use default_cpu_mask_to_apicid_and()
Message-ID<tUeU1-1fU-5@gated-at.bofh.it>
Same functionality except the extra bits ored on the apicid.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/apic/x2apic_uv_x.c |   19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -530,23 +530,12 @@ uv_cpu_mask_to_apicid_and(const struct c
 			  const struct cpumask *andmask,
 			  unsigned int *apicid)
 {
-	int unsigned cpu;
+	int ret = default_cpu_mask_to_apicid_and(cpumask, andmask, apicid);
 
-	/*
-	 * We're using fixed IRQ delivery, can only return one phys APIC ID.
-	 * May as well be the first.
-	 */
-	for_each_cpu_and(cpu, cpumask, andmask) {
-		if (cpumask_test_cpu(cpu, cpu_online_mask))
-			break;
-	}
+	if (!ret)
+		*apicid |= uv_apicid_hibits;
 
-	if (likely(cpu < nr_cpu_ids)) {
-		*apicid = per_cpu(x86_cpu_to_apicid, cpu) | uv_apicid_hibits;
-		return 0;
-	}
-
-	return -EINVAL;
+	return ret;
 }
 
 static unsigned int x2apic_get_apic_id(unsigned long x)

[toc] | [next] | [standalone]


#1672864 — [tip:irq/core] x86/uv: Use default_cpu_mask_to_apicid_and()

Fromtip-bot for Thomas Gleixner <tipbot@zytor.com>
Date2017-06-22 19:10 +0200
Subject[tip:irq/core] x86/uv: Use default_cpu_mask_to_apicid_and()
Message-ID<tVdMe-7Ei-31@gated-at.bofh.it>
In reply to#1670059
Commit-ID:  bbcf9574bc6fb85d22f2718d48da7f98830a7870
Gitweb:     http://git.kernel.org/tip/bbcf9574bc6fb85d22f2718d48da7f98830a7870
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 20 Jun 2017 01:37:41 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 22 Jun 2017 18:21:21 +0200

x86/uv: Use default_cpu_mask_to_apicid_and()

Same functionality except the extra bits ored on the apicid.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/20170619235446.482841015@linutronix.de

---
 arch/x86/kernel/apic/x2apic_uv_x.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index b487b3a..fd5bb20 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -530,23 +530,12 @@ uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
 			  const struct cpumask *andmask,
 			  unsigned int *apicid)
 {
-	int unsigned cpu;
+	int ret = default_cpu_mask_to_apicid_and(cpumask, andmask, apicid);
 
-	/*
-	 * We're using fixed IRQ delivery, can only return one phys APIC ID.
-	 * May as well be the first.
-	 */
-	for_each_cpu_and(cpu, cpumask, andmask) {
-		if (cpumask_test_cpu(cpu, cpu_online_mask))
-			break;
-	}
-
-	if (likely(cpu < nr_cpu_ids)) {
-		*apicid = per_cpu(x86_cpu_to_apicid, cpu) | uv_apicid_hibits;
-		return 0;
-	}
+	if (!ret)
+		*apicid |= uv_apicid_hibits;
 
-	return -EINVAL;
+	return ret;
 }
 
 static unsigned int x2apic_get_apic_id(unsigned long x)

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web