Skip to content

Commit

Permalink
x86, nx: Mark the ACPI resume trampoline code as +x
Browse files Browse the repository at this point in the history
We reserve lowmem for the things that need it, like the ACPI
wakeup code, way early to guarantee availability.  This happens
before we set up the proper pagetables, so set_memory_x() has no
effect.

Until we have a better solution, use an initcall to mark the
wakeup code executable.

Originally-by: Matthieu Castet <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
Cc: Matthias Hopf <[email protected]>
Cc: [email protected]
Cc: Suresh Siddha <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
H. Peter Anvin authored and Ingo Molnar committed Feb 7, 2011
1 parent 8dbdea8 commit d344e38
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions arch/x86/kernel/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
#include <linux/cpumask.h>
#include <asm/segment.h>
#include <asm/desc.h>

#ifdef CONFIG_X86_32
#include <asm/pgtable.h>
#endif
#include <asm/cacheflush.h>

#include "realmode/wakeup.h"
#include "sleep.h"
Expand Down Expand Up @@ -149,6 +147,15 @@ void __init acpi_reserve_wakeup_memory(void)
memblock_x86_reserve_range(mem, mem + WAKEUP_SIZE, "ACPI WAKEUP");
}

int __init acpi_configure_wakeup_memory(void)
{
if (acpi_realmode)
set_memory_x(acpi_realmode, WAKEUP_SIZE >> PAGE_SHIFT);

return 0;
}
arch_initcall(acpi_configure_wakeup_memory);


static int __init acpi_sleep_setup(char *str)
{
Expand Down

0 comments on commit d344e38

Please sign in to comment.