mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@suse.cz>
Cc: Andrew Morton <akpm@zip.com.au>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: swsusp: Remove arch-specific references from generic code
Date: Sat, 19 Mar 2005 11:59:32 +0100	[thread overview]
Message-ID: <200503191159.32569.rjw@sisk.pl> (raw)
In-Reply-To: <20050316001207.GI21292@elf.ucw.cz>

Hi,

On Wednesday, 16 of March 2005 01:12, Pavel Machek wrote:
> Hi!
> 
> This is fix for "swsusp_restore crap"-: we had some i386-specific code
> referenced from generic code. This fixes it by inlining tlb_flush_all
> into assembly.
> 
> Please apply,

Unfortunately, this patch requires the following fix.  Without it, swsusp will
leak lots of memory on every resume.  Sorry for this bug, it was really dumb.

Rafael


Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

diff -Nrup linux-2.6.12-rc1-a/arch/i386/power/swsusp.S linux-2.6.12-rc1-b/arch/i386/power/swsusp.S
--- linux-2.6.12-rc1-a/arch/i386/power/swsusp.S	2005-03-19 11:51:02.000000000 +0100
+++ linux-2.6.12-rc1-b/arch/i386/power/swsusp.S	2005-03-19 11:52:37.000000000 +0100
@@ -68,4 +68,6 @@ done:
 
 	pushl saved_context_eflags ; popfl
 
+	xorl	%eax, %eax
+
 	ret
diff -Nrup linux-2.6.12-rc1-a/arch/x86_64/kernel/suspend_asm.S linux-2.6.12-rc1-b/arch/x86_64/kernel/suspend_asm.S
--- linux-2.6.12-rc1-a/arch/x86_64/kernel/suspend_asm.S	2005-03-19 11:51:02.000000000 +0100
+++ linux-2.6.12-rc1-b/arch/x86_64/kernel/suspend_asm.S	2005-03-19 11:52:10.000000000 +0100
@@ -83,7 +83,7 @@ done:
 
 	movq saved_context_esp(%rip), %rsp
 	movq saved_context_ebp(%rip), %rbp
-	movq saved_context_eax(%rip), %rax
+	/* Don't restore %rax, it must be 0 */
 	movq saved_context_ebx(%rip), %rbx
 	movq saved_context_ecx(%rip), %rcx
 	movq saved_context_edx(%rip), %rdx
@@ -99,4 +99,6 @@ done:
 	movq saved_context_r15(%rip), %r15
 	pushq saved_context_eflags(%rip) ; popfq
 
+	xorq	%rax, %rax
+
 	ret

-- 
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"

  reply	other threads:[~2005-03-19 10:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-16  0:12 Pavel Machek
2005-03-19 10:59 ` Rafael J. Wysocki [this message]
2005-03-19 21:28   ` Andrew Morton
2005-03-19 21:32     ` Pavel Machek
2005-03-19 22:07     ` Pavel Machek
2005-03-20  0:29       ` Rafael J. Wysocki
2005-03-20 19:24         ` swsusp smp problems... [was Re: swsusp: Remove arch-specific references from generic code] Pavel Machek
2005-03-21 10:34           ` Rafael J. Wysocki
2005-03-21 10:41             ` Pavel Machek
2005-03-22 23:14               ` Rafael J. Wysocki
2005-03-20 19:35         ` swsusp: Remove arch-specific references from generic code Pavel Machek

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=200503191159.32569.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    /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

all inboxes | Powered by JetHome®