Skip to content

Commit 07e8f88

Browse files
andyhhpbp3tk0v
authored andcommitted
x86/apic: Drop apic::delivery_mode
This field is set to APIC_DELIVERY_MODE_FIXED in all cases, and is read exactly once. Fold the constant in uv_program_mmr() and drop the field. Searching for the origin of the stale HyperV comment reveals commit a31e58e ("x86/apic: Switch all APICs to Fixed delivery mode") which notes: As a consequence of this change, the apic::irq_delivery_mode field is now pointless, but this needs to be cleaned up in a separate patch. 6 years is long enough for this technical debt to have survived. [ bp: Fold in https://lore.kernel.org/r/20231121123034.1442059-1-andrew.cooper3@citrix.com ] Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Steve Wahl <steve.wahl@hpe.com> Link: https://lore.kernel.org/r/20231102-x86-apic-v1-1-bf049a2a0ed6@citrix.com
1 parent 98b1cc8 commit 07e8f88

13 files changed

Lines changed: 4 additions & 23 deletions

File tree

arch/x86/include/asm/apic.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,6 @@ struct apic {
272272
void (*send_IPI_all)(int vector);
273273
void (*send_IPI_self)(int vector);
274274

275-
enum apic_delivery_modes delivery_mode;
276-
277275
u32 disable_esr : 1,
278276
dest_mode_logical : 1,
279277
x2apic_set_max_apicid : 1,

arch/x86/kernel/apic/apic_flat_64.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ static struct apic apic_flat __ro_after_init = {
8282
.acpi_madt_oem_check = flat_acpi_madt_oem_check,
8383
.apic_id_registered = default_apic_id_registered,
8484

85-
.delivery_mode = APIC_DELIVERY_MODE_FIXED,
8685
.dest_mode_logical = true,
8786

8887
.disable_esr = 0,
@@ -154,7 +153,6 @@ static struct apic apic_physflat __ro_after_init = {
154153
.acpi_madt_oem_check = physflat_acpi_madt_oem_check,
155154
.apic_id_registered = default_apic_id_registered,
156155

157-
.delivery_mode = APIC_DELIVERY_MODE_FIXED,
158156
.dest_mode_logical = false,
159157

160158
.disable_esr = 0,

arch/x86/kernel/apic/apic_noop.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ static void noop_apic_write(u32 reg, u32 val)
4747
struct apic apic_noop __ro_after_init = {
4848
.name = "noop",
4949

50-
.delivery_mode = APIC_DELIVERY_MODE_FIXED,
5150
.dest_mode_logical = true,
5251

5352
.disable_esr = 0,

arch/x86/kernel/apic/apic_numachip.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ static const struct apic apic_numachip1 __refconst = {
222222
.probe = numachip1_probe,
223223
.acpi_madt_oem_check = numachip1_acpi_madt_oem_check,
224224

225-
.delivery_mode = APIC_DELIVERY_MODE_FIXED,
226225
.dest_mode_logical = false,
227226

228227
.disable_esr = 0,
@@ -259,7 +258,6 @@ static const struct apic apic_numachip2 __refconst = {
259258
.probe = numachip2_probe,
260259
.acpi_madt_oem_check = numachip2_acpi_madt_oem_check,
261260

262-
.delivery_mode = APIC_DELIVERY_MODE_FIXED,
263261
.dest_mode_logical = false,
264262

265263
.disable_esr = 0,

arch/x86/kernel/apic/bigsmp_32.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ static struct apic apic_bigsmp __ro_after_init = {
8080
.name = "bigsmp",
8181
.probe = probe_bigsmp,
8282

83-
.delivery_mode = APIC_DELIVERY_MODE_FIXED,
8483
.dest_mode_logical = false,
8584

8685
.disable_esr = 1,

arch/x86/kernel/apic/probe_32.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ static struct apic apic_default __ro_after_init = {
4545
.probe = probe_default,
4646
.apic_id_registered = default_apic_id_registered,
4747

48-
.delivery_mode = APIC_DELIVERY_MODE_FIXED,
4948
.dest_mode_logical = true,
5049

5150
.disable_esr = 0,

arch/x86/kernel/apic/x2apic_cluster.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ static struct apic apic_x2apic_cluster __ro_after_init = {
227227
.probe = x2apic_cluster_probe,
228228
.acpi_madt_oem_check = x2apic_acpi_madt_oem_check,
229229

230-
.delivery_mode = APIC_DELIVERY_MODE_FIXED,
231230
.dest_mode_logical = true,
232231

233232
.disable_esr = 0,

arch/x86/kernel/apic/x2apic_phys.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ static struct apic apic_x2apic_phys __ro_after_init = {
145145
.probe = x2apic_phys_probe,
146146
.acpi_madt_oem_check = x2apic_acpi_madt_oem_check,
147147

148-
.delivery_mode = APIC_DELIVERY_MODE_FIXED,
149148
.dest_mode_logical = false,
150149

151150
.disable_esr = 0,

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,6 @@ static struct apic apic_x2apic_uv_x __ro_after_init = {
805805
.probe = uv_probe,
806806
.acpi_madt_oem_check = uv_acpi_madt_oem_check,
807807

808-
.delivery_mode = APIC_DELIVERY_MODE_FIXED,
809808
.dest_mode_logical = false,
810809

811810
.disable_esr = 0,

arch/x86/platform/uv/uv_irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static void uv_program_mmr(struct irq_cfg *cfg, struct uv_irq_2_mmr_pnode *info)
3535
mmr_value = 0;
3636
entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
3737
entry->vector = cfg->vector;
38-
entry->delivery_mode = apic->delivery_mode;
38+
entry->delivery_mode = APIC_DELIVERY_MODE_FIXED;
3939
entry->dest_mode = apic->dest_mode_logical;
4040
entry->polarity = 0;
4141
entry->trigger = 0;

0 commit comments

Comments
 (0)