public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.6.3: PnPBIOS hangs with S875WP1 BIOS
@ 2004-03-04  7:23 Meelis Roos
  2004-03-04 13:51 ` Brian Gerst
  0 siblings, 1 reply; 8+ messages in thread
From: Meelis Roos @ 2004-03-04  7:23 UTC (permalink / raw)
  To: linux-kernel

I run a 2.6.3 kernel on Intel S875WP1 mainboard. When I enable PnPBIOS
in kernel config, the kernel gets general protection fault 0 just after
telling it found PnP BIOS. No backtrace. Disabling PnPBIOS in kernel
works around the problem.

-- 
Meelis Roos (mroos@linux.ee)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 2.6.3: PnPBIOS hangs with S875WP1 BIOS
  2004-03-04  7:23 2.6.3: PnPBIOS hangs with S875WP1 BIOS Meelis Roos
@ 2004-03-04 13:51 ` Brian Gerst
  2004-03-04 14:09   ` Meelis Roos
  0 siblings, 1 reply; 8+ messages in thread
From: Brian Gerst @ 2004-03-04 13:51 UTC (permalink / raw)
  To: Meelis Roos; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

Meelis Roos wrote:
> I run a 2.6.3 kernel on Intel S875WP1 mainboard. When I enable PnPBIOS
> in kernel config, the kernel gets general protection fault 0 just after
> telling it found PnP BIOS. No backtrace. Disabling PnPBIOS in kernel
> works around the problem.
> 

Try this patch

--
				Brian Gerst

[-- Attachment #2: pnpsegs-1 --]
[-- Type: text/plain, Size: 524 bytes --]

diff -urN linux-bk/arch/i386/mm/extable.c linux/arch/i386/mm/extable.c
--- linux-bk/arch/i386/mm/extable.c	2004-02-15 00:41:41.000000000 -0500
+++ linux/arch/i386/mm/extable.c	2004-03-04 08:42:12.169000128 -0500
@@ -12,7 +12,7 @@
 	const struct exception_table_entry *fixup;
 
 #ifdef CONFIG_PNPBIOS
-	if (unlikely((regs->xcs | 8) == 0x88)) /* 0x80 or 0x88 */
+	if (unlikely((regs->xcs & ~15) == (GDT_ENTRY_PNPBIOS_BASE << 3)))
 	{
 		extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp;
 		extern u32 pnp_bios_is_utter_crap;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 2.6.3: PnPBIOS hangs with S875WP1 BIOS
  2004-03-04 13:51 ` Brian Gerst
@ 2004-03-04 14:09   ` Meelis Roos
  2004-03-04 14:45     ` Brian Gerst
  0 siblings, 1 reply; 8+ messages in thread
From: Meelis Roos @ 2004-03-04 14:09 UTC (permalink / raw)
  To: Brian Gerst; +Cc: linux-kernel

> Try this patch

Well, it gets a little further. No oops but a different hang:

Linux Plug and Play Support v0.97 (c) Adam Belay
PnPBIOS: Scanning system for PnP BIOS support...
PnPBIOS: Found PnP BIOS installation structure at 0xc00f3e90
PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0x44ba, dseg 0xf0000
PNPBIOS fault.. attempting recovery.
double fault, gdt at c0488100 [255 bytes]
double fault, tss at c0530800
eip = f7fa1ea6, esp = 00000028
eax = 00000028, ebx = f7fa1ea6, ecx = c048c5d4, edx = 00000086
esi = 00000000, edi = c010c958

-- 
Meelis Roos (mroos@ut.ee)      http://www.cs.ut.ee/~mroos/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 2.6.3: PnPBIOS hangs with S875WP1 BIOS
  2004-03-04 14:09   ` Meelis Roos
@ 2004-03-04 14:45     ` Brian Gerst
  2004-03-04 14:58       ` Meelis Roos
  0 siblings, 1 reply; 8+ messages in thread
From: Brian Gerst @ 2004-03-04 14:45 UTC (permalink / raw)
  To: Meelis Roos; +Cc: linux-kernel

Meelis Roos wrote:

>>Try this patch
> 
> 
> Well, it gets a little further. No oops but a different hang:
> 
> Linux Plug and Play Support v0.97 (c) Adam Belay
> PnPBIOS: Scanning system for PnP BIOS support...
> PnPBIOS: Found PnP BIOS installation structure at 0xc00f3e90
> PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0x44ba, dseg 0xf0000
> PNPBIOS fault.. attempting recovery.
> double fault, gdt at c0488100 [255 bytes]
> double fault, tss at c0530800
> eip = f7fa1ea6, esp = 00000028

Looks like the BIOS trashed the stack.  I don't think there is anything 
that can be done other than a BIOS update.

--
				Brian Gerst

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 2.6.3: PnPBIOS hangs with S875WP1 BIOS
  2004-03-04 14:45     ` Brian Gerst
@ 2004-03-04 14:58       ` Meelis Roos
  2004-03-04 17:39         ` [PATCH] PnP BIOS exception fixes Brian Gerst
  0 siblings, 1 reply; 8+ messages in thread
