lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 1 Sep 2008 18:16:42 +0200
From:	Krzysztof Helt <krzysztof.h1@...zta.fm>
To:	Yinghai Lu <yhlu.kernel@...il.com>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Krzysztof Helt <krzysztof.h1@...pl>
Subject: Re: [PATCH] x86: move mtrr cpu cap setting early in early_init_xxxx

On Sun, 31 Aug 2008 21:07:05 -0700
Yinghai Lu <yhlu.kernel@...il.com> wrote:

> Krzysztof Helt <krzysztof.h1@...pl> 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@...pl>
> Signed-off-by: Yinghai Lu <yhlu.kernel@...il.com>
> Cc: Krzysztof Helt <krzysztof.h1@...pl>
> 
> ---

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@...pl>
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@...pl>
---
 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);
 }
 
 /*
-- 
1.5.2.2




----------------------------------------------------------------------
>> Sprawdz, czy do siebie pasujecie!
>> http://link.interia.pl/f1eea

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