Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbcf9574 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

x86/uv: Use default_cpu_mask_to_apicid_and()



Same functionality except the extra bits ored on the apicid.

Signed-off-by: default avatarThomas 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
parent ad95212e
Loading
Loading
Loading
Loading
+4 −15
Original line number Original line Diff line number Diff line
@@ -530,23 +530,12 @@ uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
			  const struct cpumask *andmask,
			  const struct cpumask *andmask,
			  unsigned int *apicid)
			  unsigned int *apicid)
{
{
	int unsigned cpu;
	int ret = default_cpu_mask_to_apicid_and(cpumask, andmask, apicid);


	/*
	if (!ret)
	 * We're using fixed IRQ delivery, can only return one phys APIC ID.
		*apicid |= uv_apicid_hibits;
	 * 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)) {
	return ret;
		*apicid = per_cpu(x86_cpu_to_apicid, cpu) | uv_apicid_hibits;
		return 0;
	}

	return -EINVAL;
}
}


static unsigned int x2apic_get_apic_id(unsigned long x)
static unsigned int x2apic_get_apic_id(unsigned long x)