All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
To: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Andreas Steinmetz <ast@domdv.de>,
	Dave Jones <davej@codemonkey.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: amd64-agp vs. swsusp
Date: Thu, 21 Jul 2005 12:43:30 +0200	[thread overview]
Message-ID: <42DF7C52.4020907@stud.feec.vutbr.cz> (raw)
In-Reply-To: <20050721053126.GB5230@atrey.karlin.mff.cuni.cz>

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

Pavel Machek wrote:
> Long time ago there were i386 problems because we assumed that kernel
> is mapped in one big mapping and agp broke that assumption. Copying
> pages backwards "fixed" it (and then we done proper fix). It should
> not be, but it seems similar to this problem....

Do you mean this patch of yours?:
http://www.ussg.iu.edu/hypermail/linux/kernel/0404.3/0640.html

I'm trying to do something similar for x86_64. See the attached patch.
Unfortunately, it doesn't help. The behaviour seems unchanged (resume 
still works iff amd64-agp wasn't loaded before suspend).

Michal

[-- Attachment #2: swsusp-amd64-pgdir.diff --]
[-- Type: text/x-patch, Size: 1497 bytes --]

diff -Nurp -X dontdiff.new linux-mm/arch/x86_64/kernel/suspend_asm.S linux-mm.mich/arch/x86_64/kernel/suspend_asm.S
--- linux-mm/arch/x86_64/kernel/suspend_asm.S	2005-06-30 01:00:53.000000000 +0200
+++ linux-mm.mich/arch/x86_64/kernel/suspend_asm.S	2005-07-21 11:53:17.000000000 +0200
@@ -41,7 +41,7 @@ ENTRY(swsusp_arch_suspend)
 
 ENTRY(swsusp_arch_resume)
 	/* set up cr3 */	
-	leaq	init_level4_pgt(%rip),%rax
+	leaq	swsusp_level4_pgt(%rip),%rax
 	subq	$__START_KERNEL_map,%rax
 	movq	%rax,%cr3
 
diff -Nurp -X dontdiff.new linux-mm/arch/x86_64/mm/init.c linux-mm.mich/arch/x86_64/mm/init.c
--- linux-mm/arch/x86_64/mm/init.c	2005-07-18 19:48:12.000000000 +0200
+++ linux-mm.mich/arch/x86_64/mm/init.c	2005-07-21 11:21:36.000000000 +0200
@@ -310,10 +310,32 @@ void __init init_memory_mapping(unsigned
 
 extern struct x8664_pda cpu_pda[NR_CPUS];
 
+#ifdef CONFIG_SOFTWARE_SUSPEND
+/*
+ * Swap suspend & friends need this for resume because things like the intel-agp
+ * driver might have split up a kernel 4MB mapping.
+ */
+char __nosavedata swsusp_level4_pgt[PAGE_SIZE]
+	__attribute__ ((aligned (PAGE_SIZE)));
+
+static inline void save_pg_dir(void)
+{
+	memcpy(swsusp_level4_pgt, init_level4_pgt, PAGE_SIZE);
+}
+#else
+static inline void save_pg_dir(void)
+{
+}
+#endif
+
 /* Assumes all CPUs still execute in init_mm */
 void zap_low_mappings(void)
 {
-	pgd_t *pgd = pgd_offset_k(0UL);
+	pgd_t *pgd;
+
+	save_pg_dir();
+
+	pgd = pgd_offset_k(0UL);
 	pgd_clear(pgd);
 	flush_tlb_all();
 }

  reply	other threads:[~2005-07-21 10:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-19 20:51 amd64-agp vs. swsusp Michal Schmidt
2005-07-19 21:03 ` Andreas Steinmetz
2005-07-19 21:26   ` Michal Schmidt
2005-07-20  9:15     ` Rafael J. Wysocki
2005-07-20 22:07       ` Michal Schmidt
2005-07-20 23:23         ` Rafael J. Wysocki
2005-07-21  1:25           ` Michal Schmidt
2005-07-21  9:41             ` Rafael J. Wysocki
2005-07-21  5:31         ` Pavel Machek
2005-07-21 10:43           ` Michal Schmidt [this message]
2005-07-21 15:20             ` Pavel Machek
2005-07-21 15:24               ` Michal Schmidt
2005-07-21 20:05                 ` Rafael J. Wysocki
2005-08-04 21:25 ` Andrew Morton
2005-08-04 21:40   ` Pavel Machek
2005-08-07 22:17     ` Michal Schmidt
2005-08-04 21:54   ` Cal Peake
2005-08-05 10:32     ` Andreas Steinmetz
2005-08-05 22:38       ` Cal Peake
2005-08-06 10:40         ` Andreas Steinmetz

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=42DF7C52.4020907@stud.feec.vutbr.cz \
    --to=xschmi00@stud.feec.vutbr.cz \
    --cc=ast@domdv.de \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.