From: matthieu castet <castet.matthieu@free.fr>
To: linux-acpi@vger.kernel.org
Subject: [PATCH] check that acpi_wakeup_address is below 1MB v2
Date: Thu, 10 Apr 2008 23:33:36 +0200 [thread overview]
Message-ID: <47FE87B0.7080709@free.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 177 bytes --]
Hi,
this patch add a check that the memory allocated for s3 wakeup is in the
first 1MB as required by acpi spec.
Signed-off-by: "Matthieu CASTET <castet.matthieu@free.fr>"
[-- Attachment #2: acpi_alloc_s3_mem.diff --]
[-- Type: text/x-diff, Size: 683 bytes --]
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 6bc815c..6636859 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -65,6 +65,13 @@ void __init acpi_reserve_bootmem(void)
acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE*2);
if (!acpi_wakeup_address)
printk(KERN_ERR "ACPI: Cannot allocate lowmem, S3 disabled.\n");
+ /* check if we are in first 1MB of memory */
+ if (__pa(acpi_wakeup_address) >= 1024*1024-PAGE_SIZE*2) {
+ printk(KERN_ERR "ACPI: Cannot allocate lowmem in first 1MB,"
+ "S3 disabled.\n");
+ free_bootmem(acpi_wakeup_address, PAGE_SIZE*2);
+ acpi_wakeup_address = 0;
+ }
}
next reply other threads:[~2008-04-10 21:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 21:33 matthieu castet [this message]
2008-04-11 9:55 ` [PATCH] check that acpi_wakeup_address is below 1MB v2 Zhao Yakui
2008-04-11 15:12 ` Rafael J. Wysocki
2008-04-11 18:04 ` matthieu castet
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=47FE87B0.7080709@free.fr \
--to=castet.matthieu@free.fr \
--cc=linux-acpi@vger.kernel.org \
/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