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

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

x86/apic: Remove unused callbacks



Now that the old allocator is gone, these apic functions are unused. Remove
them.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarJuergen Gross <jgross@suse.com>
Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
Acked-by: default avatarJuergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Alok Kataria <akataria@vmware.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Rui Zhang <rui.zhang@intel.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Len Brown <lenb@kernel.org>
Link: https://lkml.kernel.org/r/20170913213155.524662349@linutronix.de
parent 69cde000
Loading
Loading
Loading
Loading
+0 −48
Original line number Diff line number Diff line
@@ -11,64 +11,16 @@ u32 apic_default_calc_apicid(unsigned int cpu)
	return per_cpu(x86_cpu_to_apicid, cpu);
}

int default_cpu_mask_to_apicid(const struct cpumask *msk, struct irq_data *irqd,
			       unsigned int *apicid)
{
	unsigned int cpu = cpumask_first(msk);

	if (cpu >= nr_cpu_ids)
		return -EINVAL;
	*apicid = per_cpu(x86_cpu_to_apicid, cpu);
	irq_data_update_effective_affinity(irqd, cpumask_of(cpu));
	return 0;
}

u32 apic_flat_calc_apicid(unsigned int cpu)
{
	return 1U << cpu;
}

int flat_cpu_mask_to_apicid(const struct cpumask *mask, struct irq_data *irqd,
			    unsigned int *apicid)

{
	struct cpumask *effmsk = irq_data_get_effective_affinity_mask(irqd);
	unsigned long cpu_mask = cpumask_bits(mask)[0] & APIC_ALL_CPUS;

	if (!cpu_mask)
		return -EINVAL;
	*apicid = (unsigned int)cpu_mask;
	cpumask_bits(effmsk)[0] = cpu_mask;
	return 0;
}

bool default_check_apicid_used(physid_mask_t *map, int apicid)
{
	return physid_isset(apicid, *map);
}

void flat_vector_allocation_domain(int cpu, struct cpumask *retmask,
				   const struct cpumask *mask)
{
	/*
	 * Careful. Some cpus do not strictly honor the set of cpus
	 * specified in the interrupt destination when using lowest
	 * priority interrupt delivery mode.
	 *
	 * In particular there was a hyperthreading cpu observed to
	 * deliver interrupts to the wrong hyperthread when only one
	 * hyperthread was specified in the interrupt desitination.
	 */
	cpumask_clear(retmask);
	cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
}

void default_vector_allocation_domain(int cpu, struct cpumask *retmask,
				      const struct cpumask *mask)
{
	cpumask_copy(retmask, cpumask_of(cpu));
}

void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
{
	*retmap = *phys_map;
+0 −4
Original line number Diff line number Diff line
@@ -158,7 +158,6 @@ static struct apic apic_flat __ro_after_init = {
	.dest_logical			= APIC_DEST_LOGICAL,
	.check_apicid_used		= NULL,

	.vector_allocation_domain	= flat_vector_allocation_domain,
	.init_apic_ldr			= flat_init_apic_ldr,

	.ioapic_phys_id_map		= NULL,
@@ -171,7 +170,6 @@ static struct apic apic_flat __ro_after_init = {
	.get_apic_id			= flat_get_apic_id,
	.set_apic_id			= set_apic_id,

	.cpu_mask_to_apicid		= flat_cpu_mask_to_apicid,
	.calc_dest_apicid		= apic_flat_calc_apicid,

	.send_IPI			= default_send_IPI_single,
@@ -253,7 +251,6 @@ static struct apic apic_physflat __ro_after_init = {
	.dest_logical			= 0,
	.check_apicid_used		= NULL,

	.vector_allocation_domain	= default_vector_allocation_domain,
	/* not needed, but shouldn't hurt: */
	.init_apic_ldr			= flat_init_apic_ldr,

@@ -267,7 +264,6 @@ static struct apic apic_physflat __ro_after_init = {
	.get_apic_id			= flat_get_apic_id,
	.set_apic_id			= set_apic_id,

	.cpu_mask_to_apicid		= default_cpu_mask_to_apicid,
	.calc_dest_apicid		= apic_default_calc_apicid,

	.send_IPI			= default_send_IPI_single_phys,
+0 −10
Original line number Diff line number Diff line
@@ -83,14 +83,6 @@ static int noop_apic_id_registered(void)
	return physid_isset(0, phys_cpu_present_map);
}

static void noop_vector_allocation_domain(int cpu, struct cpumask *retmask,
					  const struct cpumask *mask)
{
	if (cpu != 0)
		pr_warning("APIC: Vector allocated for non-BSP cpu\n");
	cpumask_copy(retmask, cpumask_of(cpu));
}

static u32 noop_apic_read(u32 reg)
{
	WARN_ON_ONCE(boot_cpu_has(X86_FEATURE_APIC) && !disable_apic);
@@ -125,7 +117,6 @@ struct apic apic_noop __ro_after_init = {
	.dest_logical			= APIC_DEST_LOGICAL,
	.check_apicid_used		= default_check_apicid_used,

	.vector_allocation_domain	= noop_vector_allocation_domain,
	.init_apic_ldr			= noop_init_apic_ldr,

	.ioapic_phys_id_map		= default_ioapic_phys_id_map,
@@ -141,7 +132,6 @@ struct apic apic_noop __ro_after_init = {
	.get_apic_id			= noop_get_apic_id,
	.set_apic_id			= NULL,

	.cpu_mask_to_apicid		= flat_cpu_mask_to_apicid,
	.calc_dest_apicid		= apic_flat_calc_apicid,

	.send_IPI			= noop_send_IPI,
+0 −4
Original line number Diff line number Diff line
@@ -253,7 +253,6 @@ static const struct apic apic_numachip1 __refconst = {
	.dest_logical			= 0,
	.check_apicid_used		= NULL,

	.vector_allocation_domain	= default_vector_allocation_domain,
	.init_apic_ldr			= flat_init_apic_ldr,

	.ioapic_phys_id_map		= NULL,
@@ -266,7 +265,6 @@ static const struct apic apic_numachip1 __refconst = {
	.get_apic_id			= numachip1_get_apic_id,
	.set_apic_id			= numachip1_set_apic_id,

	.cpu_mask_to_apicid		= default_cpu_mask_to_apicid,
	.calc_dest_apicid		= apic_default_calc_apicid,

	.send_IPI			= numachip_send_IPI_one,
@@ -304,7 +302,6 @@ static const struct apic apic_numachip2 __refconst = {
	.dest_logical			= 0,
	.check_apicid_used		= NULL,

	.vector_allocation_domain	= default_vector_allocation_domain,
	.init_apic_ldr			= flat_init_apic_ldr,

	.ioapic_phys_id_map		= NULL,
@@ -317,7 +314,6 @@ static const struct apic apic_numachip2 __refconst = {
	.get_apic_id			= numachip2_get_apic_id,
	.set_apic_id			= numachip2_set_apic_id,

	.cpu_mask_to_apicid		= default_cpu_mask_to_apicid,
	.calc_dest_apicid		= apic_default_calc_apicid,

	.send_IPI			= numachip_send_IPI_one,
+0 −2
Original line number Diff line number Diff line
@@ -158,7 +158,6 @@ static struct apic apic_bigsmp __ro_after_init = {
	.dest_logical			= 0,
	.check_apicid_used		= bigsmp_check_apicid_used,

	.vector_allocation_domain	= default_vector_allocation_domain,
	.init_apic_ldr			= bigsmp_init_apic_ldr,

	.ioapic_phys_id_map		= bigsmp_ioapic_phys_id_map,
@@ -171,7 +170,6 @@ static struct apic apic_bigsmp __ro_after_init = {
	.get_apic_id			= bigsmp_get_apic_id,
	.set_apic_id			= NULL,

	.cpu_mask_to_apicid		= default_cpu_mask_to_apicid,
	.calc_dest_apicid		= apic_default_calc_apicid,

	.send_IPI			= default_send_IPI_single_phys,
Loading