Commit a5e00407 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by PvsNarasimha
Browse files

x86/apic: Get rid of apic:: Dest_logical

mainline inclusion
from mainline-v5.11-rc1
commit e57d04e5
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IAU6ZD

Reference: https://github.com/torvalds/linux/commit/e57d04e5fa00f7649d4c00796f8d12054799be4a



--------------------------------

commit e57d04e5 upstream

struct apic has two members which store information about the destination
mode: dest_logical and irq_dest_mode.

dest_logical contains a mask which was historically used to set the
destination mode in IPI messages. Over time the usage was reduced and the
logical/physical functions were seperated.

There are only a few places which still use 'dest_logical' but they can
use 'irq_dest_mode' instead.

irq_dest_mode is actually a boolean where 0 means physical destination mode
and 1 means logical destination mode. Of course the name does not reflect
the functionality. This will be cleaned up in a subsequent change.

Remove apic::dest_logical and fixup the remaining users.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20201024213535.443185-8-dwmw2@infradead.org


Signed-off-by: default avatarPvsNarasimha <PVS.NarasimhaRao@amd.com>
parent 8b684193
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -298,8 +298,6 @@ struct apic {
	void	(*send_IPI_all)(int vector);
	void	(*send_IPI_self)(int vector);

	/* dest_logical is used by the IPI functions */
	u32	dest_logical;
	u32	disable_esr;

	enum apic_delivery_modes delivery_mode;
+1 −1
Original line number Diff line number Diff line
@@ -1594,7 +1594,7 @@ static void setup_local_APIC(void)
	apic->init_apic_ldr();

#ifdef CONFIG_X86_32
	if (apic->dest_logical) {
	if (apic->irq_dest_mode == 1) {
		int logical_apicid, ldr_apicid;

		/*
+2 −6
Original line number Diff line number Diff line
@@ -117,11 +117,9 @@ static struct apic apic_flat __ro_after_init = {
	.irq_dest_mode			= 1, /* logical */

	.disable_esr			= 0,
	.dest_logical			= APIC_DEST_LOGICAL,
	.check_apicid_used		= NULL,

	.check_apicid_used		= NULL,
	.init_apic_ldr			= flat_init_apic_ldr,

	.ioapic_phys_id_map		= NULL,
	.setup_apic_routing		= NULL,
	.cpu_present_to_apicid		= default_cpu_present_to_apicid,
@@ -210,11 +208,9 @@ static struct apic apic_physflat __ro_after_init = {
	.irq_dest_mode			= 0, /* physical */

	.disable_esr			= 0,
	.dest_logical			= 0,
	.check_apicid_used		= NULL,

	.check_apicid_used		= NULL,
	.init_apic_ldr			= physflat_init_apic_ldr,

	.ioapic_phys_id_map		= NULL,
	.setup_apic_routing		= NULL,
	.cpu_present_to_apicid		= default_cpu_present_to_apicid,
+1 −3
Original line number Diff line number Diff line
@@ -100,11 +100,9 @@ struct apic apic_noop __ro_after_init = {
	.irq_dest_mode			= 1,

	.disable_esr			= 0,
	.dest_logical			= APIC_DEST_LOGICAL,
	.check_apicid_used		= default_check_apicid_used,

	.check_apicid_used		= default_check_apicid_used,
	.init_apic_ldr			= noop_init_apic_ldr,

	.ioapic_phys_id_map		= default_ioapic_phys_id_map,
	.setup_apic_routing		= NULL,

+2 −6
Original line number Diff line number Diff line
@@ -250,11 +250,9 @@ static const struct apic apic_numachip1 __refconst = {
	.irq_dest_mode			= 0, /* physical */

	.disable_esr			= 0,
	.dest_logical			= 0,
	.check_apicid_used		= NULL,

	.check_apicid_used		= NULL,
	.init_apic_ldr			= flat_init_apic_ldr,

	.ioapic_phys_id_map		= NULL,
	.setup_apic_routing		= NULL,
	.cpu_present_to_apicid		= default_cpu_present_to_apicid,
@@ -299,11 +297,9 @@ static const struct apic apic_numachip2 __refconst = {
	.irq_dest_mode			= 0, /* physical */

	.disable_esr			= 0,
	.dest_logical			= 0,
	.check_apicid_used		= NULL,

	.check_apicid_used		= NULL,
	.init_apic_ldr			= flat_init_apic_ldr,

	.ioapic_phys_id_map		= NULL,
	.setup_apic_routing		= NULL,
	.cpu_present_to_apicid		= default_cpu_present_to_apicid,
Loading