[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5284B11C.3020103@jp.fujitsu.com>
Date: Thu, 14 Nov 2013 20:16:44 +0900
From: HATAYAMA Daisuke <d.hatayama@...fujitsu.com>
To: hpa@...ux.intel.com
CC: ebiederm@...ssion.com, vgoyal@...hat.com,
kexec@...ts.infradead.org, linux-kernel@...r.kernel.org,
bp@...en8.de, akpm@...ux-foundation.org, fengguang.wu@...el.com,
jingbai.ma@...com
Subject: Re: [PATCH v5 1/3] x86, apic: add bsp_physical_apicid
Hello HPA,
I have another question relevant to http://lkml.org/lkml/2013/11/12/311.
(2013/11/12 18:51), HATAYAMA Daisuke wrote:
<cut>
> @@ -2589,3 +2593,14 @@ static int __init lapic_insert_resource(void)
> * that is using request_resource
> */
> late_initcall(lapic_insert_resource);
> +
> +void __init bsp_physical_apicid_init(void)
> +{
> + u32 l, h;
> +
> + if (boot_cpu_data.x86 >= 6 && cpu_has_apic) {
> + rdmsr(MSR_IA32_APICBASE, l, h);
> + if (!(l & MSR_IA32_APICBASE_BSP))
> + bsp_physical_apicid = boot_cpu_data.initial_apicid;
> + }
> +}
So, rigrously, we should not use rdmsr for MSR_IA32_APICBASE here since this can
return wrong value on some clustered system?
At least all the mpparse.c, amdtopology.c and visws_quirks.c has referred to
MP table only, so there's no issue by simply dropping this code.
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index 2793d1f..28bea2c 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -681,7 +681,7 @@ static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c)
> /*
> * Do minimum CPU detection early.
> * Fields really needed: vendor, cpuid_level, family, model, mask,
> - * cache alignment.
> + * cache alignment, initial_apicid.
> * The others are not touched to avoid unwanted side effects.
> *
> * WARNING: this function is only called on the BP. Don't add code here
> @@ -725,6 +725,9 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
> this_cpu->c_bsp_init(c);
>
> setup_force_cpu_cap(X86_FEATURE_ALWAYS);
> +
> + if (c->cpuid_level >= 0x00000001)
> + c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
> }
Can the initial APID IDs obtained in this way using cpuid duplicate on some
clustered system?
Can we consider each apic->get_apic_id() method return *initial* APIC ID?
According to 8.4 Multiple-Processor (MP) Initialization, Intel System Programming
Guide, the APID IDs written into MADT and MP table are the initial ones.
So, APID IDs to be compared with these must be the initial ones.
--
Thanks.
HATAYAMA, Daisuke
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists