LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Is this code chunk in init_apic_mappings() superfluous?
@ 2020-03-05 12:44 Cao jin
  2020-03-07 11:27 ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Cao jin @ 2020-03-05 12:44 UTC (permalink / raw)
  To: X86 ML, LKML; +Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov

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?
-- 
Sincerely,
Cao jin



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Is this code chunk in init_apic_mappings() superfluous?
  2020-03-05 12:44 Is this code chunk in init_apic_mappings() superfluous? Cao jin
@ 2020-03-07 11:27 ` Thomas Gleixner
  2020-03-11 12:39   ` Cao jin
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2020-03-07 11:27 UTC (permalink / raw)
  To: Cao jin, X86 ML, LKML; +Cc: Ingo Molnar, Borislav Petkov

Cao jin <caoj.fnst@cn.fujitsu.com> writes:
> 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?

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

Thanks,

        tglx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Is this code chunk in init_apic_mappings() superfluous?
  2020-03-07 11:27 ` Thomas Gleixner
@ 2020-03-11 12:39   ` Cao jin
  0 siblings, 0 replies; 3+ messages in thread
From: Cao jin @ 2020-03-11 12:39 UTC (permalink / raw)
  To: Thomas Gleixner, X86 ML, LKML; +Cc: Ingo Molnar, Borislav Petkov

On 3/7/20 7:27 PM, Thomas Gleixner wrote:
> Cao jin <caoj.fnst@cn.fujitsu.com> writes:
>> 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?
> 
> 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.

-- 
Sincerely,
Cao jin



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-11 12:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-05 12:44 Is this code chunk in init_apic_mappings() superfluous? Cao jin
2020-03-07 11:27 ` Thomas Gleixner
2020-03-11 12:39   ` Cao jin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).