Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b40827fa authored by Borislav Petkov's avatar Borislav Petkov Committed by H. Peter Anvin
Browse files

x86-32, mm: Add an initial page table for core bootstrapping



This patch adds an initial page table with low mappings used exclusively
for booting APs/resuming after ACPI suspend/machine restart. After this,
there's no need to add low mappings to swapper_pg_dir and zap them later
or create own swsusp PGD page solely for ACPI sleep needs - we have
initial_page_table for that.

Signed-off-by: default avatarBorislav Petkov <bp@alien8.de>
LKML-Reference: <20101020070526.GA9588@liondog.tnic>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent d25e6b0b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ struct mm_struct;
struct vm_area_struct;

extern pgd_t swapper_pg_dir[1024];
extern pgd_t trampoline_pg_dir[1024];
extern pgd_t initial_page_table[1024];

static inline void pgtable_cache_init(void) { }
static inline void check_pgt_cache(void) { }
+0 −2
Original line number Diff line number Diff line
@@ -172,6 +172,4 @@ static inline void flush_tlb_kernel_range(unsigned long start,
	flush_tlb_all();
}

extern void zap_low_mappings(bool early);

#endif /* _ASM_X86_TLBFLUSH_H */
+0 −3
Original line number Diff line number Diff line
@@ -13,16 +13,13 @@ extern unsigned char *trampoline_base;

extern unsigned long init_rsp;
extern unsigned long initial_code;
extern unsigned long initial_page_table;
extern unsigned long initial_gs;

#define TRAMPOLINE_SIZE roundup(trampoline_end - trampoline_data, PAGE_SIZE)

extern unsigned long setup_trampoline(void);
extern void __init setup_trampoline_page_table(void);
extern void __init reserve_trampoline_memory(void);
#else
static inline void setup_trampoline_page_table(void) {}
static inline void reserve_trampoline_memory(void) {}
#endif /* CONFIG_X86_TRAMPOLINE */

+6 −1
Original line number Diff line number Diff line
@@ -12,6 +12,11 @@
#include <asm/segment.h>
#include <asm/desc.h>

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

#include "realmode/wakeup.h"
#include "sleep.h"

@@ -90,7 +95,7 @@ int acpi_save_state_mem(void)

#ifndef CONFIG_64BIT
	header->pmode_entry = (u32)&wakeup_pmode_return;
	header->pmode_cr3 = (u32)(swsusp_pg_dir - __PAGE_OFFSET);
	header->pmode_cr3 = (u32)__pa(&initial_page_table);
	saved_magic = 0x12345678;
#else /* CONFIG_64BIT */
	header->trampoline_segment = setup_trampoline() >> 4;
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <asm/apic.h>
#include <asm/io_apic.h>
#include <asm/bios_ebda.h>
#include <asm/tlbflush.h>

static void __init i386_default_early_setup(void)
{
Loading