Re: [PATCH 2/5] x86: c_p_a clflush_cache_range fix

From: Ingo Molnar
Date: Thu Jan 31 2008 - 07:09:01 EST



* Huang, Ying <ying.huang@xxxxxxxxx> wrote:

> +++ b/arch/x86/kernel/cpu/common.c
> @@ -274,8 +274,10 @@ void __init cpu_detect(struct cpuinfo_x8
> if (c->x86 >= 0x6)
> c->x86_model += ((tfms >> 16) & 0xF) << 4;
> c->x86_mask = tfms & 15;
> - if (cap0 & (1<<19))
> + if (cap0 & (1<<19)) {
> c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
> + c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
> + }

thanks!

> @@ -317,6 +319,7 @@ static void __init early_cpu_detect(void
> struct cpuinfo_x86 *c = &boot_cpu_data;
>
> c->x86_cache_alignment = 32;
> + c->x86_clflush_size = 32;

i suspect 32 is a good lower limit (it's not a big issue to do too
finegrained flushes, and CLFLUSH is valid with arbitrary alignment) -
and this will be overriden with 64 later on.

Ingo
--
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/