From: Meelis Roos @ 2004-03-04 14:58 UTC (permalink / raw)
  To: Brian Gerst; +Cc: linux-kernel

> > PNPBIOS fault.. attempting recovery.
> > double fault, gdt at c0488100 [255 bytes]
> > double fault, tss at c0530800
> > eip = f7fa1ea6, esp = 00000028
>
> Looks like the BIOS trashed the stack.  I don't think there is anything
> that can be done other than a BIOS update.

This is the latest BIOS (P12) so I reported it to Intel.

-- 
Meelis Roos (mroos@linux.ee)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] PnP BIOS exception fixes
  2004-03-04 14:58       ` Meelis Roos
@ 2004-03-04 17:39         ` Brian Gerst
  2004-03-04 18:53           ` Linus Torvalds
  0 siblings, 1 reply; 8+ messages in thread
From: Brian Gerst @ 2004-03-04 17:39 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Meelis Roos, Brian Gerst, linux-kernel, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

This patch fixes two errors in fixup_exception() for PnP BIOS faults:
- Check for the correct segments used for the BIOS
- Fix asm constraints so that EIP and ESP are properly reloaded

--
				Brian Gerst

[-- Attachment #2: pnpsegs-2 --]
[-- Type: text/plain, Size: 777 bytes --]

diff -urN linux-bk/arch/i386/mm/extable.c linux/arch/i386/mm/extable.c
--- linux-bk/arch/i386/mm/extable.c	2004-02-15 00:41:41.000000000 -0500
+++ linux/arch/i386/mm/extable.c	2004-03-04 10:45:32.988904488 -0500
@@ -12,7 +12,7 @@
 	const struct exception_table_entry *fixup;
 
 #ifdef CONFIG_PNPBIOS
-	if (unlikely((regs->xcs | 8) == 0x88)) /* 0x80 or 0x88 */
+	if (unlikely((regs->xcs & ~15) == (GDT_ENTRY_PNPBIOS_BASE << 3)))
 	{
 		extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp;
 		extern u32 pnp_bios_is_utter_crap;
@@ -21,7 +21,7 @@
 		__asm__ volatile(
 			"movl %0, %%esp\n\t"
 			"jmp *%1\n\t"
-			: "=a" (pnp_bios_fault_esp), "=b" (pnp_bios_fault_eip));
+			: : "g" (pnp_bios_fault_esp), "g" (pnp_bios_fault_eip));
 		panic("do_trap: can't hit this");
 	}
 #endif

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PnP BIOS exception fixes
  2004-03-04 17:39         ` [PATCH] PnP BIOS exception fixes Brian Gerst
@ 2004-03-04 18:53           ` Linus Torvalds
  2004-03-04 18:54             ` Brian Gerst
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Torvalds @ 2004-03-04 18:53 UTC (permalink / raw)
  To: Brian Gerst; +Cc: Meelis Roos, linux-kernel, Andrew Morton



On Thu, 4 Mar 2004, Brian Gerst wrote:
>
> This patch fixes two errors in fixup_exception() for PnP BIOS faults:
> - Check for the correct segments used for the BIOS
> - Fix asm constraints so that EIP and ESP are properly reloaded

I'm almost certain that you should NOT use "g" as a constraint, since that 
allows the address to be on the stack frame, so when we compile without 
frame pointers and the compiler uses a %esp-relative thing for the branch 
address, that will totally screw up when we just re-loaded %esp inside the 
asm.

Can you use "r" instead, and test that it all works for you, and send an 
updated patch? Or just explain why I'm wrong.

		Linus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PnP BIOS exception fixes
  2004-03-04 18:53           ` Linus Torvalds
@ 2004-03-04 18:54             ` Brian Gerst
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Gerst @ 2004-03-04 18:54 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Meelis Roos, linux-kernel, Andrew Morton

Linus Torvalds wrote:
> 
> On Thu, 4 Mar 2004, Brian Gerst wrote:
> 
>>This patch fixes two errors in fixup_exception() for PnP BIOS faults:
>>- Check for the correct segments used for the BIOS
>>- Fix asm constraints so that EIP and ESP are properly reloaded
> 
> 
> I'm almost certain that you should NOT use "g" as a constraint, since that 
> allows the address to be on the stack frame, so when we compile without 
> frame pointers and the compiler uses a %esp-relative thing for the branch 
> address, that will totally screw up when we just re-loaded %esp inside the 
> asm.
> 
> Can you use "r" instead, and test that it all works for you, and send an 
> updated patch? Or just explain why I'm wrong.
> 
> 		Linus
> 

The inputs are global variables, with absolute addresses.

--
				Brian Gerst

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-03-04 18:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-04  7:23 2.6.3: PnPBIOS hangs with S875WP1 BIOS Meelis Roos
2004-03-04 13:51 ` Brian Gerst
2004-03-04 14:09   ` Meelis Roos
2004-03-04 14:45     ` Brian Gerst
2004-03-04 14:58       ` Meelis Roos
2004-03-04 17:39         ` [PATCH] PnP BIOS exception fixes Brian Gerst
2004-03-04 18:53           ` Linus Torvalds
2004-03-04 18:54             ` Brian Gerst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox