From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@suse.cz>
Cc: Andi Kleen <ak@suse.de>,
discuss@x86-64.org, Andrew Morton <akpm@osdl.org>,
LKML <linux-kernel@vger.kernel.org>,
"Siddha, Suresh B" <suresh.b.siddha@intel.com>
Subject: Re: [discuss] Re: [PATCH][Fix][Resend] Fix Bug #4959: Page tables corrupted during resume on x86-64 (take 3)
Date: Thu, 29 Sep 2005 13:25:47 +0200 [thread overview]
Message-ID: <200509291325.48011.rjw@sisk.pl> (raw)
In-Reply-To: <20050928223535.GA2010@elf.ucw.cz>
Hi,
On Thursday, 29 of September 2005 00:35, Pavel Machek wrote:
> Hi!
>
> > > > > > 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.
> > > > > >
> > > > > > The code that generates the direct mapping is based on the code in
> > > > > > arch/x86_64/mm/init.c.
> > > > >
> > > > > Looks much better than before, but is there any reason you cannot
> > > > > share the code with the mm/init.c code?
> > > >
> > > > I think so. I have to make the temporary page tables nosavedata or set
> > > > PG_nosave on them, so that swsusp doesn't overwrite them. I'm not
> > > > sure if I could do this cleanly if I used the code from mm/init.c directly.
> > >
> > > Just pass a flag for that.
> >
> > Well, the code in mm/init.c is only executed really early, before zones
> > are initialized, and it uses alloc_low_page() to map memory. Thus it seems
> > I only could make my code be executed next to init_memory_mapping(),
> > in which case I wouldn't be able to use page flags. Apparently I'm missing
> > something but now I'm too tired to think efficiently.
>
> I guess Andi meant "add a parameter to those mm/init.c functions".
Ahh, ok.
This does not seem to be enough, however, because the original code
in mm/init.c is __init, so I can't call it during resume. Moreover, it calls
some more __init functions, so to use it I'll have to move the allocation
of the resume temporary page tables to the kernel initialization code.
If I do this, I'll have to mark the allocated pages as nosave (see below)
and make sure they will always get the same physical addresses. I am
going to see if I can do this, but I need some time.
Anyway this could be a long-term solution, but in the short term the bug
is there and needs fixing ASAP. One good thing about the current
solution is that it does not break anything outside of swsusp _for_ _sure_.
> (Otoh, you have reserved area, anyway, just set all of it PG_nosave,
> and you'll not need to modify mm/init.c stuff).
Rather I've reserved a set of individual pages that are only linked
via the page tables structure. IMO it's better to mark them as nosave
as soon as they get allocated or I'll need to browse the entire
structure to do this. Also, I need to make them get always the
same physical addresses and tell the memory management
they are not free.
Greetings,
Rafael
next prev parent reply other threads:[~2005-09-29 11:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-28 14:24 [PATCH][Fix][Resend] Fix Bug #4959: Page tables corrupted during resume on x86-64 (take 3) Rafael J. Wysocki
2005-09-28 19:18 ` Andi Kleen
2005-09-28 20:24 ` Rafael J. Wysocki
2005-09-28 20:33 ` [discuss] " Andi Kleen
2005-09-28 22:11 ` Rafael J. Wysocki
2005-09-28 22:35 ` Pavel Machek
2005-09-29 11:25 ` Rafael J. Wysocki [this message]
2005-09-29 0:00 ` Siddha, Suresh B
2005-09-29 10:58 ` Rafael J. Wysocki
2005-09-29 22:01 ` Rafael J. Wysocki
2005-09-29 22:29 ` Siddha, Suresh B
2005-09-29 23:04 ` Rafael J. Wysocki
2005-09-29 23:59 ` Siddha, Suresh B
2005-09-30 5:26 ` Rafael J. Wysocki
2005-09-30 6:51 ` [discuss] " Rafael J. Wysocki
2005-10-01 1:25 ` Siddha, Suresh B
2005-10-01 7:47 ` Rafael J. Wysocki
2005-10-01 10:03 ` Rafael J. Wysocki
2005-10-02 1:08 ` Siddha, Suresh B
2005-10-02 9:54 ` Rafael J. Wysocki
2005-09-29 20:02 ` Andrew Morton
2005-09-29 21:35 ` 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=200509291325.48011.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=discuss@x86-64.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
--cc=suresh.b.siddha@intel.com \
/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