public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] GDT table patch for resume only reboots problem
@ 2004-10-17 20:17 Hiroshi 2 Itoh
       [not found] ` <OFC0526CFC.7FFB98D1-ON49256F30.0068372D-49256F30.006EF530-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 23+ messages in thread
From: Hiroshi 2 Itoh @ 2004-10-17 20:17 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Li, Shaohua, Brown, Len, Pavel Machek

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





Hi,

Using 2.6.9 RC4 kernel + Shaohua-san's wakeup patch, my test machine
resumes just before
ljmpl $__KERNEL_CS,$wakeup_pmode_return in wakeup.S.
(This is confirmed by parallel port(0x3bc) out like BIOS steping number.)

The code would not come back to wakeup_pmode_return entry and goes to
reboot. After fairly tough debugging, it is found that the original GDT
pointed by GDTR cannot be accessed from real mode. (This may occurr
especially when CR4 PSE bit is on.)

The following patch will partially copy the GDT into low memory to be
addressable.
(See attached file: wakeup_gdt.patch)

I hope most of machines can resume with;

Kernel 2.6.9 RC4
+wakeup_addr.patch
+wakeup_gdt.patch

If you cannot see the screen normally after resume, "acpi_sleep=s3_bios"
boot option is available to reset the video mode.
(My ThinkPad is still in trouble with HDD access after resume because of
unknown reason. :-)

Regards, Hiro.

[-- Attachment #2: wakeup_gdt.patch --]
[-- Type: application/octet-stream, Size: 1142 bytes --]

--- a/arch/i386/kernel/acpi/wakeup.S	2004-08-14 14:36:31.000000000 +0900
+++ b/arch/i386/kernel/acpi/wakeup.S	2004-10-18 04:30:53.684987016 +0900
@@ -67,6 +67,13 @@
 	movw	$0x0e00 + 'i', %fs:(0x12)
 	
 	# need a gdt
+	# use the gdt copied in this low mem
+	lea     temp_gdt_table - wakeup_code, %eax
+	xor     %ebx, %ebx
+	movw    %ds, %bx
+	shll    $4, %ebx
+	addl    %ebx, %eax
+	movl    %eax, real_save_gdt + 2 - wakeup_code
 	lgdt	real_save_gdt - wakeup_code
 
 	movl	real_save_cr0 - wakeup_code, %eax
@@ -89,6 +96,7 @@
 real_magic:	.long 0
 video_mode:	.long 0
 video_flags:	.long 0
+temp_gdt_table: .fill GDT_ENTRIES, 8, 0
 
 bogus_real_magic:
 	movw	$0x0e00 + 'B', %fs:(0x12)
@@ -231,6 +239,14 @@
 	movl	%edx, real_save_cr0 - wakeup_start (%eax)
 	sgdt    real_save_gdt - wakeup_start (%eax)
 
+	# gdt body must be addressable from real mode by
+	# partially copying it to the lower mem
+	xor     %ecx, %ecx
+	movw    saved_gdt, %cx
+	movl    saved_gdt + 2, %esi
+	lea     temp_gdt_table - wakeup_start (%eax), %edi
+	rep movsb
+
 	movl	saved_videomode, %edx
 	movl	%edx, video_mode - wakeup_start (%eax)
 	movl	acpi_video_flags, %edx

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [PATCH] GDT table patch for resume only reboots problem
@ 2004-10-20 19:29 Hiroshi 2 Itoh
  0 siblings, 0 replies; 23+ messages in thread
From: Hiroshi 2 Itoh @ 2004-10-20 19:29 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f





>Instead, I test my machine to write a byte value on I/O port 0x3bc. This
>is the parallel port's output register to be latched and observable if you
>have a simple hardware decoder with 7 segment LEDs. <- do it yourself work
>is required. :-)

Matthew,

My diagnostic tool consists of one 74LN373 chip and two 7-segment LEDs with
Dsub 25 pin + PS2
mouse cable to get +5V only from the mouse connecter.

It seems that there is a company to sell such a POST card.
http://tech.parvus.com/item_info.asp?Item=PRV-0867X-01

- Hiro



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl

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

end of thread, other threads:[~2004-11-01 14:43 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-17 20:17 [PATCH] GDT table patch for resume only reboots problem Hiroshi 2 Itoh
     [not found] ` <OFC0526CFC.7FFB98D1-ON49256F30.0068372D-49256F30.006EF530-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>
2004-10-17 20:42   ` Pavel Machek
     [not found]     ` <20041017204237.GA23733-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-10-17 20:55       ` Hiroshi 2 Itoh
     [not found]         ` <OF7ADB0768.86CB3789-ON49256F30.007218BA-49256F30.00727752-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>
2004-10-17 21:00           ` Pavel Machek
     [not found]             ` <20041017210052.GB23733-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-10-18 20:38               ` Hiroshi 2 Itoh
     [not found]                 ` <OFD3267728.221C77BC-ON49256F31.006D2ECA-49256F31.0070E4AF-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>
2004-10-19 11:39                   ` Pavel Machek
2004-10-20  0:58                   ` Matthew Garrett
2004-10-20 18:36                     ` Hiroshi 2 Itoh
     [not found]                       ` <OF713F042E.6095AA90-ON49256F33.00637EC8-49256F33.0065C963-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>
2004-10-22 10:53                         ` Pavel Machek
     [not found]                           ` <20041022105340.GB1330-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-10-23 10:47                             ` Hiroshi 2 Itoh
2004-10-23  0:34                         ` Matthew Garrett
2004-10-23  2:00                           ` Matthew Garrett
2004-10-23 11:01                             ` Hiroshi 2 Itoh
     [not found]                               ` <OF7ADC5954.7B192D8D-ON49256F36.003BC992-49256F36.003C1DA9-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>
2004-10-23 11:13                                 ` Matthew Garrett
2004-10-23 12:05                                   ` Hiroshi 2 Itoh
     [not found]                                     ` <OF38C223A3.5509B742-ON49256F36.00412958-49256F36.0041FAA1-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>
2004-10-23 12:44                                       ` Matthew Garrett
2004-11-01 14:43                                         ` Matthew Garrett
2004-10-24 19:44                                   ` Nate Lawson
2004-10-17 21:02   ` Alberto Piai
     [not found]     ` <20041017230205.2e50de4c.albeclemit-whZMOeQn8C0@public.gmane.org>
2004-10-17 23:38       ` Pavel Machek
     [not found]         ` <20041017233819.GA13680-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-10-18  9:58           ` Alberto Piai
     [not found]             ` <20041018115839.6c67f6a9.albeclemit-whZMOeQn8C0@public.gmane.org>
2004-10-18 10:15               ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2004-10-20 19:29 Hiroshi 2 Itoh

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