public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
To: Hiroshi 2 Itoh <HIROIT-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	"Li,
	Shaohua" <shaohua.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Brown, Len" <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] GDT table patch for resume only reboots problem
Date: Sun, 17 Oct 2004 22:42:37 +0200	[thread overview]
Message-ID: <20041017204237.GA23733@elf.ucw.cz> (raw)
In-Reply-To: <OFC0526CFC.7FFB98D1-ON49256F30.0068372D-49256F30.006EF530-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>

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. :-)

(Please inline patches to make commenting on them easier)

--- 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

It is ugly to do this kind of computation during resume time (where it
is impossible to debug). It could be done in suspend time and resume
path could stay the same, right?
								Pavel

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!


-------------------------------------------------------
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

  parent reply	other threads:[~2004-10-17 20:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [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

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=20041017204237.GA23733@elf.ucw.cz \
    --to=pavel-+zi9xunit7i@public.gmane.org \
    --cc=HIROIT-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=shaohua.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /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