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@xxxxxxx>"
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;
+ }
}