public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] reboot=bios is invalidating cache incorrectly
@ 2002-04-23 13:51 Martin Knoblauch
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Knoblauch @ 2002-04-23 13:51 UTC (permalink / raw)
  To: robert; +Cc: linux-kernel@vger.kernel.org

> [PATCH] reboot=bios is invalidating cache incorrectly
> 
> 
> This patch applies cleanly to 2.4.18 and 2.5.8. It probably also works
> with all 2.2.x, 2.4.x and 2.5.x kernels.
> 
> This fixes a long standing bug that prevented reliable reboots on some
> platforms.
> 
Robert,

 care to specify which platforms? :-) I ask because I am experiencing
reboot hangs between BISO and lilo on Tyan 2462 boards. Apparently
others see similar things.

Martin
-- 
------------------------------------------------------------------
Martin Knoblauch         |    email:  Martin.Knoblauch@TeraPort.de
TeraPort GmbH            |    Phone:  +49-89-510857-309
C+ITS                    |    Fax:    +49-89-510857-111
http://www.teraport.de   |    Mobile: +49-170-4904759

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: [PATCH] reboot=bios is invalidating cache incorrectly
@ 2002-04-23 20:02 Robert_Hentosh
  0 siblings, 0 replies; 5+ messages in thread
From: Robert_Hentosh @ 2002-04-23 20:02 UTC (permalink / raw)
  To: m.knoblauch, robert; +Cc: linux-kernel



> -----Original Message-----
> From: Martin Knoblauch [mailto:Martin.Knoblauch@TeraPort.de]
> Sent: Tuesday, April 23, 2002 8:51 AM
> Subject: Re: [PATCH] reboot=bios is invalidating cache incorrectly
> 
> 
> > [PATCH] reboot=bios is invalidating cache incorrectly
> > 
> > 
> > This patch applies cleanly to 2.4.18 and 2.5.8. It probably 
> also works
> > with all 2.2.x, 2.4.x and 2.5.x kernels.
> > 
> > This fixes a long standing bug that prevented reliable 
> reboots on some
> > platforms.
> > 
> Robert,
> 
>  care to specify which platforms? :-) I ask because I am experiencing
> reboot hangs between BISO and lilo on Tyan 2462 boards. Apparently
> others see similar things.
> 

Martin,

I only have extensive experience with Dell's Server platforms.  But because
of the nature of the error, it can happen on any platform using reboot=bios.

On the platforms I was debugging.. invalidating the cache left a bunch of
ADD's in memory followed by a JMP to itself.  So you would see the message
"rebooting system" but then you would never get a blank screen and BIOS
posting (the reboot vector was never called).

- Robert

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] reboot=bios is invalidating cache incorrectly
@ 2002-04-19 22:00 Robert Hentosh
  2002-04-24 18:10 ` Jamie Lokier
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Hentosh @ 2002-04-19 22:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: johnsonm, alan, arjanv


Sorry for the trashed email and patch.  Apparently Outlook knows better 
than I where to do word wrapping on patches.

Here it is again from pine.



When specifying the kernel parameter reboot=bios the assembly code that is 
executed to switch to real mode and call the bios vector contains an 
error.  This causes rebooting via bios to hang in certain conditions.

The hand assembled routine contained in the array "real_mode_switch" 
contains INVD which invalidates the CPU caches, unfortunately the routine 
was just previously copied via memcpy and is contained in the cache.  This 
leads to unexpected results.  The following patch replaces INVD with 
WBINVD which will insure that the routine is written to RAM before 
invalidating the cache, providing more reliable reboots.

This patch applies cleanly to 2.4.18 and 2.5.8.  It probably also works 
with all 2.2.x, 2.4.x and 2.5.x kernels.

This fixes a long standing bug that prevented reliable reboots on some 
platforms.


Regards,
Robert Hentosh


--
Robert Hentosh
Sr. Software Engineer
Dell Linux Solutions www.dell.com/linux


--- linux-2.4.18.orig/arch/i386/kernel/process.c	Fri Apr 19 14:37:21 2002
+++ linux-2.4.18/arch/i386/kernel/process.c	Fri Apr 19 14:41:11 2002
@@ -253,7 +253,7 @@
 	0x66, 0x0f, 0x20, 0xc3,			/*    movl  %cr0,%ebx        */
 	0x66, 0x81, 0xe3, 0x00, 0x00, 0x00, 0x60,	/*    andl  $0x60000000,%ebx */
 	0x74, 0x02,				/*    jz    f                */
-	0x0f, 0x08,				/*    invd                   */
+	0x0f, 0x09,				/*    wbinvd                 */
 	0x24, 0x10,				/* f: andb  $0x10,al         */
 	0x66, 0x0f, 0x22, 0xc0			/*    movl  %eax,%cr0        */
 };



^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] reboot=bios is invalidating cache incorrectly
@ 2002-04-19 20:21 Robert_Hentosh
  0 siblings, 0 replies; 5+ messages in thread
From: Robert_Hentosh @ 2002-04-19 20:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: johnsonm, alan, arjanv


When specifying the kernel parameter reboot=bios the assembly code that is
executed to switch to real mode and call the bios vector contains an error.
This causes rebooting via bios to hang in certain conditions.

The hand assembled routine contained in the array "real_mode_switch"
contains INVD which invalidates the CPU caches, unfortunately the routine
was just previously copied via memcpy and is contained in the cache. This
leads to unexpected results. The following patch replaces INVD with WBINVD
which will make sure that the routine is written to RAM before invalidating
the cache, providing more reliable reboots.

This patch applies cleanly to 2.4.18 and 2.5.8.  It probably also works with
all 2.2.X, 2.4.X and 2.5.X kernels.

This fixes a long standing bug that prevented reliable reboots on some
platforms.


Regards,
Robert Hentosh


--
Robert Hentosh
Sr. Software Engineer
Dell Linux Solutions www.dell.com/linux


--- linux-2.4.18.orig/arch/i386/kernel/process.c	Fri Apr 19 14:37:21
2002
+++ linux-2.4.18/arch/i386/kernel/process.c	Fri Apr 19 14:41:11 2002
@@ -253,7 +253,7 @@
 	0x66, 0x0f, 0x20, 0xc3,			/*    movl  %cr0,%ebx
*/
 	0x66, 0x81, 0xe3, 0x00, 0x00, 0x00, 0x60,	/*    andl
$0x60000000,%ebx */
 	0x74, 0x02,				/*    jz    f
*/
-	0x0f, 0x08,				/*    invd
*/
+	0x0f, 0x09,				/*    wbinvd
*/
 	0x24, 0x10,				/* f: andb  $0x10,al
*/
 	0x66, 0x0f, 0x22, 0xc0			/*    movl  %eax,%cr0
*/
 };

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

end of thread, other threads:[~2002-04-24 18:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-23 13:51 [PATCH] reboot=bios is invalidating cache incorrectly Martin Knoblauch
  -- strict thread matches above, loose matches on Subject: below --
2002-04-23 20:02 Robert_Hentosh
2002-04-19 22:00 Robert Hentosh
2002-04-24 18:10 ` Jamie Lokier
2002-04-19 20:21 Robert_Hentosh

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