Re: [PATCH] x86: move mtrr cpu cap setting early in early_init_xxxx

From: Yinghai Lu
Date: Mon Sep 01 2008 - 12:42:23 EST


On Mon, Sep 1, 2008 at 9:16 AM, Krzysztof Helt <krzysztof.h1@xxxxxxxxx> wrote:
> On Sun, 31 Aug 2008 21:07:05 -0700
> Yinghai Lu <yhlu.kernel@xxxxxxxxx> wrote:
>
>> Krzysztof Helt <krzysztof.h1@xxxxx> found mtrr is not detected on k6-2
>>
>> root case:
>> we move mtrr_bp_init early for mtrr trimming.
>> and in early_detect, only read cap from cpuid, so some cpu doesn't have
>> that bit in cpuid and need to set workaround bit will have problem.
>>
>> need to add early_init_xxxx to preset those bit before mtrr_bp_init
>> for those earlier cpus.
>>
>> this patch is for 2.6.27
>>
>> Reported-by: Krzysztof Helt <krzysztof.h1@xxxxx>
>> Signed-off-by: Yinghai Lu <yhlu.kernel@xxxxxxxxx>
>> Cc: Krzysztof Helt <krzysztof.h1@xxxxx>
>>
>> ---
>
> Your patch works only if the the fix below is applied.
>
> Otherwise, the caps set in the early_cpu_init are reset
> in the early_get_cap.
>
> Regards,
> Krzysztof
>
> ---
> From 808cfe180c1400594a01d6229239d4bf01ca4eea Mon Sep 17 00:00:00 2001
> From: Krzysztof Helt <krzysztof.h1@xxxxx>
> Date: Tue, 2 Sep 2008 17:29:51 +0200
> Subject: [PATCH] x86: delay early cpu initialization until cpuid is done
>
> Move early cpu initialization after cpu
> early get cap so the early cpu initialization
> can fix up cpu caps.
>
> Signed-off-by: Krzysztof Helt <krzysztof.h1@xxxxx>
> ---
> arch/x86/kernel/cpu/common.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index d3bc82f..f970cbf 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -335,11 +335,11 @@ static void __init early_cpu_detect(void)
>
> get_cpu_vendor(c, 1);
>
> + early_get_cap(c);
> +
> if (c->x86_vendor != X86_VENDOR_UNKNOWN &&
> cpu_devs[c->x86_vendor]->c_early_init)
> cpu_devs[c->x86_vendor]->c_early_init(c);
> -
> - early_get_cap(c);
> }
>
> /*

thanks.

Ingo,
[PATCH] x86: delay early cpu initialization until cpuid is done
should be applied before
[PATCH] x86: move mtrr cpu cap setting early in early_init_xxxx

YH
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/