x86/apic: remove vector_allocation_cpumask hook

All implementations use the same hook which is a wrapper around
cpumask_of(cpu).  Adjust callers to no longer use such dummy mask with a
single CPU set, as the CPU is already known to the caller.  This removes a
pair of usages of for_each_cpu().

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Roger Pau Monne committed 2025-11-26 09:46:17 +01:00
1 parent 4fad52d207
commit 76e51bc152
6 files changed
+6 -29

No files matched your search

-1
View File
@@ -47,7 +47,6 @@ static int __init cf_check probe_bigsmp(void)
const struct genapic __initconst_cf_clobber apic_bigsmp = {
APIC_INIT("bigsmp", probe_bigsmp),
.init_apic_ldr = init_apic_ldr_phys,
.vector_allocation_cpumask = vector_allocation_cpumask_phys,
.send_IPI_mask = send_IPI_mask_phys,
.send_IPI_self = send_IPI_self_legacy
};
-1
View File
@@ -17,7 +17,6 @@
const struct genapic __initconst_cf_clobber apic_default = {
APIC_INIT("default", NULL),
.init_apic_ldr = init_apic_ldr_flat,
.vector_allocation_cpumask = vector_allocation_cpumask_phys,
.send_IPI_mask = send_IPI_mask_flat,
.send_IPI_self = send_IPI_self_legacy
};
-5
View File
@@ -30,11 +30,6 @@ void cf_check init_apic_ldr_phys(void)
/* We only deliver in phys mode - no setup needed. */
}
const cpumask_t *cf_check vector_allocation_cpumask_phys(int cpu)
{
return cpumask_of(cpu);
}
unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
{
/* As we are using single CPU as destination, pick only one CPU here */
-7
View File
@@ -141,7 +141,6 @@ static void cf_check send_IPI_mask_x2apic_cluster(
static const struct genapic __initconst_cf_clobber apic_x2apic_phys = {
APIC_INIT("x2apic_phys", NULL),
.init_apic_ldr = init_apic_ldr_phys,
.vector_allocation_cpumask = vector_allocation_cpumask_phys,
.send_IPI_mask = send_IPI_mask_x2apic_phys,
.send_IPI_self = send_IPI_self_x2apic
};
@@ -156,12 +155,6 @@ static const struct genapic __initconst_cf_clobber apic_x2apic_phys = {
static const struct genapic __initconst_cf_clobber apic_x2apic_mixed = {
APIC_INIT("x2apic_mixed", NULL),
/*
* The following fields are exclusively used by external interrupts and
* hence are set to use Physical destination mode handlers.
*/
.vector_allocation_cpumask = vector_allocation_cpumask_phys,
/*
* The following fields are exclusively used by IPIs and hence are set to
* use Cluster Logical destination mode handlers. Note that init_apic_ldr
-4
View File
@@ -24,7 +24,6 @@ struct genapic {
int (*probe)(void);
void (*init_apic_ldr)(void);
const cpumask_t *(*vector_allocation_cpumask)(int cpu);
void (*send_IPI_mask)(const cpumask_t *mask, int vector);
void (*send_IPI_self)(uint8_t vector);
};
@@ -35,8 +34,6 @@ struct genapic {
#define TARGET_CPUS ((const typeof(cpu_online_map) *)&cpu_online_map)
#define init_apic_ldr() alternative_vcall(genapic.init_apic_ldr)
#define vector_allocation_cpumask(cpu) \
alternative_call(genapic.vector_allocation_cpumask, cpu)
extern struct genapic genapic;
extern const struct genapic apic_default;
@@ -50,7 +47,6 @@ void cf_check send_IPI_mask_flat(const cpumask_t *cpumask, int vector);
void cf_check init_apic_ldr_phys(void);
unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask);
void cf_check send_IPI_mask_phys(const cpumask_t *mask, int vector);
const cpumask_t *cf_check vector_allocation_cpumask_phys(int cpu);
void generic_apic_probe(void);
void generic_bigsmp_probe(void);
+6 -11
View File
@@ -621,16 +621,12 @@ static int _assign_irq_vector(struct irq_desc *desc, const cpumask_t *mask)
for_each_cpu(cpu, mask)
{
const cpumask_t *vec_mask;
int new_cpu;
int vector, offset;
/* Only try and allocate irqs on cpus that are present. */
if (!cpu_online(cpu))
continue;
vec_mask = vector_allocation_cpumask(cpu);
vector = current_vector;
offset = current_offset;
next:
@@ -650,13 +646,13 @@ next:
&& test_bit(vector, irq_used_vectors) )
goto next;
if ( cpumask_test_cpu(0, vec_mask) &&
if ( !cpu &&
vector >= FIRST_LEGACY_VECTOR && vector <= LAST_LEGACY_VECTOR )
goto next;
for_each_cpu(new_cpu, vec_mask)
if (per_cpu(vector_irq, new_cpu)[vector] >= 0)
if ( per_cpu(vector_irq, cpu)[vector] >= 0 )
goto next;
/* Found one! */
current_vector = vector;
current_offset = offset;
@@ -688,12 +684,11 @@ next:
release_old_vec(desc);
}
trace_irq_mask(TRC_HW_IRQ_ASSIGN_VECTOR, irq, vector, vec_mask);
trace_irq_mask(TRC_HW_IRQ_ASSIGN_VECTOR, irq, vector, cpumask_of(cpu));
for_each_cpu(new_cpu, vec_mask)
per_cpu(vector_irq, new_cpu)[vector] = irq;
per_cpu(vector_irq, cpu)[vector] = irq;
desc->arch.vector = vector;
cpumask_copy(desc->arch.cpu_mask, vec_mask);
cpumask_copy(desc->arch.cpu_mask, cpumask_of(cpu));
desc->arch.used = IRQ_USED;
ASSERT((desc->arch.used_vectors == NULL)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.