public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* swsusp: fix swsusp with intel-agp
@ 2004-05-21 10:07 Pavel Machek
  2004-05-21 11:05 ` Herbert Xu
  2004-05-21 23:20 ` Andrew Morton
  0 siblings, 2 replies; 22+ messages in thread
From: Pavel Machek @ 2004-05-21 10:07 UTC (permalink / raw)
  To: kernel list, Andrew Morton

Hi!

swsusp contained rather nasty bug where it killed machine when
intel-agp or anything else split kernel 4MB mapping. Herbert Xu
diagnosed this. Fixed by switching to "known good" mapping for during
suspend/resume.

Please apply,
							Pavel

--- tmp/linux/arch/i386/mm/init.c	2004-05-20 23:08:05.000000000 +0200
+++ linux/arch/i386/mm/init.c	2004-05-20 23:10:50.000000000 +0200
@@ -331,6 +331,13 @@
 void zap_low_mappings (void)
 {
 	int i;
+
+#ifdef CONFIG_SOFTWARE_SUSPEND
+	{
+		extern char swsusp_pg_dir[PAGE_SIZE];
+		memcpy(swsusp_pg_dir, swapper_pg_dir, PAGE_SIZE);
+	}
+#endif
 	/*
 	 * Zap initial low-memory mappings.
 	 *
--- tmp/linux/arch/i386/power/cpu.c	2004-05-20 23:08:05.000000000 +0200
+++ linux/arch/i386/power/cpu.c	2004-05-20 23:10:50.000000000 +0200
@@ -35,6 +35,10 @@
 unsigned long saved_context_esi, saved_context_edi;
 unsigned long saved_context_eflags;
 
+/* Special page directory for resume */
+char __nosavedata swsusp_pg_dir[PAGE_SIZE]
+                  __attribute__ ((aligned (PAGE_SIZE)));
+
 extern void enable_sep_cpu(void *);
 
 void save_processor_state(void)
--- tmp/linux/arch/i386/power/swsusp.S	2004-05-20 23:08:05.000000000 +0200
+++ linux/arch/i386/power/swsusp.S	2004-05-20 23:11:05.000000000 +0200
@@ -36,7 +38,7 @@
 	jmp .L1449
 	.p2align 4,,7
 .L1450:
-	movl $swapper_pg_dir-__PAGE_OFFSET,%ecx
+	movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
 	movl %ecx,%cr3
 
 	call do_magic_resume_1
@@ -56,8 +58,6 @@
 	movl (%ecx,%eax),%eax
 	movb (%edx,%eax),%al
 	movb %al,(%edx,%ebx)
-	movl %cr3, %eax;              
-	movl %eax, %cr3;  # flush TLB 
 
 	movl loop2,%eax
 	leal 1(%eax),%edx
--- tmp/linux/include/asm-i386/suspend.h	2003-09-28 22:06:36.000000000 +0200
+++ linux/include/asm-i386/suspend.h	2004-04-27 23:10:24.000000000 +0200
@@ -9,6 +9,9 @@
 static inline int
 arch_prepare_suspend(void)
 {
+	/* If you want to make non-PSE machine work, turn off paging
+           in do_magic. swsusp_pg_dir should have identity mapping, so
+           it could work...  */
 	if (!cpu_has_pse)
 		return -EPERM;
 	return 0;

-- 
934a471f20d6580d5aad759bf0d97ddc

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

end of thread, other threads:[~2004-05-23 21:32 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-21 10:07 swsusp: fix swsusp with intel-agp Pavel Machek
2004-05-21 11:05 ` Herbert Xu
2004-05-21 11:16   ` Pavel Machek
2004-05-21 11:18     ` Herbert Xu
2004-05-21 11:22       ` Herbert Xu
2004-05-21 11:41         ` Pavel Machek
2004-05-21 11:48           ` Herbert Xu
2004-05-21 11:51             ` Pavel Machek
2004-05-21 13:06           ` Nigel Cunningham
2004-05-21 13:19             ` Pavel Machek
2004-05-21 13:18               ` Nigel Cunningham
2004-05-21 13:26                 ` Herbert Xu
2004-05-21 13:22               ` Herbert Xu
2004-05-21 11:23     ` swsusp vs. pmdisk [was Re: swsusp: fix swsusp with intel-agp] Pavel Machek
2004-05-21 11:25       ` Herbert Xu
2004-05-21 11:49         ` Pavel Machek
2004-05-22  2:10   ` swsusp: fix swsusp with intel-agp Andrew Morton
2004-05-21 23:20 ` Andrew Morton
2004-05-23 17:54   ` Pavel Machek
2004-05-23 20:08     ` Andrew Morton
2004-05-23 20:24       ` Pavel Machek
2004-05-23 21:27       ` Nigel Cunningham

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