linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix reloading GDT on ACPI S3 wakeup
@ 2005-04-08 16:14 Juerg Billeter
  2005-04-11 17:17 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Juerg Billeter @ 2005-04-08 16:14 UTC (permalink / raw)
  To: len.brown; +Cc: linux-kernel

Hi

This patch - based on
http://marc.theaimsgroup.com/?l=linux-kernel&m=110055503031009&w=2 -
makes ACPI S3 wakeup work for me on a ThinkPad T40p laptop with a SMP
kernel. Without it only UP kernels work. I've been using the patch for
three months now without any issues.

The ACPI resume code currently uses a real-mode 16-bit lgdt instruction
to reload the GDT.  This only restores the lower 24 bits of the GDT base
address.  In recent SMP kernels, the GDT seems to have moved out of the
lower 16 megs, thereby causing the ACPI resume to fail -- an invalid GDT
was being loaded.

Regards,

Juerg

--
Signed-off-by: Juerg Billeter <juerg@paldo.org>

diff -uNr linux-2.6.10.orig/arch/i386/kernel/acpi/wakeup.S linux-2.6.10/arch/i386/kernel/acpi/wakeup.S
--- linux-2.6.10.orig/arch/i386/kernel/acpi/wakeup.S	2004-12-24 22:34:26.000000000 +0100
+++ linux-2.6.10/arch/i386/kernel/acpi/wakeup.S	2005-01-08 23:34:38.551471486 +0100
@@ -74,8 +74,9 @@
 	movw	%ax,%fs
 	movw	$0x0e00 + 'i', %fs:(0x12)
 	
-	# need a gdt
-	lgdt	real_save_gdt - wakeup_code
+	# need a gdt -- use lgdtl to force 32-bit operands, in case
+	# the GDT is located past 16 megabytes
+	lgdtl	real_save_gdt - wakeup_code
 
 	movl	real_save_cr0 - wakeup_code, %eax
 	movl	%eax, %cr0



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

* Re: [PATCH] Fix reloading GDT on ACPI S3 wakeup
  2005-04-08 16:14 [PATCH] Fix reloading GDT on ACPI S3 wakeup Juerg Billeter
@ 2005-04-11 17:17 ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2005-04-11 17:17 UTC (permalink / raw)
  To: Juerg Billeter; +Cc: linux-kernel

I've applied Nickolai's patch -- thanks for the ping.

-Len

On Fri, 2005-04-08 at 12:14, Juerg Billeter wrote:
> Hi
> 
> This patch - based on
> http://marc.theaimsgroup.com/?l=linux-kernel&m=110055503031009&w=2 -
> makes ACPI S3 wakeup work for me on a ThinkPad T40p laptop with a SMP
> kernel. Without it only UP kernels work. I've been using the patch for
> three months now without any issues.
> 
> The ACPI resume code currently uses a real-mode 16-bit lgdt
> instruction
> to reload the GDT.  This only restores the lower 24 bits of the GDT
> base
> address.  In recent SMP kernels, the GDT seems to have moved out of
> the
> lower 16 megs, thereby causing the ACPI resume to fail -- an invalid
> GDT
> was being loaded.
> 
> Regards,
> 
> Juerg
> 
> --
> Signed-off-by: Juerg Billeter <juerg@paldo.org>
> 
> diff -uNr linux-2.6.10.orig/arch/i386/kernel/acpi/wakeup.S
> linux-2.6.10/arch/i386/kernel/acpi/wakeup.S
> --- linux-2.6.10.orig/arch/i386/kernel/acpi/wakeup.S    2004-12-24
> 22:34:26.000000000 +0100
> +++ linux-2.6.10/arch/i386/kernel/acpi/wakeup.S 2005-01-08
> 23:34:38.551471486 +0100
> @@ -74,8 +74,9 @@
>         movw    %ax,%fs
>         movw    $0x0e00 + 'i', %fs:(0x12)
>        
> -       # need a gdt
> -       lgdt    real_save_gdt - wakeup_code
> +       # need a gdt -- use lgdtl to force 32-bit operands, in case
> +       # the GDT is located past 16 megabytes
> +       lgdtl   real_save_gdt - wakeup_code
> 
>         movl    real_save_cr0 - wakeup_code, %eax
>         movl    %eax, %cr0
> 
> 
> 
> 


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

end of thread, other threads:[~2005-04-11 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-08 16:14 [PATCH] Fix reloading GDT on ACPI S3 wakeup Juerg Billeter
2005-04-11 17:17 ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).