From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@suse.cz>
Cc: Andi Kleen <ak@suse.de>,
kernel list <linux-kernel@vger.kernel.org>,
paul.devriendt@amd.com
Subject: Re: BIOS overwritten during resume (was: Re: Asus L5D resume on battery power)
Date: Fri, 4 Mar 2005 14:15:34 +0100 [thread overview]
Message-ID: <200503041415.35162.rjw@sisk.pl> (raw)
In-Reply-To: <20050304110408.GL1345@elf.ucw.cz>
Hi,
On Friday, 4 of March 2005 12:04, Pavel Machek wrote:
> Hi!
>
> > > IIRC kernel code/data is marked as PageReserved(), that's why we need
> > > to save that :(. Not sure what to do with data e820 marked as
> > > reserved...
> >
> > Perhaps we need another page flag, like PG_readonly, and mark the pages
> > reserved by the e820 as PG_reserved | PG_readonly (the same for the areas
> > that are not returned by e820 at all). Would that be acceptable?
>
> This flags are little in the short supply, but being able to tell
> kernel code from memory hole seems like "must have", so yes, that
> looks ok.
>
> You could get subtle and reuse some other pageflag. I do not think
> PG_reserved can have PG_locked... So using for example PG_locked for
> this purpose should be okay.
The following patch does this. It is only for x86-64 without
CONFIG_DISCONTIGMEM, but it has no effect in other cases.
--- linux-2.6.11-rc5-mm1/arch/x86_64/mm/init.c 2005-03-04 12:19:29.000000000 +0100
+++ new/arch/x86_64/mm/init.c 2005-03-04 13:53:08.000000000 +0100
@@ -438,11 +438,14 @@
totalram_pages += free_all_bootmem();
for (tmp = 0; tmp < end_pfn; tmp++)
- /*
- * Only count reserved RAM pages
- */
- if (page_is_ram(tmp) && PageReserved(pfn_to_page(tmp)))
- reservedpages++;
+ if (!page_is_ram(tmp))
+ SetPageLocked(pfn_to_page(tmp));
+ else
+ /*
+ * Count reserved RAM pages
+ */
+ if (PageReserved(pfn_to_page(tmp)))
+ reservedpages++;
#endif
after_bootmem = 1;
--- linux-2.6.11-rc5-mm1/kernel/power/swsusp.c 2005-03-04 13:54:50.000000000 +0100
+++ new/kernel/power/swsusp.c 2005-03-04 13:57:37.000000000 +0100
@@ -531,9 +531,15 @@
BUG_ON(PageReserved(page) && PageNosave(page));
if (PageNosave(page))
return 0;
- if (PageReserved(page) && pfn_is_nosave(pfn)) {
- pr_debug("[nosave pfn 0x%lx]", pfn);
- return 0;
+ if (PageReserved(page)) {
+ if (pfn_is_nosave(pfn)) {
+ pr_debug("[nosave pfn 0x%lx]\n", pfn);
+ return 0;
+ }
+ if (PageLocked(page)) {
+ pr_debug("[locked pfn 0x%lx]\n", pfn);
+ return 0;
+ }
}
if (PageNosaveFree(page))
return 0;
I thought it would be more complicated. :-)
Greets,
Rafael
--
- 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"
next prev parent reply other threads:[~2005-03-04 13:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200502252237.04110.rjw@sisk.pl>
[not found] ` <20050227170253.GH1441@elf.ucw.cz>
[not found] ` <200502271919.45767.rjw@sisk.pl>
[not found] ` <200503022250.12823.rjw@sisk.pl>
2005-03-02 22:05 ` BIOS overwritten during resume (was: Re: Asus L5D resume on battery power) Pavel Machek
2005-03-02 23:47 ` Rafael J. Wysocki
2005-03-02 23:54 ` Pavel Machek
2005-03-03 8:02 ` Rafael J. Wysocki
2005-03-04 11:04 ` Pavel Machek
2005-03-04 13:15 ` Rafael J. Wysocki [this message]
2005-03-04 14:44 ` Nigel Cunningham
2005-03-04 20:11 ` Pavel Machek
2005-03-04 23:26 ` Rafael J. Wysocki
2005-03-04 23:37 ` Nigel Cunningham
2005-03-05 0:51 ` Bernard Blackham
2005-03-04 23:41 ` Pavel Machek
2005-03-05 1:10 ` Nigel Cunningham
2005-03-05 9:08 ` Rafael J. Wysocki
2005-03-06 17:29 ` Rafael J. Wysocki
2005-03-06 19:41 ` Pavel Machek
2005-03-06 21:53 ` Rafael J. Wysocki
2005-03-04 14:21 ` Nigel Cunningham
2005-03-05 18:43 ` 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=200503041415.35162.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.devriendt@amd.com \
--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