public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Samuel Sieb <samuel@sieb.net>
Cc: "Rafael C. de Almeida" <almeidaraf@gmail.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Magnus Damm <magnus@valinux.co.jp>, takada <takada@mbf.nifty.com>
Subject: Re: kernel won't boot on a Cyrix MediaGXm (Geode )
Date: Tue, 22 Jul 2008 12:24:57 +0200	[thread overview]
Message-ID: <20080722102457.GA773@elte.hu> (raw)
In-Reply-To: <48856BC6.7030308@sieb.net>


* Samuel Sieb <samuel@sieb.net> wrote:

> Ingo Molnar wrote:
>> * Rafael C. de Almeida <almeidaraf@gmail.com> wrote:
>>
>>> Samuel Sieb wrote:
>>>> I have a computer here with a CPU that the BIOS identifies as:
>>>> Cyrix MediaGXm/Cx5530 Unicorn Revision 1.19.3B
>>>>
>>>> I can't boot any kernel later than 2.6.22 on it.  Anything later either
>>>> hangs or gives random kernel panics while booting.  I tracked down the
>>>> problem to a specific commit:
>>>>
>>>> commit f25f64ed5bd3c2932493681bdfdb483ea707da0a
>> does the debug patch below (ontop of v2.6.26 or later kernels) make the 
>> system bootable again? Commit f25f64ed5 changed the meaning of that  
>> line. This patch switches back to the old behavior (which essentially  
>> did nothing, due to macro side-effect bugs).
>>
> Commenting out this line didn't have any effect that I could see.  I was  
> hoping one way or another it would affect the TSC unstable message I  
> get, but it didn't even change that.

could you try to figure out which particular use of getCx86() or 
setCx86() makes the difference? Here are the suspect nested ones, for 
which the macro->inline change can be material:

$ grep -n 'Cx86.*Cx86' arch/x86/kernel/*/*.c > 1

arch/x86/kernel/cpu/cyrix.c:119:	setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80);
arch/x86/kernel/cpu/cyrix.c:130:	setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
arch/x86/kernel/cpu/cyrix.c:134:	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14);
arch/x86/kernel/cpu/cyrix.c:147:	setCx86(CX86_PCR1, getCx86(CX86_PCR1) | 0x02);
arch/x86/kernel/cpu/cyrix.c:150:	setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x04);
arch/x86/kernel/cpu/cyrix.c:165:	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
arch/x86/kernel/cpu/cyrix.c:172:	setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x38);
arch/x86/kernel/cpu/cyrix.c:289:			setCx86(CX86_CCR7, getCx86(CX86_CCR7) | 1);
arch/x86/kernel/cpu/cyrix.c:312:			setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
arch/x86/kernel/cpu/cyrix.c:427:			setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x80);  /* enable cpuid  */

i've applied the patch below to tip/master:
 
   http://people.redhat.com/mingo/tip.git/README

could you check whether it boots your system fine, out of box?

If yes then could you try to figure out which of the 11 places above 
make the difference? If it's a single line that makes a difference then 
you'd need about 4 reboots to figure it out, by 'bisecting' the lines. 
(changing half of them to setCx86, etc.)

	Ingo

------------------->
commit 6072555e0b697b5bc968bf1b397f0a710d75657e
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Jul 22 11:58:14 2008 +0200

    x86, cyrix: debug
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/cpu/cyrix.c       |   20 ++++++++++----------
 include/asm-x86/processor-cyrix.h |    8 ++++++++
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 3fd7a67..db5868c 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -116,7 +116,7 @@ static void __cpuinit set_cx86_reorder(void)
 	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
 
 	/* Load/Store Serialize to mem access disable (=reorder it) */
-	setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80);
+	setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80);
 	/* set load/store serialize from 1GB to 4GB */
 	ccr3 |= 0xe0;
 	setCx86(CX86_CCR3, ccr3);
@@ -127,11 +127,11 @@ static void __cpuinit set_cx86_memwb(void)
 	printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
 
 	/* CCR2 bit 2: unlock NW bit */
-	setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
+	setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04);
 	/* set 'Not Write-through' */
 	write_cr0(read_cr0() | X86_CR0_NW);
 	/* CCR2 bit 2: lock NW bit and set WT1 */
-	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14);
+	setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14);
 }
 
 static void __cpuinit set_cx86_inc(void)
@@ -144,10 +144,10 @@ static void __cpuinit set_cx86_inc(void)
 	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
 	/* PCR1 -- Performance Control */
 	/* Incrementor on, whatever that is */
