linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>, LKML <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@suse.de>, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH][Fix] Fix Bug #4959 (take 2)
Date: Tue, 27 Sep 2005 15:32:19 +0200	[thread overview]
Message-ID: <20050927133218.GB9484@openzaurus.ucw.cz> (raw)
In-Reply-To: <200509271007.03865.rjw@sisk.pl>

Hi!

I do not really like new exports from swsusp.c, but I'm afraid
there's no way around.

> The following patch fixes Bug #4959.  For this purpose it creates temporary
> page translation tables including the kernel mapping (reused) and the direct
> mapping (created from scratch) and makes swsusp switch to these tables
> right before the image is restored.

Why do you need *two* mappings? Should not just kernel mapping be enough?

> NOTES:
> (1) I'm quite sure that to fix the problem we need to use temporary page
> translation tables that won't be modified in the process of copying the image.
> (2) These page translation tables have to be present in memory before the
> image is copied, so there are two possible ways in which they can be created:
> 	(a) in the startup kernel code that is executed before calling swsusp
> 	on resume, in which case they have to be marked with PG_nosave,
> 	(b) in swsusp, after the image has been loaded from disk (to set up
> 	the tables we need to know which pages will be overwritten while
> 	copying the image).
> However, (a) is tricky, because it will only work if the tables are always located
> at the same physical addresses, which I think would be quite difficult to achieve.

Why? Reserve ten pages for them... static char resume_page_tables[10*PAGE_SIZE] does not
sound that bad.

> Moreover, such a code would have to be executed on every boot and the
> temporary page tables would always be present in memory.

Yep, but I do not see that as a big problem.


-- 
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms         


  reply	other threads:[~2005-09-27 18:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-24 17:36 [PATCH][Fix] Prevent swsusp from corrupting page translation tables during resume on x86-64 Rafael J. Wysocki
2005-09-25 22:07 ` Pavel Machek
2005-09-26 10:46   ` Rafael J. Wysocki
2005-09-26 10:49     ` Pavel Machek
2005-09-27  8:07 ` [PATCH][Fix] Fix Bug #4959 (take 2) Rafael J. Wysocki
2005-09-27 13:32   ` Pavel Machek [this message]
2005-09-27 21:00     ` Rafael J. Wysocki
2005-09-27 21:08       ` Pavel Machek
2005-09-27 23:26         ` Rafael J. Wysocki
2005-09-27 23:43           ` Pavel Machek
2005-09-28  8:25             ` Rafael J. Wysocki
2005-09-28 10:29 ` [PATCH][Fix] Fix Bug #4959 (take 3) Rafael J. Wysocki

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=20050927133218.GB9484@openzaurus.ucw.cz \
    --to=pavel@suse.cz \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).