Skip to contentSkip to conversation

Is this code chunk in init_apic_mappings() superfluous?

DISCUSSION Cao jin 2 participants 3 messages Mar 5, 2020 – Mar 11, 2020

lore
Share & tools
lore

Cao jin

author
#0 lore raw

Hi,

I am trying to figure the following code chunk out:

	if (x2apic_mode) {
		boot_cpu_physical_apicid = read_apic_id();
		return;
	}

As my understanding, even in x2APIC mode, boot_cpu_physical_apicid is also got via early_acpi_process_madt --> ... --> register_lapic_address, so, is it for any corner case I am not aware?

Signature · 2 lines
Sincerely,
Cao jin
#1 lore raw
Quoted 4 lines · Cao jin

Hi,

I am trying to figure the following code chunk out:

Quoted 8 lines
	if (x2apic_mode) {
		boot_cpu_physical_apicid = read_apic_id();
		return;
	}

As my understanding, even in x2APIC mode, boot_cpu_physical_apicid is also got via early_acpi_process_madt --> ... --> register_lapic_address, so, is it for any corner case I am not aware?

The case when there are neither ACPI nor valid mptables. Unlikely, but possible in theory.

Thanks,

tglx

author
#2 lore raw
Quoted 10 lines · Thomas Gleixner
Quoted 9 lines · Cao jin

Hi,

I am trying to figure the following code chunk out:

	if (x2apic_mode) {
		boot_cpu_physical_apicid = read_apic_id();
		return;
	}
Quoted 7 lines
Quoted 3 lines

As my understanding, even in x2APIC mode, boot_cpu_physical_apicid is also got via early_acpi_process_madt --> ... --> register_lapic_address, so, is it for any corner case I am not aware?

The case when there are neither ACPI nor valid mptables. Unlikely, but possible in theory.

I noticed this case in its calling comments, but failed to associate it with a x2APIC...

So init_apic_mapping() is for 2 corner cases that doesn't map APIC register before: one you mentioned here, and MP default configuration the other.

Thanks Thomas.

Signature · 2 lines
Sincerely,
Cao jin