From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@suse.cz>
Subject: 2.6.9-final: urgent swsusp patch missing
Date: Mon, 18 Oct 2004 14:51:47 +0200 [thread overview]
Message-ID: <200410181451.47225.rjw@sisk.pl> (raw)
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
Andrew,
The attached Pavel's patch for swsusp is missing from 2.6.9-final. It is an
urgent bugfix, so please consider including it into 2.6.9.
Greets,
RJW
--
- 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"
[-- Attachment #2: 2.6.9-rc3-swsusp-fix-x86-64-do-not-use-memory-in-copy-loop.patch --]
[-- Type: text/x-diff, Size: 2461 bytes --]
Hi!
In assembly code, there are some problems with "nosave" section
(linker was doing something stupid, like duplicating the section). We
attempted to fix it, but fix was worse then first problem. This fixes
is for good: We no longer use any memory in the copy loop. (Plus it
fixes indentation and uses meaningfull labels.)
Patch is against 2.6.9-rc3. -mm has sligtly different version, with
more text on ".section .data.nosave" line. Those lines should really
be removed.
Pavel
--- clean/arch/x86_64/kernel/suspend_asm.S 2004-10-01 00:30:08.000000000 +0200
+++ linux/arch/x86_64/kernel/suspend_asm.S 2004-10-02 18:35:04.000000000 +0200
@@ -39,29 +39,28 @@
/* set up cr3 */
leaq init_level4_pgt(%rip),%rax
subq $__START_KERNEL_map,%rax
- movq %rax,%cr3
+ movq %rax,%cr3
movq mmu_cr4_features(%rip), %rax
movq %rax, %rdx
-
andq $~(1<<7), %rdx # PGE
- movq %rdx, %cr4; # turn off PGE
- movq %cr3, %rcx; # flush TLB
- movq %rcx, %cr3;
- movq %rax, %cr4; # turn PGE back on
+ movq %rdx, %cr4; # turn off PGE
+ movq %cr3, %rcx; # flush TLB
+ movq %rcx, %cr3;
+ movq %rax, %cr4; # turn PGE back on
movl nr_copy_pages(%rip), %eax
xorl %ecx, %ecx
- movq $0, loop(%rip)
+ movq $0, %r10
testl %eax, %eax
- je .L108
+ jz done
.L105:
xorl %esi, %esi
- movq $0, loop2(%rip)
+ movq $0, %r11
jmp .L104
.p2align 4,,7
-.L111:
- movq loop(%rip), %rcx
+copy_one_page:
+ movq %r10, %rcx
.L104:
movq pagedir_nosave(%rip), %rdx
movq %rcx, %rax
@@ -71,27 +70,26 @@
movzbl (%rsi,%rax), %eax
movb %al, (%rsi,%rcx)
- movq %cr3, %rax; # flush TLB
- movq %rax, %cr3;
+ movq %cr3, %rax; # flush TLB
+ movq %rax, %cr3;
- movq loop2(%rip), %rax
+ movq %r11, %rax
incq %rax
cmpq $4095, %rax
movq %rax, %rsi
- movq %rax, loop2(%rip)
- jbe .L111
- movq loop(%rip), %rax
+ movq %rax, %r11
+ jbe copy_one_page
+ movq %r10, %rax
incq %rax
movq %rax, %rcx
- movq %rax, loop(%rip)
+ movq %rax, %r10
mov nr_copy_pages(%rip), %eax
cmpq %rax, %rcx
jb .L105
-.L108:
- .align 4
+done:
movl $24, %eax
-
- movl %eax, %ds
+ movl %eax, %ds
+
movq saved_context_esp(%rip), %rsp
movq saved_context_ebp(%rip), %rbp
movq saved_context_eax(%rip), %rax
@@ -111,10 +109,3 @@
pushq saved_context_eflags(%rip) ; popfq
call swsusp_restore
ret
-
- .section .data.nosave
-loop:
- .quad 0
-loop2:
- .quad 0
- .previous
--
next reply other threads:[~2004-10-18 12:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-18 12:51 Rafael J. Wysocki [this message]
2004-10-18 13:01 ` 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=200410181451.47225.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=akpm@osdl.org \
--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®