-	setCx86(CX86_PCR1, getCx86(CX86_PCR1) | 0x02);
+	setCx86_old(CX86_PCR1, getCx86_old(CX86_PCR1) | 0x02);
 	/* PCR0 -- Performance Control */
 	/* Incrementor Margin 10 */
-	setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x04);
+	setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) | 0x04);
 	setCx86(CX86_CCR3, ccr3);	/* disable MAPEN */
 }
 
@@ -162,14 +162,14 @@ static void __cpuinit geode_configure(void)
 	local_irq_save(flags);
 
 	/* Suspend on halt power saving and enable #SUSP pin */
-	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
+	setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88);
 
 	ccr3 = getCx86(CX86_CCR3);
 	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);	/* enable MAPEN */
 
 
 	/* FPU fast, DTE cache, Mem bypass */
-	setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x38);
+	setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38);
 	setCx86(CX86_CCR3, ccr3);			/* disable MAPEN */
 
 	set_cx86_memwb();
@@ -286,7 +286,7 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
 		/* GXm supports extended cpuid levels 'ala' AMD */
 		if (c->cpuid_level == 2) {
 			/* Enable cxMMX extensions (GX1 Datasheet 54) */
-			setCx86(CX86_CCR7, getCx86(CX86_CCR7) | 1);
+			setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1);
 
 			/*
 			 * GXm : 0x30 ... 0x5f GXm  datasheet 51
@@ -309,7 +309,7 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
 		if (dir1 > 7) {
 			dir0_msn++;  /* M II */
 			/* Enable MMX extensions (App note 108) */
-			setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
+			setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1);
 		} else {
 			c->coma_bug = 1;      /* 6x86MX, it has the bug. */
 		}
@@ -424,7 +424,7 @@ static void __cpuinit cyrix_identify(struct cpuinfo_x86 *c)
 			local_irq_save(flags);
 			ccr3 = getCx86(CX86_CCR3);
 			setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);       /* enable MAPEN  */
-			setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x80);  /* enable cpuid  */
+			setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);  /* enable cpuid  */
 			setCx86(CX86_CCR3, ccr3);                       /* disable MAPEN */
 			local_irq_restore(flags);
 		}
diff --git a/include/asm-x86/processor-cyrix.h b/include/asm-x86/processor-cyrix.h
index 97568ad..1198f2a 100644
--- a/include/asm-x86/processor-cyrix.h
+++ b/include/asm-x86/processor-cyrix.h
@@ -28,3 +28,11 @@ static inline void setCx86(u8 reg, u8 data)
 	outb(reg, 0x22);
 	outb(data, 0x23);
 }
+
+#define getCx86_old(reg) ({ outb((reg), 0x22); inb(0x23); })
+
+#define setCx86_old(reg, data) do { \
+	outb((reg), 0x22); \
+	outb((data), 0x23); \
+} while (0)
+


  reply	other threads:[~2008-07-22 10:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21  5:11 kernel won't boot on a Cyrix MediaGXm (Geode ) Samuel Sieb
2008-07-21  6:28 ` Juergen Beisert
2008-07-22  5:16   ` Samuel Sieb
2008-07-22  8:08     ` Juergen Beisert
2008-07-23  7:13       ` Samuel Sieb
2008-07-21  6:36 ` Rafael C. de Almeida
2008-07-21 11:47   ` Ingo Molnar
2008-07-22  5:10     ` Samuel Sieb
2008-07-22 10:24       ` Ingo Molnar [this message]
2008-07-22 10:51         ` Juergen Beisert
2008-07-23  7:18           ` Samuel Sieb
2008-07-28 15:32             ` Ingo Molnar
2008-07-28 17:58               ` Samuel Sieb
2008-07-29  9:18                 ` Ingo Molnar
2008-07-29  8:15               ` Juergen Beisert
2008-08-07  5:06               ` Samuel Sieb
2008-08-20  9:32                 ` Ingo Molnar
2008-08-20  9:44                   ` Juergen Beisert
2008-08-20 10:45                     ` Ingo Molnar
2008-08-20 11:03                       ` Juergen Beisert
2008-08-20 11:20                         ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080722102457.GA773@elte.hu \
    --to=mingo@elte.hu \
    --cc=almeidaraf@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus@valinux.co.jp \
    --cc=samuel@sieb.net \
    --cc=takada@mbf.nifty.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox