Received: by oss.sgi.com id ; Sun, 9 Apr 2000 05:04:40 -0700 Received: from Cantor.suse.de ([194.112.123.193]:50693 "HELO Cantor.suse.de") by oss.sgi.com with SMTP id ; Sun, 9 Apr 2000 05:04:13 -0700 Received: from Hermes.suse.de (Hermes.suse.de [194.112.123.136]) by Cantor.suse.de (Postfix) with ESMTP id C754D1E140; Sun, 9 Apr 2000 14:04:11 +0200 (MEST) Received: from gruyere.muc.suse.de (gruyere.muc.suse.de [10.23.1.2]) by Hermes.suse.de (Postfix) with ESMTP id 92B3610A026; Sun, 9 Apr 2000 14:03:55 +0200 (MEST) Received: by gruyere.muc.suse.de (Postfix, from userid 14446) id 3576E2F36B; Sun, 9 Apr 2000 14:03:54 +0200 (MEST) Date: Sun, 9 Apr 2000 14:03:54 +0200 From: "Andi Kleen" To: suzukis@file.phys.tohoku.ac.jp Cc: linux-xfs@oss.sgi.com Subject: Re: 486 and Linux-2.3.99pre2+XFS Message-ID: <20000409140354.A29535@gruyere.muc.suse.de> References: <20000409100802.10137.qmail@file.phys.tohoku.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000409100802.10137.qmail@file.phys.tohoku.ac.jp>; from suzukis@file.phys.tohoku.ac.jp on Sun, Apr 09, 2000 at 07:08:02PM +0900 Sender: owner-linux-xfs@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;linux-xfs-outgoing On Sun, Apr 09, 2000 at 07:08:02PM +0900, suzukis@file.phys.tohoku.ac.jp wrote: > # For first, I must apologize, > # this is NOT related to the XFS implementation itself, > # this is related to the kernel source publisized by SGI. > # However, I wish, it's not completely-meaningless for > # linux-xfs subscribers who failed to run on 486 PC. > > Hello, > > There's anybody who makes Linux-XFS kernel (by SGI) > running on 486 PC? Yet I've not succeed to do it. > Even if the kernel can run on 586 (and later) PCs, > it fails on 486. Of course, I choose 386 + math emulation > in kernel configuration. I receive following message. This is a KDB bug. It uses Pentium specific MSRs without checking that it really runs on a Pentium. Try turning off CONFIG_KDB or apply the following patch: -Andi --- linux/arch/i386/kdb/kdbasupport.c-k6kdb Sat Mar 25 01:41:33 2000 +++ linux/arch/i386/kdb/kdbasupport.c Mon Apr 3 20:50:59 2000 @@ -37,6 +37,41 @@ unsigned long smp_kdb_wait; #endif +enum cpu { IntelP5, IntelP6, AmdK6, Unknown } kdba_msrtype; + +/* The normal kernel does the same, but be independent. */ +static void +kdba_checkcpu(void) +{ + union { + char str[12]; + __u32 reg[3]; + } v; + int eax,ebx,ecx,edx; + __asm__("cpuid" + : "=a" (eax), "=b" (v.reg[0]) , "=c" (v.reg[1]), "=d" (v.reg[2]) + : "a" (0)); + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (1)); + + kdba_msrtype = Unknown; + if (!strcmp(v.str, "GenuineIntel")) { + switch ((ebx >> 4) & 0xF) { + case 5: + kdba_msrtype = IntelP5; + break; + case 6: + kdba_msrtype = IntelP6; + break; + } + } else if (!strcmp(v.str, "AuthenticAMD") && (((ebx >> 4) & 0xF) == 6)) { + kdba_msrtype = AmdK6; + } +} + + + void kdba_installdbreg(kdb_bp_t *bp) { @@ -708,6 +743,11 @@ { u32 lv, hv; + if (kdba_msrtype != IntelP6) { + kdb_printf("Last branch information not supported on this CPU.\n"); + return; + } + rdmsr(DEBUGCTLMSR, lv, hv); lv |= 0x1; /* Set LBR enable */ wrmsr(DEBUGCTLMSR, lv, hv); @@ -734,6 +774,11 @@ u32 bflv, bfhv; u32 btlv, bthv; + if (kdba_msrtype != IntelP6) { + kdb_printf("Last branch information not supported on this CPU.\n"); + return; + } + rdmsr(LASTBRANCHFROMIP, bflv, bfhv); rdmsr(LASTBRANCHTOIP, btlv, bthv); kdb_printf("Last Branch IP, from: 0x%x to 0x%x\n", @@ -1087,6 +1132,7 @@ void kdba_init(void) { + kdba_checkcpu(); kdba_enablelbr(); return; --- linux/arch/i386/kernel/entry.S-k6kdb Sat Mar 25 01:41:33 2000 +++ linux/arch/i386/kernel/entry.S Mon Apr 3 20:52:24 2000 @@ -432,16 +432,6 @@ jmp error_code ENTRY(page_fault) - pushl %ecx - pushl %edx - pushl %eax - movl $473,%ecx - rdmsr - andl $0xfffffffe,%eax - wrmsr - popl %eax - popl %edx - popl %ecx pushl $ SYMBOL_NAME(do_page_fault) jmp error_code