提交 731a7378 编写于 作者: L Linus Torvalds

Merge branch 'x86-trampoline-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 trampoline rework from H. Peter Anvin:
 "This code reworks all the "trampoline"/"realmode" code (various bits
  that need to live in the first megabyte of memory, most but not all of
  which runs in real mode at some point) in the kernel into a single
  object.  The main reason for doing this is that it eliminates the last
  place in the kernel where we needed pages to be mapped RWX.  This code
  separates all that code into proper R/RW/RX pages."

Fix up conflicts in arch/x86/kernel/Makefile (mca removed next to reboot
code), and arch/x86/kernel/reboot.c (reboot code moved around in one
branch, modified in this one), and arch/x86/tools/relocs.c (mostly same
code came in earlier due to working around the ld bugs just before the
3.4 release).

Also remove stale x86-relocs entry from scripts/.gitignore as per Peter
Anvin.

* commit '61f54461': (36 commits)
  x86, realmode: Move end signature into header.S
  x86, relocs: When printing an error, say relative or absolute
  x86, relocs: More relocations which may end up as absolute
  x86, relocs: Workaround for binutils 2.22.52.0.1 section bug
  xen-acpi-processor: Add missing #include <xen/xen.h>
  acpi, bgrd: Add missing <linux/io.h> to drivers/acpi/bgrt.c
  x86, realmode: Change EFER to a single u64 field
  x86, realmode: Move kernel/realmode.c to realmode/init.c
  x86, realmode: Move not-common bits out of trampoline_common.S
  x86, realmode: Mask out EFER.LMA when saving trampoline EFER
  x86, realmode: Fix no cache bits test in reboot_32.S
  x86, realmode: Make sure all generated files are listed in targets
  x86, realmode: build fix: remove duplicate build
  x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline
  x86, realmode: fixes compilation issue in tboot.c
  x86, realmode: move relocs from scripts/ to arch/x86/tools
  x86, realmode: header for trampoline code
  x86, realmode: flattened rm hierachy
  x86, realmode: don't copy real_mode_header
  x86, realmode: fix 64-bit wakeup sequence
  ...
obj-$(CONFIG_KVM) += kvm/ obj-$(CONFIG_KVM) += kvm/
# Xen paravirtualization support # Xen paravirtualization support
...@@ -7,6 +6,7 @@ obj-$(CONFIG_XEN) += xen/ ...@@ -7,6 +6,7 @@ obj-$(CONFIG_XEN) += xen/
# lguest paravirtualization support # lguest paravirtualization support
obj-$(CONFIG_LGUEST_GUEST) += lguest/ obj-$(CONFIG_LGUEST_GUEST) += lguest/
obj-y += realmode/
obj-y += kernel/ obj-y += kernel/
obj-y += mm/ obj-y += mm/
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/mpspec.h> #include <asm/mpspec.h>
#include <asm/trampoline.h>
#define COMPILER_DEPENDENT_INT64 long long #define COMPILER_DEPENDENT_INT64 long long
#define COMPILER_DEPENDENT_UINT64 unsigned long long #define COMPILER_DEPENDENT_UINT64 unsigned long long
...@@ -118,7 +117,6 @@ static inline void acpi_disable_pci(void) ...@@ -118,7 +117,6 @@ static inline void acpi_disable_pci(void)
extern int acpi_suspend_lowlevel(void); extern int acpi_suspend_lowlevel(void);
extern const unsigned char acpi_wakeup_code[]; extern const unsigned char acpi_wakeup_code[];
#define acpi_wakeup_address (__pa(TRAMPOLINE_SYM(acpi_wakeup_code)))
/* early initialization routine */ /* early initialization routine */
extern void acpi_reserve_wakeup_memory(void); extern void acpi_reserve_wakeup_memory(void);
......
...@@ -544,13 +544,16 @@ static inline void load_sp0(struct tss_struct *tss, ...@@ -544,13 +544,16 @@ static inline void load_sp0(struct tss_struct *tss,
* enable), so that any CPU's that boot up * enable), so that any CPU's that boot up
* after us can get the correct flags. * after us can get the correct flags.
*/ */
extern unsigned long mmu_cr4_features; extern unsigned long mmu_cr4_features;
extern u32 *trampoline_cr4_features;
static inline void set_in_cr4(unsigned long mask) static inline void set_in_cr4(unsigned long mask)
{ {
unsigned long cr4; unsigned long cr4;
mmu_cr4_features |= mask; mmu_cr4_features |= mask;
if (trampoline_cr4_features)
*trampoline_cr4_features = mmu_cr4_features;
cr4 = read_cr4(); cr4 = read_cr4();
cr4 |= mask; cr4 |= mask;
write_cr4(cr4); write_cr4(cr4);
...@@ -561,6 +564,8 @@ static inline void clear_in_cr4(unsigned long mask) ...@@ -561,6 +564,8 @@ static inline void clear_in_cr4(unsigned long mask)
unsigned long cr4; unsigned long cr4;
mmu_cr4_features &= ~mask; mmu_cr4_features &= ~mask;
if (trampoline_cr4_features)
*trampoline_cr4_features = mmu_cr4_features;
cr4 = read_cr4(); cr4 = read_cr4();
cr4 &= ~mask; cr4 &= ~mask;
write_cr4(cr4); write_cr4(cr4);
......
#ifndef _ARCH_X86_REALMODE_H
#define _ARCH_X86_REALMODE_H
#include <linux/types.h>
#include <asm/io.h>
/* This must match data at realmode.S */
struct real_mode_header {
u32 text_start;
u32 ro_end;
/* SMP trampoline */
u32 trampoline_start;
u32 trampoline_status;
u32 trampoline_header;
#ifdef CONFIG_X86_64
u32 trampoline_pgd;
#endif
/* ACPI S3 wakeup */
#ifdef CONFIG_ACPI_SLEEP
u32 wakeup_start;
u32 wakeup_header;
#endif
/* APM/BIOS reboot */
#ifdef CONFIG_X86_32
u32 machine_real_restart_asm;
#endif
};
/* This must match data at trampoline_32/64.S */
struct trampoline_header {
#ifdef CONFIG_X86_32
u32 start;
u16 gdt_pad;
u16 gdt_limit;
u32 gdt_base;
#else
u64 start;
u64 efer;
u32 cr4;
#endif
};
extern struct real_mode_header *real_mode_header;
extern unsigned char real_mode_blob_end[];
extern unsigned long init_rsp;
extern unsigned long initial_code;
extern unsigned long initial_gs;
extern unsigned char real_mode_blob[];
extern unsigned char real_mode_relocs[];
#ifdef CONFIG_X86_32
extern unsigned char startup_32_smp[];
extern unsigned char boot_gdt[];
#else
extern unsigned char secondary_startup_64[];
#endif
extern void __init setup_real_mode(void);
#endif /* _ARCH_X86_REALMODE_H */
#ifndef _ASM_X86_TRAMPOLINE_H
#define _ASM_X86_TRAMPOLINE_H
#ifndef __ASSEMBLY__
#include <linux/types.h>
#include <asm/io.h>
/*
* Trampoline 80x86 program as an array. These are in the init rodata
* segment, but that's okay, because we only care about the relative
* addresses of the symbols.
*/
extern const unsigned char x86_trampoline_start [];
extern const unsigned char x86_trampoline_end [];
extern unsigned char *x86_trampoline_base;
extern unsigned long init_rsp;
extern unsigned long initial_code;
extern unsigned long initial_gs;
extern void __init setup_trampolines(void);
extern const unsigned char trampoline_data[];
extern const unsigned char trampoline_status[];
#define TRAMPOLINE_SYM(x) \
((void *)(x86_trampoline_base + \
((const unsigned char *)(x) - x86_trampoline_start)))
/* Address of the SMP trampoline */
static inline unsigned long trampoline_address(void)
{
return virt_to_phys(TRAMPOLINE_SYM(trampoline_data));
}
#endif /* __ASSEMBLY__ */
#endif /* _ASM_X86_TRAMPOLINE_H */
...@@ -35,7 +35,6 @@ obj-y += tsc.o io_delay.o rtc.o ...@@ -35,7 +35,6 @@ obj-y += tsc.o io_delay.o rtc.o
obj-y += pci-iommu_table.o obj-y += pci-iommu_table.o
obj-y += resource.o obj-y += resource.o
obj-y += trampoline.o trampoline_$(BITS).o
obj-y += process.o obj-y += process.o
obj-y += i387.o xsave.o obj-y += i387.o xsave.o
obj-y += ptrace.o obj-y += ptrace.o
...@@ -48,7 +47,6 @@ obj-$(CONFIG_STACKTRACE) += stacktrace.o ...@@ -48,7 +47,6 @@ obj-$(CONFIG_STACKTRACE) += stacktrace.o
obj-y += cpu/ obj-y += cpu/
obj-y += acpi/ obj-y += acpi/
obj-y += reboot.o obj-y += reboot.o
obj-$(CONFIG_X86_32) += reboot_32.o
obj-$(CONFIG_X86_MSR) += msr.o obj-$(CONFIG_X86_MSR) += msr.o
obj-$(CONFIG_X86_CPUID) += cpuid.o obj-$(CONFIG_X86_CPUID) += cpuid.o
obj-$(CONFIG_PCI) += early-quirks.o obj-$(CONFIG_PCI) += early-quirks.o
......
subdir- := realmode
obj-$(CONFIG_ACPI) += boot.o obj-$(CONFIG_ACPI) += boot.o
obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup_rm.o wakeup_$(BITS).o obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup_$(BITS).o
ifneq ($(CONFIG_ACPI_PROCESSOR),) ifneq ($(CONFIG_ACPI_PROCESSOR),)
obj-y += cstate.o obj-y += cstate.o
endif endif
$(obj)/wakeup_rm.o: $(obj)/realmode/wakeup.bin
$(obj)/realmode/wakeup.bin: FORCE
$(Q)$(MAKE) $(build)=$(obj)/realmode
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
#include <asm/desc.h> #include <asm/desc.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/realmode.h>
#include "realmode/wakeup.h" #include "../../realmode/rm/wakeup.h"
#include "sleep.h" #include "sleep.h"
unsigned long acpi_realmode_flags; unsigned long acpi_realmode_flags;
...@@ -36,13 +37,9 @@ asmlinkage void acpi_enter_s3(void) ...@@ -36,13 +37,9 @@ asmlinkage void acpi_enter_s3(void)
*/ */
int acpi_suspend_lowlevel(void) int acpi_suspend_lowlevel(void)
{ {
struct wakeup_header *header; struct wakeup_header *header =
/* address in low memory of the wakeup routine. */ (struct wakeup_header *) __va(real_mode_header->wakeup_header);
char *acpi_realmode;
acpi_realmode = TRAMPOLINE_SYM(acpi_wakeup_code);
header = (struct wakeup_header *)(acpi_realmode + WAKEUP_HEADER_OFFSET);
if (header->signature != WAKEUP_HEADER_SIGNATURE) { if (header->signature != WAKEUP_HEADER_SIGNATURE) {
printk(KERN_ERR "wakeup header does not match\n"); printk(KERN_ERR "wakeup header does not match\n");
return -EINVAL; return -EINVAL;
...@@ -50,27 +47,6 @@ int acpi_suspend_lowlevel(void) ...@@ -50,27 +47,6 @@ int acpi_suspend_lowlevel(void)
header->video_mode = saved_video_mode; header->video_mode = saved_video_mode;
header->wakeup_jmp_seg = acpi_wakeup_address >> 4;
/*
* Set up the wakeup GDT. We set these up as Big Real Mode,
* that is, with limits set to 4 GB. At least the Lenovo
* Thinkpad X61 is known to need this for the video BIOS
* initialization quirk to work; this is likely to also
* be the case for other laptops or integrated video devices.
*/
/* GDT[0]: GDT self-pointer */
header->wakeup_gdt[0] =
(u64)(sizeof(header->wakeup_gdt) - 1) +
((u64)__pa(&header->wakeup_gdt) << 16);
/* GDT[1]: big real mode-like code segment */
header->wakeup_gdt[1] =
GDT_ENTRY(0x809b, acpi_wakeup_address, 0xfffff);
/* GDT[2]: big real mode-like data segment */
header->wakeup_gdt[2] =
GDT_ENTRY(0x8093, acpi_wakeup_address, 0xfffff);
#ifndef CONFIG_64BIT #ifndef CONFIG_64BIT
store_gdt((struct desc_ptr *)&header->pmode_gdt); store_gdt((struct desc_ptr *)&header->pmode_gdt);
...@@ -95,7 +71,6 @@ int acpi_suspend_lowlevel(void) ...@@ -95,7 +71,6 @@ int acpi_suspend_lowlevel(void)
header->pmode_cr3 = (u32)__pa(&initial_page_table); header->pmode_cr3 = (u32)__pa(&initial_page_table);
saved_magic = 0x12345678; saved_magic = 0x12345678;
#else /* CONFIG_64BIT */ #else /* CONFIG_64BIT */
header->trampoline_segment = trampoline_address() >> 4;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
stack_start = (unsigned long)temp_stack + sizeof(temp_stack); stack_start = (unsigned long)temp_stack + sizeof(temp_stack);
early_gdt_descr.address = early_gdt_descr.address =
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* Variables and functions used by the code in sleep.c * Variables and functions used by the code in sleep.c
*/ */
#include <asm/trampoline.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/realmode.h>
extern unsigned long saved_video_mode; extern unsigned long saved_video_mode;
extern long saved_magic; extern long saved_magic;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/e820.h> #include <asm/e820.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/trampoline.h>
#include <asm/apic.h> #include <asm/apic.h>
#include <asm/io_apic.h> #include <asm/io_apic.h>
#include <asm/bios_ebda.h> #include <asm/bios_ebda.h>
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/kdebug.h> #include <asm/kdebug.h>
#include <asm/e820.h> #include <asm/e820.h>
#include <asm/trampoline.h>
#include <asm/bios_ebda.h> #include <asm/bios_ebda.h>
static void __init zap_identity_mappings(void) static void __init zap_identity_mappings(void)
......
...@@ -274,10 +274,7 @@ num_subarch_entries = (. - subarch_entries) / 4 ...@@ -274,10 +274,7 @@ num_subarch_entries = (. - subarch_entries) / 4
* If cpu hotplug is not supported then this code can go in init section * If cpu hotplug is not supported then this code can go in init section
* which will be freed later * which will be freed later
*/ */
__CPUINIT __CPUINIT
#ifdef CONFIG_SMP
ENTRY(startup_32_smp) ENTRY(startup_32_smp)
cld cld
movl $(__BOOT_DS),%eax movl $(__BOOT_DS),%eax
...@@ -288,7 +285,7 @@ ENTRY(startup_32_smp) ...@@ -288,7 +285,7 @@ ENTRY(startup_32_smp)
movl pa(stack_start),%ecx movl pa(stack_start),%ecx
movl %eax,%ss movl %eax,%ss
leal -__PAGE_OFFSET(%ecx),%esp leal -__PAGE_OFFSET(%ecx),%esp
#endif /* CONFIG_SMP */
default_entry: default_entry:
/* /*
......
...@@ -139,10 +139,6 @@ ident_complete: ...@@ -139,10 +139,6 @@ ident_complete:
/* Fixup phys_base */ /* Fixup phys_base */
addq %rbp, phys_base(%rip) addq %rbp, phys_base(%rip)
/* Fixup trampoline */
addq %rbp, trampoline_level4_pgt + 0(%rip)
addq %rbp, trampoline_level4_pgt + (511*8)(%rip)
/* Due to ENTRY(), sometimes the empty space gets filled with /* Due to ENTRY(), sometimes the empty space gets filled with
* zeros. Better take a jmp than relying on empty space being * zeros. Better take a jmp than relying on empty space being
* filled with 0x90 (nop) * filled with 0x90 (nop)
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <asm/proto.h> #include <asm/proto.h>
#include <asm/bios_ebda.h> #include <asm/bios_ebda.h>
#include <asm/e820.h> #include <asm/e820.h>
#include <asm/trampoline.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/smp.h> #include <asm/smp.h>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
# include <linux/ctype.h> # include <linux/ctype.h>
# include <linux/mc146818rtc.h> # include <linux/mc146818rtc.h>
# include <asm/realmode.h>
#else #else
# include <asm/x86_init.h> # include <asm/x86_init.h>
#endif #endif
...@@ -156,15 +157,10 @@ static int __init set_bios_reboot(const struct dmi_system_id *d) ...@@ -156,15 +157,10 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
return 0; return 0;
} }
extern const unsigned char machine_real_restart_asm[];
extern const u64 machine_real_restart_gdt[3];
void machine_real_restart(unsigned int type) void machine_real_restart(unsigned int type)
{ {
void *restart_va; void (*restart_lowmem)(unsigned int) = (void (*)(unsigned int))
unsigned long restart_pa; real_mode_header->machine_real_restart_asm;
void (*restart_lowmem)(unsigned int);
u64 *lowmem_gdt;
local_irq_disable(); local_irq_disable();
...@@ -195,21 +191,6 @@ void machine_real_restart(unsigned int type) ...@@ -195,21 +191,6 @@ void machine_real_restart(unsigned int type)
* too. */ * too. */
*((unsigned short *)0x472) = reboot_mode; *((unsigned short *)0x472) = reboot_mode;
/* Patch the GDT in the low memory trampoline */
lowmem_gdt = TRAMPOLINE_SYM(machine_real_restart_gdt);
restart_va = TRAMPOLINE_SYM(machine_real_restart_asm);
restart_pa = virt_to_phys(restart_va);
restart_lowmem = (void (*)(unsigned int))restart_pa;
/* GDT[0]: GDT self-pointer */
lowmem_gdt[0] =
(u64)(sizeof(machine_real_restart_gdt) - 1) +
((u64)virt_to_phys(lowmem_gdt) << 16);
/* GDT[1]: 64K real mode code segment */
lowmem_gdt[1] =
GDT_ENTRY(0x009b, restart_pa, 0xffff);
/* Jump to the identity-mapped low memory code */ /* Jump to the identity-mapped low memory code */
restart_lowmem(type); restart_lowmem(type);
} }
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
#include <asm/mtrr.h> #include <asm/mtrr.h>
#include <asm/apic.h> #include <asm/apic.h>
#include <asm/trampoline.h> #include <asm/realmode.h>
#include <asm/e820.h> #include <asm/e820.h>
#include <asm/mpspec.h> #include <asm/mpspec.h>
#include <asm/setup.h> #include <asm/setup.h>
...@@ -909,7 +909,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -909,7 +909,7 @@ void __init setup_arch(char **cmdline_p)
printk(KERN_DEBUG "initial memory mapped: [mem 0x00000000-%#010lx]\n", printk(KERN_DEBUG "initial memory mapped: [mem 0x00000000-%#010lx]\n",
(max_pfn_mapped<<PAGE_SHIFT) - 1); (max_pfn_mapped<<PAGE_SHIFT) - 1);
setup_trampolines(); setup_real_mode();
init_gbpages(); init_gbpages();
...@@ -968,6 +968,8 @@ void __init setup_arch(char **cmdline_p) ...@@ -968,6 +968,8 @@ void __init setup_arch(char **cmdline_p)
if (boot_cpu_data.cpuid_level >= 0) { if (boot_cpu_data.cpuid_level >= 0) {
/* A CPU has %cr4 if and only if it has CPUID */ /* A CPU has %cr4 if and only if it has CPUID */
mmu_cr4_features = read_cr4(); mmu_cr4_features = read_cr4();
if (trampoline_cr4_features)
*trampoline_cr4_features = mmu_cr4_features;
} }
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
#include <asm/nmi.h> #include <asm/nmi.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/idle.h> #include <asm/idle.h>
#include <asm/trampoline.h> #include <asm/realmode.h>
#include <asm/cpu.h> #include <asm/cpu.h>
#include <asm/numa.h> #include <asm/numa.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
#include <asm/smpboot_hooks.h> #include <asm/smpboot_hooks.h>
#include <asm/i8259.h> #include <asm/i8259.h>
#include <asm/realmode.h>
/* State of each CPU */ /* State of each CPU */
DEFINE_PER_CPU(int, cpu_state) = { 0 }; DEFINE_PER_CPU(int, cpu_state) = { 0 };
...@@ -660,8 +662,12 @@ static void __cpuinit announce_cpu(int cpu, int apicid) ...@@ -660,8 +662,12 @@ static void __cpuinit announce_cpu(int cpu, int apicid)
*/ */
static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle) static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
{ {
volatile u32 *trampoline_status =
(volatile u32 *) __va(real_mode_header->trampoline_status);
/* start_ip had better be page-aligned! */
unsigned long start_ip = real_mode_header->trampoline_start;
unsigned long boot_error = 0; unsigned long boot_error = 0;
unsigned long start_ip;
int timeout; int timeout;
alternatives_smp_switch(1); alternatives_smp_switch(1);
...@@ -684,9 +690,6 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle) ...@@ -684,9 +690,6 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
initial_code = (unsigned long)start_secondary; initial_code = (unsigned long)start_secondary;
stack_start = idle->thread.sp; stack_start = idle->thread.sp;
/* start_ip had better be page-aligned! */
start_ip = trampoline_address();
/* So we see what's up */ /* So we see what's up */
announce_cpu(cpu, apicid); announce_cpu(cpu, apicid);
...@@ -749,8 +752,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle) ...@@ -749,8 +752,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
pr_debug("CPU%d: has booted.\n", cpu); pr_debug("CPU%d: has booted.\n", cpu);
} else { } else {
boot_error = 1; boot_error = 1;
if (*(volatile u32 *)TRAMPOLINE_SYM(trampoline_status) if (*trampoline_status == 0xA5A5A5A5)
== 0xA5A5A5A5)
/* trampoline started but...? */ /* trampoline started but...? */
pr_err("CPU%d: Stuck ??\n", cpu); pr_err("CPU%d: Stuck ??\n", cpu);
else else
...@@ -776,7 +778,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle) ...@@ -776,7 +778,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
} }
/* mark "stuck" area as not stuck */ /* mark "stuck" area as not stuck */
*(volatile u32 *)TRAMPOLINE_SYM(trampoline_status) = 0; *trampoline_status = 0;
if (get_uv_system_type() != UV_NON_UNIQUE_APIC) { if (get_uv_system_type() != UV_NON_UNIQUE_APIC) {
/* /*
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/tboot.h> #include <linux/tboot.h>
#include <asm/trampoline.h> #include <asm/realmode.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/bootparam.h> #include <asm/bootparam.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include <asm/e820.h> #include <asm/e820.h>
#include <asm/io.h> #include <asm/io.h>
#include "acpi/realmode/wakeup.h" #include "../realmode/rm/wakeup.h"
/* Global pointer to shared data; NULL means no measured launch. */ /* Global pointer to shared data; NULL means no measured launch. */
struct tboot *tboot __read_mostly; struct tboot *tboot __read_mostly;
...@@ -201,7 +201,8 @@ static int tboot_setup_sleep(void) ...@@ -201,7 +201,8 @@ static int tboot_setup_sleep(void)
add_mac_region(e820.map[i].addr, e820.map[i].size); add_mac_region(e820.map[i].addr, e820.map[i].size);
} }
tboot->acpi_sinfo.kernel_s3_resume_vector = acpi_wakeup_address; tboot->acpi_sinfo.kernel_s3_resume_vector =
real_mode_header->wakeup_start;
return 0; return 0;
} }
......
#include <linux/io.h>
#include <linux/memblock.h>
#include <asm/trampoline.h>
#include <asm/cacheflush.h>
#include <asm/pgtable.h>
unsigned char *x86_trampoline_base;
void __init setup_trampolines(void)
{
phys_addr_t mem;
size_t size = PAGE_ALIGN(x86_trampoline_end - x86_trampoline_start);
/* Has to be in very low memory so we can execute real-mode AP code. */
mem = memblock_find_in_range(0, 1<<20, size, PAGE_SIZE);
if (!mem)
panic("Cannot allocate trampoline\n");
x86_trampoline_base = __va(mem);
memblock_reserve(mem, size);
printk(KERN_DEBUG "Base memory trampoline at [%p] %llx size %zu\n",
x86_trampoline_base, (unsigned long long)mem, size);
memcpy(x86_trampoline_base, x86_trampoline_start, size);
}
/*
* setup_trampolines() gets called very early, to guarantee the
* availability of low memory. This is before the proper kernel page
* tables are set up, so we cannot set page permissions in that
* function. Thus, we use an arch_initcall instead.
*/
static int __init configure_trampolines(void)
{
size_t size = PAGE_ALIGN(x86_trampoline_end - x86_trampoline_start);
set_memory_x((unsigned long)x86_trampoline_base, size >> PAGE_SHIFT);
return 0;
}
arch_initcall(configure_trampolines);
...@@ -197,18 +197,6 @@ SECTIONS ...@@ -197,18 +197,6 @@ SECTIONS
INIT_DATA_SECTION(16) INIT_DATA_SECTION(16)
/*
* Code and data for a variety of lowlevel trampolines, to be
* copied into base memory (< 1 MiB) during initialization.
* Since it is copied early, the main copy can be discarded
* afterwards.
*/
.x86_trampoline : AT(ADDR(.x86_trampoline) - LOAD_OFFSET) {
x86_trampoline_start = .;
*(.x86_trampoline)
x86_trampoline_end = .;
}
.x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) { .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
__x86_cpu_dev_start = .; __x86_cpu_dev_start = .;
*(.x86_cpu_dev.init) *(.x86_cpu_dev.init)
......
#
# arch/x86/realmode/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
#
subdir- := rm
obj-y += init.o
obj-y += rmpiggy.o
$(obj)/rmpiggy.o: $(obj)/rm/realmode.bin
$(obj)/rm/realmode.bin: FORCE
$(Q)$(MAKE) $(build)=$(obj)/rm $@
#include <linux/io.h>
#include <linux/memblock.h>
#include <asm/cacheflush.h>
#include <asm/pgtable.h>
#include <asm/realmode.h>
struct real_mode_header *real_mode_header;
u32 *trampoline_cr4_features;
void __init setup_real_mode(void)
{
phys_addr_t mem;
u16 real_mode_seg;
u32 *rel;
u32 count;
u32 *ptr;
u16 *seg;
int i;
unsigned char *base;
struct trampoline_header *trampoline_header;
size_t size = PAGE_ALIGN(real_mode_blob_end - real_mode_blob);
#ifdef CONFIG_X86_64
u64 *trampoline_pgd;
u64 efer;
#endif
/* Has to be in very low memory so we can execute real-mode AP code. */
mem = memblock_find_in_range(0, 1<<20, size, PAGE_SIZE);
if (!mem)
panic("Cannot allocate trampoline\n");
base = __va(mem);
memblock_reserve(mem, size);
real_mode_header = (struct real_mode_header *) base;
printk(KERN_DEBUG "Base memory trampoline at [%p] %llx size %zu\n",
base, (unsigned long long)mem, size);
memcpy(base, real_mode_blob, size);
real_mode_seg = __pa(base) >> 4;
rel = (u32 *) real_mode_relocs;
/* 16-bit segment relocations. */
count = rel[0];
rel = &rel[1];
for (i = 0; i < count; i++) {
seg = (u16 *) (base + rel[i]);
*seg = real_mode_seg;
}
/* 32-bit linear relocations. */
count = rel[i];
rel = &rel[i + 1];
for (i = 0; i < count; i++) {
ptr = (u32 *) (base + rel[i]);
*ptr += __pa(base);
}
/* Must be perfomed *after* relocation. */
trampoline_header = (struct trampoline_header *)
__va(real_mode_header->trampoline_header);
#ifdef CONFIG_X86_32
trampoline_header->start = __pa(startup_32_smp);
trampoline_header->gdt_limit = __BOOT_DS + 7;
trampoline_header->gdt_base = __pa(boot_gdt);
#else
/*
* Some AMD processors will #GP(0) if EFER.LMA is set in WRMSR
* so we need to mask it out.
*/
rdmsrl(MSR_EFER, efer);
trampoline_header->efer = efer & ~EFER_LMA;
trampoline_header->start = (u64) secondary_startup_64;
trampoline_cr4_features = &trampoline_header->cr4;
*trampoline_cr4_features = read_cr4();
trampoline_pgd = (u64 *) __va(real_mode_header->trampoline_pgd);
trampoline_pgd[0] = __pa(level3_ident_pgt) + _KERNPG_TABLE;
trampoline_pgd[511] = __pa(level3_kernel_pgt) + _KERNPG_TABLE;
#endif
}
/*
* set_real_mode_permissions() gets called very early, to guarantee the
* availability of low memory. This is before the proper kernel page
* tables are set up, so we cannot set page permissions in that
* function. Thus, we use an arch_initcall instead.
*/
static int __init set_real_mode_permissions(void)
{
unsigned char *base = (unsigned char *) real_mode_header;
size_t size = PAGE_ALIGN(real_mode_blob_end - real_mode_blob);
size_t ro_size =
PAGE_ALIGN(real_mode_header->ro_end) -
__pa(base);
size_t text_size =
PAGE_ALIGN(real_mode_header->ro_end) -
real_mode_header->text_start;
unsigned long text_start =
(unsigned long) __va(real_mode_header->text_start);
set_memory_nx((unsigned long) base, size >> PAGE_SHIFT);
set_memory_ro((unsigned long) base, ro_size >> PAGE_SHIFT);
set_memory_x((unsigned long) text_start, text_size >> PAGE_SHIFT);
return 0;
}
arch_initcall(set_real_mode_permissions);
pasyms.h
realmode.lds
realmode.relocs
# #
# arch/x86/kernel/acpi/realmode/Makefile # arch/x86/realmode/Makefile
# #
# This file is subject to the terms and conditions of the GNU General Public # This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive # License. See the file "COPYING" in the main directory of this archive
# for more details. # for more details.
# #
#
always := wakeup.bin always := realmode.bin realmode.relocs
targets := wakeup.elf wakeup.lds
wakeup-y += wakeup.o wakemain.o video-mode.o copy.o bioscall.o regs.o
wakeup-objs := wakeup_asm.o wakemain.o video-mode.o
wakeup-objs += copy.o bioscall.o regs.o
# The link order of the video-*.o modules can matter. In particular, # The link order of the video-*.o modules can matter. In particular,
# video-vga.o *must* be listed first, followed by video-vesa.o. # video-vga.o *must* be listed first, followed by video-vesa.o.
# Hardware-specific drivers should follow in the order they should be # Hardware-specific drivers should follow in the order they should be
# probed, and video-bios.o should typically be last. # probed, and video-bios.o should typically be last.
wakeup-y += video-vga.o wakeup-objs += video-vga.o
wakeup-y += video-vesa.o wakeup-objs += video-vesa.o
wakeup-y += video-bios.o wakeup-objs += video-bios.o
realmode-y += header.o
realmode-y += trampoline_$(BITS).o
realmode-y += stack.o
realmode-$(CONFIG_X86_32) += reboot_32.o
realmode-$(CONFIG_ACPI_SLEEP) += $(wakeup-objs)
targets += $(realmode-y)
REALMODE_OBJS = $(addprefix $(obj)/,$(realmode-y))
sed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'
targets += $(wakeup-y) quiet_cmd_pasyms = PASYMS $@
cmd_pasyms = $(NM) $(filter-out FORCE,$^) | \
sed $(sed-pasyms) | sort | uniq > $@
bootsrc := $(src)/../../../boot targets += pasyms.h
$(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
$(call if_changed,pasyms)
targets += realmode.lds
$(obj)/realmode.lds: $(obj)/pasyms.h
LDFLAGS_realmode.elf := --emit-relocs -T
CPPFLAGS_realmode.lds += -P -C -I$(obj)
targets += realmode.elf
$(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE
$(call if_changed,ld)
OBJCOPYFLAGS_realmode.bin := -O binary
targets += realmode.bin
$(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs
$(call if_changed,objcopy)
quiet_cmd_relocs = RELOCS $@
cmd_relocs = arch/x86/tools/relocs --realmode $< > $@
targets += realmode.relocs
$(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
$(call if_changed,relocs)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# How to compile the 16-bit code. Note we always compile for -march=i386, # How to compile the 16-bit code. Note we always compile for -march=i386,
# that way we can complain to the user if the CPU is insufficient. # that way we can complain to the user if the CPU is insufficient.
# Compile with _SETUP since this is similar to the boot-time setup code. KBUILD_CFLAGS := $(LINUXINCLUDE) -m32 -g -Os -D_SETUP -D__KERNEL__ -D_WAKEUP \
KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D_WAKEUP -D__KERNEL__ \ -I$(srctree)/arch/x86/boot \
-I$(srctree)/$(bootsrc) \ -DDISABLE_BRANCH_PROFILING \
$(cflags-y) \
-Wall -Wstrict-prototypes \ -Wall -Wstrict-prototypes \
-march=i386 -mregparm=3 \ -march=i386 -mregparm=3 \
-include $(srctree)/$(bootsrc)/code16gcc.h \ -include $(srctree)/$(src)/../../boot/code16gcc.h \
-fno-strict-aliasing -fomit-frame-pointer \ -fno-strict-aliasing -fomit-frame-pointer \
$(call cc-option, -ffreestanding) \ $(call cc-option, -ffreestanding) \
$(call cc-option, -fno-toplevel-reorder,\ $(call cc-option, -fno-toplevel-reorder,\
$(call cc-option, -fno-unit-at-a-time)) \ $(call cc-option, -fno-unit-at-a-time)) \
$(call cc-option, -fno-stack-protector) \ $(call cc-option, -fno-stack-protector) \
$(call cc-option, -mpreferred-stack-boundary=2) $(call cc-option, -mpreferred-stack-boundary=2)
KBUILD_CFLAGS += $(call cc-option, -m32)
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n GCOV_PROFILE := n
WAKEUP_OBJS = $(addprefix $(obj)/,$(wakeup-y))
LDFLAGS_wakeup.elf := -T
CPPFLAGS_wakeup.lds += -P -C
$(obj)/wakeup.elf: $(obj)/wakeup.lds $(WAKEUP_OBJS) FORCE
$(call if_changed,ld)
OBJCOPYFLAGS_wakeup.bin := -O binary
$(obj)/wakeup.bin: $(obj)/wakeup.elf FORCE
$(call if_changed,objcopy)
#include "../../boot/bioscall.S"
#include "../../boot/copy.S"
/*
* Real-mode blob header; this should match realmode.h and be
* readonly; for mutable data instead add pointers into the .data
* or .bss sections as appropriate.
*/
#include <linux/linkage.h>
#include <asm/page_types.h>
#include "realmode.h"
.section ".header", "a"
.balign 16
GLOBAL(real_mode_header)
.long pa_text_start
.long pa_ro_end
/* SMP trampoline */
.long pa_trampoline_start
.long pa_trampoline_status
.long pa_trampoline_header
#ifdef CONFIG_X86_64
.long pa_trampoline_pgd;
#endif
/* ACPI S3 wakeup */
#ifdef CONFIG_ACPI_SLEEP
.long pa_wakeup_start
.long pa_wakeup_header
#endif
/* APM/BIOS reboot */
#ifdef CONFIG_X86_32
.long pa_machine_real_restart_asm
#endif
END(real_mode_header)
/* End signature, used to verify integrity */
.section ".signature","a"
.balign 4
GLOBAL(end_signature)
.long REALMODE_END_SIGNATURE
END(end_signature)
#ifndef ARCH_X86_REALMODE_RM_REALMODE_H
#define ARCH_X86_REALMODE_RM_REALMODE_H
#ifdef __ASSEMBLY__
/*
* 16-bit ljmpw to the real_mode_seg
*
* This must be open-coded since gas will choke on using a
* relocatable symbol for the segment portion.
*/
#define LJMPW_RM(to) .byte 0xea ; .word (to), real_mode_seg
#endif /* __ASSEMBLY__ */
/*
* Signature at the end of the realmode region
*/
#define REALMODE_END_SIGNATURE 0x65a22c82
#endif /* ARCH_X86_REALMODE_RM_REALMODE_H */
/* /*
* wakeup.ld * realmode.lds.S
* *
* Linker script for the real-mode wakeup code * Linker script for the real-mode code
*/ */
#include <asm/page_types.h>
#undef i386 #undef i386
#include "wakeup.h"
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386) OUTPUT_ARCH(i386)
ENTRY(_start)
SECTIONS SECTIONS
{ {
. = 0; real_mode_seg = 0;
.jump : {
*(.jump)
} = 0x90909090
. = WAKEUP_HEADER_OFFSET; . = 0;
.header : { .header : {
pa_real_mode_base = .;
*(.header) *(.header)
} }
. = ALIGN(16); . = ALIGN(4);
.text : {
*(.text*)
} = 0x90909090
. = ALIGN(16);
.rodata : { .rodata : {
*(.rodata*) *(.rodata)
} *(.rodata.*)
. = ALIGN(16);
.videocards : {
video_cards = .; video_cards = .;
*(.videocards) *(.videocards)
video_cards_end = .; video_cards_end = .;
} }
. = ALIGN(16); . = ALIGN(PAGE_SIZE);
pa_text_start = .;
.text : {
*(.text)
*(.text.*)
}
.text32 : {
*(.text32)
*(.text32.*)
}
.text64 : {
*(.text64)
*(.text64.*)
}
pa_ro_end = .;
. = ALIGN(PAGE_SIZE);
.data : { .data : {
*(.data*) *(.data)
*(.data.*)
} }
. = ALIGN(16); . = ALIGN(128);
.bss : { .bss : {
__bss_start = .; *(.bss*)
*(.bss)
__bss_end = .;
} }
/* End signature for integrity checking */
. = ALIGN(4);
.signature : { .signature : {
*(.signature) *(.signature)
} }
_end = .;
/DISCARD/ : { /DISCARD/ : {
*(.note*) *(.note*)
*(.debug*)
*(.eh_frame*)
} }
#include "pasyms.h"
} }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/page_types.h> #include <asm/page_types.h>
#include "realmode.h"
/* /*
* The following code and data reboots the machine by switching to real * The following code and data reboots the machine by switching to real
...@@ -13,34 +14,20 @@ ...@@ -13,34 +14,20 @@
* *
* This code is called with the restart type (0 = BIOS, 1 = APM) in %eax. * This code is called with the restart type (0 = BIOS, 1 = APM) in %eax.
*/ */
.section ".x86_trampoline","a" .section ".text32", "ax"
.balign 16
.code32 .code32
ENTRY(machine_real_restart_asm)
r_base = .
/* Get our own relocated address */
call 1f
1: popl %ebx
subl $(1b - r_base), %ebx
/* Compute the equivalent real-mode segment */
movl %ebx, %ecx
shrl $4, %ecx
/* Patch post-real-mode segment jump */
movw (dispatch_table - r_base)(%ebx,%eax,2),%ax
movw %ax, (101f - r_base)(%ebx)
movw %cx, (102f - r_base)(%ebx)
.balign 16
ENTRY(machine_real_restart_asm)
/* Set up the IDT for real mode. */ /* Set up the IDT for real mode. */
lidtl (machine_real_restart_idt - r_base)(%ebx) lidtl pa_machine_real_restart_idt
/* /*
* Set up a GDT from which we can load segment descriptors for real * Set up a GDT from which we can load segment descriptors for real
* mode. The GDT is not used in real mode; it is just needed here to * mode. The GDT is not used in real mode; it is just needed here to
* prepare the descriptors. * prepare the descriptors.
*/ */
lgdtl (machine_real_restart_gdt - r_base)(%ebx) lgdtl pa_machine_real_restart_gdt
/* /*
* Load the data segment registers with 16-bit compatible values * Load the data segment registers with 16-bit compatible values
...@@ -51,7 +38,7 @@ r_base = . ...@@ -51,7 +38,7 @@ r_base = .
movl %ecx, %fs movl %ecx, %fs
movl %ecx, %gs movl %ecx, %gs
movl %ecx, %ss movl %ecx, %ss
ljmpl $8, $1f - r_base ljmpw $8, $1f
/* /*
* This is 16-bit protected mode code to disable paging and the cache, * This is 16-bit protected mode code to disable paging and the cache,
...@@ -76,27 +63,29 @@ r_base = . ...@@ -76,27 +63,29 @@ r_base = .
* *
* Most of this work is probably excessive, but it is what is tested. * Most of this work is probably excessive, but it is what is tested.
*/ */
.text
.code16 .code16
.balign 16
machine_real_restart_asm16:
1: 1:
xorl %ecx, %ecx xorl %ecx, %ecx
movl %cr0, %eax movl %cr0, %edx
andl $0x00000011, %eax andl $0x00000011, %edx
orl $0x60000000, %eax orl $0x60000000, %edx
movl %eax, %cr0 movl %edx, %cr0
movl %ecx, %cr3 movl %ecx, %cr3
movl %cr0, %edx movl %cr0, %edx
andl $0x60000000, %edx /* If no cache bits -> no wbinvd */ testl $0x60000000, %edx /* If no cache bits -> no wbinvd */
jz 2f jz 2f
wbinvd wbinvd
2: 2:
andb $0x10, %al andb $0x10, %dl
movl %eax, %cr0 movl %edx, %cr0
.byte 0xea /* ljmpw */ LJMPW_RM(3f)
101: .word 0 /* Offset */ 3:
102: .word 0 /* Segment */ andw %ax, %ax
jz bios
bios:
ljmpw $0xf000, $0xfff0
apm: apm:
movw $0x1000, %ax movw $0x1000, %ax
...@@ -106,26 +95,34 @@ apm: ...@@ -106,26 +95,34 @@ apm:
movw $0x0001, %bx movw $0x0001, %bx
movw $0x0003, %cx movw $0x0003, %cx
int $0x15 int $0x15
/* This should never return... */
END(machine_real_restart_asm) bios:
ljmpw $0xf000, $0xfff0
.balign 16 .section ".rodata", "a"
/* These must match <asm/reboot.h */
dispatch_table:
.word bios - r_base
.word apm - r_base
END(dispatch_table)
.balign 16 .balign 16
machine_real_restart_idt: GLOBAL(machine_real_restart_idt)
.word 0xffff /* Length - real mode default value */ .word 0xffff /* Length - real mode default value */
.long 0 /* Base - real mode default value */ .long 0 /* Base - real mode default value */
END(machine_real_restart_idt) END(machine_real_restart_idt)
.balign 16 .balign 16
ENTRY(machine_real_restart_gdt) GLOBAL(machine_real_restart_gdt)
.quad 0 /* Self-pointer, filled in by PM code */ /* Self-pointer */
.quad 0 /* 16-bit code segment, filled in by PM code */ .word 0xffff /* Length - real mode default value */
.long pa_machine_real_restart_gdt
.word 0
/*
* 16-bit code segment pointing to real_mode_seg
* Selector value 8
*/
.word 0xffff /* Limit */
.long 0x9b000000 + pa_real_mode_base
.word 0
/* /*
* 16-bit data segment with the selector value 16 = 0x10 and * 16-bit data segment with the selector value 16 = 0x10 and
* base value 0x100; since this is consistent with real mode * base value 0x100; since this is consistent with real mode
......
#include "../../boot/regs.c"
/*
* Common heap and stack allocations
*/
#include <linux/linkage.h>
.data
GLOBAL(HEAP)
.long rm_heap
GLOBAL(heap_end)
.long rm_stack
.bss
.balign 16
GLOBAL(rm_heap)
.space 2048
GLOBAL(rm_stack)
.space 2048
GLOBAL(rm_stack_end)
...@@ -6,78 +6,69 @@ ...@@ -6,78 +6,69 @@
* *
* This is only used for booting secondary CPUs in SMP machine * This is only used for booting secondary CPUs in SMP machine
* *
* Entry: CS:IP point to the start of our code, we are * Entry: CS:IP point to the start of our code, we are
* in real mode with no stack, but the rest of the * in real mode with no stack, but the rest of the
* trampoline page to make our stack and everything else * trampoline page to make our stack and everything else
* is a mystery. * is a mystery.
* *
* We jump into arch/x86/kernel/head_32.S. * We jump into arch/x86/kernel/head_32.S.
* *
* On entry to trampoline_data, the processor is in real mode * On entry to trampoline_start, the processor is in real mode
* with 16-bit addressing and 16-bit data. CS has some value * with 16-bit addressing and 16-bit data. CS has some value
* and IP is zero. Thus, data addresses need to be absolute * and IP is zero. Thus, we load CS to the physical segment
* (no relocation) and are taken with regard to r_base. * of the real mode code before doing anything further.
*
* If you work on this file, check the object module with
* objdump --reloc to make sure there are no relocation
* entries except for:
*
* TYPE VALUE
* R_386_32 startup_32_smp
* R_386_32 boot_gdt
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/page_types.h> #include <asm/page_types.h>
#include "realmode.h"
#ifdef CONFIG_SMP .text
.section ".x86_trampoline","a"
.balign PAGE_SIZE
.code16 .code16
ENTRY(trampoline_data) .balign PAGE_SIZE
r_base = . ENTRY(trampoline_start)
wbinvd # Needed for NUMA-Q should be harmless for others wbinvd # Needed for NUMA-Q should be harmless for others
LJMPW_RM(1f)
1:
mov %cs, %ax # Code and data in the same place mov %cs, %ax # Code and data in the same place
mov %ax, %ds mov %ax, %ds
cli # We should be safe anyway cli # We should be safe anyway
movl $0xA5A5A5A5, trampoline_status - r_base movl tr_start, %eax # where we need to go
movl $0xA5A5A5A5, trampoline_status
# write marker for master knows we're running # write marker for master knows we're running
/* GDT tables in non default location kernel can be beyond 16MB and /*
* GDT tables in non default location kernel can be beyond 16MB and
* lgdt will not be able to load the address as in real mode default * lgdt will not be able to load the address as in real mode default
* operand size is 16bit. Use lgdtl instead to force operand size * operand size is 16bit. Use lgdtl instead to force operand size
* to 32 bit. * to 32 bit.
*/ */
lidtl tr_idt # load idt with 0, 0
lgdtl tr_gdt # load gdt with whatever is appropriate
lidtl boot_idt_descr - r_base # load idt with 0, 0 movw $1, %dx # protected mode (PE) bit
lgdtl boot_gdt_descr - r_base # load gdt with whatever is appropriate lmsw %dx # into protected mode
xor %ax, %ax
inc %ax # protected mode (PE) bit
lmsw %ax # into protected mode
# flush prefetch and jump to startup_32_smp in arch/i386/kernel/head.S
ljmpl $__BOOT_CS, $(startup_32_smp-__PAGE_OFFSET)
# These need to be in the same 64K segment as the above;
# hence we don't use the boot_gdt_descr defined in head.S
boot_gdt_descr:
.word __BOOT_DS + 7 # gdt limit
.long boot_gdt - __PAGE_OFFSET # gdt base
boot_idt_descr:
.word 0 # idt limit = 0
.long 0 # idt base = 0L
ENTRY(trampoline_status) ljmpl $__BOOT_CS, $pa_startup_32
.long 0
.globl trampoline_end .section ".text32","ax"
trampoline_end: .code32
ENTRY(startup_32) # note: also used from wakeup_asm.S
jmp *%eax
#endif /* CONFIG_SMP */ .bss
.balign 8
GLOBAL(trampoline_header)
tr_start: .space 4
tr_gdt_pad: .space 2
tr_gdt: .space 6
END(trampoline_header)
#include "trampoline_common.S"
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
* 4 Jan 1997 Michael Chastain: changed to gnu as. * 4 Jan 1997 Michael Chastain: changed to gnu as.
* 15 Sept 2005 Eric Biederman: 64bit PIC support * 15 Sept 2005 Eric Biederman: 64bit PIC support
* *
* Entry: CS:IP point to the start of our code, we are * Entry: CS:IP point to the start of our code, we are
* in real mode with no stack, but the rest of the * in real mode with no stack, but the rest of the
* trampoline page to make our stack and everything else * trampoline page to make our stack and everything else
* is a mystery. * is a mystery.
* *
* On entry to trampoline_data, the processor is in real mode * On entry to trampoline_start, the processor is in real mode
* with 16-bit addressing and 16-bit data. CS has some value * with 16-bit addressing and 16-bit data. CS has some value
* and IP is zero. Thus, data addresses need to be absolute * and IP is zero. Thus, data addresses need to be absolute
* (no relocation) and are taken with regard to r_base. * (no relocation) and are taken with regard to r_base.
...@@ -31,43 +31,33 @@ ...@@ -31,43 +31,33 @@
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/processor-flags.h> #include <asm/processor-flags.h>
#include "realmode.h"
.section ".x86_trampoline","a" .text
.balign PAGE_SIZE
.code16 .code16
ENTRY(trampoline_data) .balign PAGE_SIZE
r_base = . ENTRY(trampoline_start)
cli # We should be safe anyway cli # We should be safe anyway
wbinvd wbinvd
LJMPW_RM(1f)
1:
mov %cs, %ax # Code and data in the same place mov %cs, %ax # Code and data in the same place
mov %ax, %ds mov %ax, %ds
mov %ax, %es mov %ax, %es
mov %ax, %ss mov %ax, %ss
movl $0xA5A5A5A5, trampoline_status
# write marker for master knows we're running
movl $0xA5A5A5A5, trampoline_status - r_base # Setup stack
# write marker for master knows we're running movl $rm_stack_end, %esp
# Setup stack
movw $(trampoline_stack_end - r_base), %sp
call verify_cpu # Verify the cpu supports long mode call verify_cpu # Verify the cpu supports long mode
testl %eax, %eax # Check for return code testl %eax, %eax # Check for return code
jnz no_longmode jnz no_longmode
mov %cs, %ax
movzx %ax, %esi # Find the 32bit trampoline location
shll $4, %esi
# Fixup the absolute vectors
leal (startup_32 - r_base)(%esi), %eax
movl %eax, startup_32_vector - r_base
leal (startup_64 - r_base)(%esi), %eax
movl %eax, startup_64_vector - r_base
leal (tgdt - r_base)(%esi), %eax
movl %eax, (tgdt + 2 - r_base)
/* /*
* GDT tables in non default location kernel can be beyond 16MB and * GDT tables in non default location kernel can be beyond 16MB and
* lgdt will not be able to load the address as in real mode default * lgdt will not be able to load the address as in real mode default
...@@ -75,36 +65,49 @@ r_base = . ...@@ -75,36 +65,49 @@ r_base = .
* to 32 bit. * to 32 bit.
*/ */
lidtl tidt - r_base # load idt with 0, 0 lidtl tr_idt # load idt with 0, 0
lgdtl tgdt - r_base # load gdt with whatever is appropriate lgdtl tr_gdt # load gdt with whatever is appropriate
movw $__KERNEL_DS, %dx # Data segment descriptor
mov $X86_CR0_PE, %ax # protected mode (PE) bit # Enable protected mode
lmsw %ax # into protected mode movl $X86_CR0_PE, %eax # protected mode (PE) bit
movl %eax, %cr0 # into protected mode
# flush prefetch and jump to startup_32 # flush prefetch and jump to startup_32
ljmpl *(startup_32_vector - r_base) ljmpl $__KERNEL32_CS, $pa_startup_32
no_longmode:
hlt
jmp no_longmode
#include "../kernel/verify_cpu.S"
.section ".text32","ax"
.code32 .code32
.balign 4 .balign 4
startup_32: ENTRY(startup_32)
movl $__KERNEL_DS, %eax # Initialize the %ds segment register movl %edx, %ss
movl %eax, %ds addl $pa_real_mode_base, %esp
movl %edx, %ds
movl $X86_CR4_PAE, %eax movl %edx, %es
movl %edx, %fs
movl %edx, %gs
movl pa_tr_cr4, %eax
movl %eax, %cr4 # Enable PAE mode movl %eax, %cr4 # Enable PAE mode
# Setup trampoline 4 level pagetables # Setup trampoline 4 level pagetables
leal (trampoline_level4_pgt - r_base)(%esi), %eax movl $pa_trampoline_pgd, %eax
movl %eax, %cr3 movl %eax, %cr3
# Set up EFER
movl pa_tr_efer, %eax
movl pa_tr_efer + 4, %edx
movl $MSR_EFER, %ecx movl $MSR_EFER, %ecx
movl $(1 << _EFER_LME), %eax # Enable Long Mode
xorl %edx, %edx
wrmsr wrmsr
# Enable paging and in turn activate Long Mode # Enable paging and in turn activate Long Mode
# Enable protected mode movl $(X86_CR0_PG | X86_CR0_WP | X86_CR0_PE), %eax
movl $(X86_CR0_PG | X86_CR0_PE), %eax
movl %eax, %cr0 movl %eax, %cr0
/* /*
...@@ -113,59 +116,38 @@ startup_32: ...@@ -113,59 +116,38 @@ startup_32:
* EFER.LMA = 1). Now we want to jump in 64bit mode, to do that we use * EFER.LMA = 1). Now we want to jump in 64bit mode, to do that we use
* the new gdt/idt that has __KERNEL_CS with CS.L = 1. * the new gdt/idt that has __KERNEL_CS with CS.L = 1.
*/ */
ljmp *(startup_64_vector - r_base)(%esi) ljmpl $__KERNEL_CS, $pa_startup_64
.section ".text64","ax"
.code64 .code64
.balign 4 .balign 4
startup_64: ENTRY(startup_64)
# Now jump into the kernel using virtual addresses # Now jump into the kernel using virtual addresses
movq $secondary_startup_64, %rax jmpq *tr_start(%rip)
jmp *%rax
.code16
no_longmode:
hlt
jmp no_longmode
#include "verify_cpu.S"
.balign 4
# Careful these need to be in the same 64K segment as the above;
tidt:
.word 0 # idt limit = 0
.word 0, 0 # idt base = 0L
.section ".rodata","a"
# Duplicate the global descriptor table # Duplicate the global descriptor table
# so the kernel can live anywhere # so the kernel can live anywhere
.balign 4 .balign 16
tgdt: .globl tr_gdt
.short tgdt_end - tgdt # gdt limit tr_gdt:
.long tgdt - r_base .short tr_gdt_end - tr_gdt - 1 # gdt limit
.short 0 .long pa_tr_gdt
.short 0
.quad 0x00cf9b000000ffff # __KERNEL32_CS .quad 0x00cf9b000000ffff # __KERNEL32_CS
.quad 0x00af9b000000ffff # __KERNEL_CS .quad 0x00af9b000000ffff # __KERNEL_CS
.quad 0x00cf93000000ffff # __KERNEL_DS .quad 0x00cf93000000ffff # __KERNEL_DS
tgdt_end: tr_gdt_end:
.balign 4 .bss
startup_32_vector: .balign PAGE_SIZE
.long startup_32 - r_base GLOBAL(trampoline_pgd) .space PAGE_SIZE
.word __KERNEL32_CS, 0
.balign 4 .balign 8
startup_64_vector: GLOBAL(trampoline_header)
.long startup_64 - r_base tr_start: .space 8
.word __KERNEL_CS, 0 GLOBAL(tr_efer) .space 8
GLOBAL(tr_cr4) .space 4
END(trampoline_header)
.balign 4 #include "trampoline_common.S"
ENTRY(trampoline_status)
.long 0
trampoline_stack:
.org 0x1000
trampoline_stack_end:
ENTRY(trampoline_level4_pgt)
.quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
.fill 510,8,0
.quad level3_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE
ENTRY(trampoline_end)
.section ".rodata","a"
.balign 16
tr_idt: .fill 1, 6, 0
.bss
.balign 4
GLOBAL(trampoline_status) .space 4
#include "../../boot/video-bios.c"
#include "../../boot/video-mode.c"
#include "../../boot/video-vesa.c"
#include "../../boot/video-vga.c"
...@@ -65,7 +65,8 @@ void main(void) ...@@ -65,7 +65,8 @@ void main(void)
{ {
/* Kill machine if structures are wrong */ /* Kill machine if structures are wrong */
if (wakeup_header.real_magic != 0x12345678) if (wakeup_header.real_magic != 0x12345678)
while (1); while (1)
;
if (wakeup_header.realmode_flags & 4) if (wakeup_header.realmode_flags & 4)
send_morse("...-"); send_morse("...-");
......
...@@ -12,9 +12,8 @@ ...@@ -12,9 +12,8 @@
/* This must match data at wakeup.S */ /* This must match data at wakeup.S */
struct wakeup_header { struct wakeup_header {
u16 video_mode; /* Video mode number */ u16 video_mode; /* Video mode number */
u16 _jmp1; /* ljmpl opcode, 32-bit only */
u32 pmode_entry; /* Protected mode resume point, 32-bit only */ u32 pmode_entry; /* Protected mode resume point, 32-bit only */
u16 _jmp2; /* CS value, 32-bit only */ u16 pmode_cs;
u32 pmode_cr0; /* Protected mode cr0 */ u32 pmode_cr0; /* Protected mode cr0 */
u32 pmode_cr3; /* Protected mode cr3 */ u32 pmode_cr3; /* Protected mode cr3 */
u32 pmode_cr4; /* Protected mode cr4 */ u32 pmode_cr4; /* Protected mode cr4 */
...@@ -26,12 +25,6 @@ struct wakeup_header { ...@@ -26,12 +25,6 @@ struct wakeup_header {
u32 pmode_behavior; /* Wakeup routine behavior flags */ u32 pmode_behavior; /* Wakeup routine behavior flags */
u32 realmode_flags; u32 realmode_flags;
u32 real_magic; u32 real_magic;
u16 trampoline_segment; /* segment with trampoline code, 64-bit only */
u8 _pad1;
u8 wakeup_jmp;
u16 wakeup_jmp_off;
u16 wakeup_jmp_seg;
u64 wakeup_gdt[3];
u32 signature; /* To check we have correct structure */ u32 signature; /* To check we have correct structure */
} __attribute__((__packed__)); } __attribute__((__packed__));
...@@ -40,7 +33,6 @@ extern struct wakeup_header wakeup_header; ...@@ -40,7 +33,6 @@ extern struct wakeup_header wakeup_header;
#define WAKEUP_HEADER_OFFSET 8 #define WAKEUP_HEADER_OFFSET 8
#define WAKEUP_HEADER_SIGNATURE 0x51ee1111 #define WAKEUP_HEADER_SIGNATURE 0x51ee1111
#define WAKEUP_END_SIGNATURE 0x65a22c82
/* Wakeup behavior bits */ /* Wakeup behavior bits */
#define WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE 0 #define WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE 0
......
/* /*
* ACPI wakeup real mode startup stub * ACPI wakeup real mode startup stub
*/ */
#include <linux/linkage.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/msr-index.h> #include <asm/msr-index.h>
#include <asm/page_types.h> #include <asm/page_types.h>
#include <asm/pgtable_types.h> #include <asm/pgtable_types.h>
#include <asm/processor-flags.h> #include <asm/processor-flags.h>
#include "realmode.h"
#include "wakeup.h" #include "wakeup.h"
.code16 .code16
.section ".jump", "ax"
.globl _start
_start:
cli
jmp wakeup_code
/* This should match the structure in wakeup.h */ /* This should match the structure in wakeup.h */
.section ".header", "a" .section ".data", "aw"
.globl wakeup_header
wakeup_header: .balign 16
video_mode: .short 0 /* Video mode number */ GLOBAL(wakeup_header)
pmode_return: .byte 0x66, 0xea /* ljmpl */ video_mode: .short 0 /* Video mode number */
.long 0 /* offset goes here */ pmode_entry: .long 0
.short __KERNEL_CS pmode_cs: .short __KERNEL_CS
pmode_cr0: .long 0 /* Saved %cr0 */ pmode_cr0: .long 0 /* Saved %cr0 */
pmode_cr3: .long 0 /* Saved %cr3 */ pmode_cr3: .long 0 /* Saved %cr3 */
pmode_cr4: .long 0 /* Saved %cr4 */ pmode_cr4: .long 0 /* Saved %cr4 */
pmode_efer: .quad 0 /* Saved EFER */ pmode_efer: .quad 0 /* Saved EFER */
pmode_gdt: .quad 0 pmode_gdt: .quad 0
pmode_misc_en: .quad 0 /* Saved MISC_ENABLE MSR */ pmode_misc_en: .quad 0 /* Saved MISC_ENABLE MSR */
pmode_behavior: .long 0 /* Wakeup behavior flags */ pmode_behavior: .long 0 /* Wakeup behavior flags */
realmode_flags: .long 0 realmode_flags: .long 0
real_magic: .long 0 real_magic: .long 0
trampoline_segment: .word 0 signature: .long WAKEUP_HEADER_SIGNATURE
_pad1: .byte 0 END(wakeup_header)
wakeup_jmp: .byte 0xea /* ljmpw */
wakeup_jmp_off: .word 3f
wakeup_jmp_seg: .word 0
wakeup_gdt: .quad 0, 0, 0
signature: .long WAKEUP_HEADER_SIGNATURE
.text .text
.code16 .code16
wakeup_code:
.balign 16
ENTRY(wakeup_start)
cli
cld cld
LJMPW_RM(3f)
3:
/* Apparently some dimwit BIOS programmers don't know how to /* Apparently some dimwit BIOS programmers don't know how to
program a PM to RM transition, and we might end up here with program a PM to RM transition, and we might end up here with
junk in the data segment descriptor registers. The only way junk in the data segment descriptor registers. The only way
...@@ -54,8 +51,7 @@ wakeup_code: ...@@ -54,8 +51,7 @@ wakeup_code:
movl %cr0, %eax movl %cr0, %eax
orb $X86_CR0_PE, %al orb $X86_CR0_PE, %al
movl %eax, %cr0 movl %eax, %cr0
jmp 1f ljmpw $8, $2f
1: ljmpw $8, $2f
2: 2:
movw %cx, %ds movw %cx, %ds
movw %cx, %es movw %cx, %es
...@@ -65,16 +61,18 @@ wakeup_code: ...@@ -65,16 +61,18 @@ wakeup_code:
andb $~X86_CR0_PE, %al andb $~X86_CR0_PE, %al
movl %eax, %cr0 movl %eax, %cr0
jmp wakeup_jmp LJMPW_RM(3f)
3: 3:
/* Set up segments */ /* Set up segments */
movw %cs, %ax movw %cs, %ax
movw %ax, %ss
movl $rm_stack_end, %esp
movw %ax, %ds movw %ax, %ds
movw %ax, %es movw %ax, %es
movw %ax, %ss movw %ax, %fs
lidtl wakeup_idt movw %ax, %gs
movl $wakeup_stack_end, %esp lidtl wakeup_idt
/* Clear the EFLAGS */ /* Clear the EFLAGS */
pushl $0 pushl $0
...@@ -87,7 +85,7 @@ wakeup_code: ...@@ -87,7 +85,7 @@ wakeup_code:
/* Check we really have everything... */ /* Check we really have everything... */
movl end_signature, %eax movl end_signature, %eax
cmpl $WAKEUP_END_SIGNATURE, %eax cmpl $REALMODE_END_SIGNATURE, %eax
jne bogus_real_magic jne bogus_real_magic
/* Call the C code */ /* Call the C code */
...@@ -128,14 +126,13 @@ wakeup_code: ...@@ -128,14 +126,13 @@ wakeup_code:
lgdtl pmode_gdt lgdtl pmode_gdt
/* This really couldn't... */ /* This really couldn't... */
movl pmode_cr0, %eax movl pmode_entry, %eax
movl %eax, %cr0 movl pmode_cr0, %ecx
jmp pmode_return movl %ecx, %cr0
ljmpl $__KERNEL_CS, $pa_startup_32
/* -> jmp *%eax in trampoline_32.S */
#else #else
pushw $0 jmp trampoline_start
pushw trampoline_segment
pushw $0
lret
#endif #endif
bogus_real_magic: bogus_real_magic:
...@@ -143,28 +140,38 @@ bogus_real_magic: ...@@ -143,28 +140,38 @@ bogus_real_magic:
hlt hlt
jmp 1b jmp 1b
.data .section ".rodata","a"
/*
* Set up the wakeup GDT. We set these up as Big Real Mode,
* that is, with limits set to 4 GB. At least the Lenovo
* Thinkpad X61 is known to need this for the video BIOS
* initialization quirk to work; this is likely to also
* be the case for other laptops or integrated video devices.
*/
.balign 16
GLOBAL(wakeup_gdt)
.word 3*8-1 /* Self-descriptor */
.long pa_wakeup_gdt
.word 0
.word 0xffff /* 16-bit code segment @ real_mode_base */
.long 0x9b000000 + pa_real_mode_base
.word 0x008f /* big real mode */
.word 0xffff /* 16-bit data segment @ real_mode_base */
.long 0x93000000 + pa_real_mode_base
.word 0x008f /* big real mode */
END(wakeup_gdt)
.section ".rodata","a"
.balign 8 .balign 8
/* This is the standard real-mode IDT */ /* This is the standard real-mode IDT */
wakeup_idt: .balign 16
GLOBAL(wakeup_idt)
.word 0xffff /* limit */ .word 0xffff /* limit */
.long 0 /* address */ .long 0 /* address */
.word 0 .word 0
END(wakeup_idt)
.globl HEAP, heap_end
HEAP:
.long wakeup_heap
heap_end:
.long wakeup_stack
.bss
wakeup_heap:
.space 2048
wakeup_stack:
.space 2048
wakeup_stack_end:
.section ".signature","a"
end_signature:
.long WAKEUP_END_SIGNATURE
...@@ -2,11 +2,19 @@ ...@@ -2,11 +2,19 @@
* Wrapper script for the realmode binary as a transport object * Wrapper script for the realmode binary as a transport object
* before copying to low memory. * before copying to low memory.
*/ */
#include <linux/linkage.h>
#include <asm/page_types.h> #include <asm/page_types.h>
.section ".x86_trampoline","a" .section ".init.data","aw"
.balign PAGE_SIZE .balign PAGE_SIZE
.globl acpi_wakeup_code
acpi_wakeup_code: GLOBAL(real_mode_blob)
.incbin "arch/x86/kernel/acpi/realmode/wakeup.bin" .incbin "arch/x86/realmode/rm/realmode.bin"
.size acpi_wakeup_code, .-acpi_wakeup_code END(real_mode_blob)
GLOBAL(real_mode_blob_end);
GLOBAL(real_mode_relocs)
.incbin "arch/x86/realmode/rm/realmode.relocs"
END(real_mode_relocs)
...@@ -77,6 +77,13 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = { ...@@ -77,6 +77,13 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
static const char * const sym_regex_realmode[S_NSYMTYPES] = { static const char * const sym_regex_realmode[S_NSYMTYPES] = {
/*
* These symbols are known to be relative, even if the linker marks them
* as absolute (typically defined outside any section in the linker script.)
*/
[S_REL] =
"^pa_",
/* /*
* These are 16-bit segment symbols when compiling 16-bit code. * These are 16-bit segment symbols when compiling 16-bit code.
*/ */
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/sysfs.h> #include <linux/sysfs.h>
#include <linux/io.h>
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h> #include <acpi/acpi_drivers.h>
#include <asm/realmode.h>
#include "internal.h" #include "internal.h"
#include "sleep.h" #include "sleep.h"
...@@ -91,13 +93,13 @@ static struct notifier_block tts_notifier = { ...@@ -91,13 +93,13 @@ static struct notifier_block tts_notifier = {
static int acpi_sleep_prepare(u32 acpi_state) static int acpi_sleep_prepare(u32 acpi_state)
{ {
#ifdef CONFIG_ACPI_SLEEP #ifdef CONFIG_ACPI_SLEEP
unsigned long wakeup_pa = real_mode_header->wakeup_start;
/* do we have a wakeup address for S2 and S3? */ /* do we have a wakeup address for S2 and S3? */
if (acpi_state == ACPI_STATE_S3) { if (acpi_state == ACPI_STATE_S3) {
if (!acpi_wakeup_address) { if (!wakeup_pa)
return -EFAULT; return -EFAULT;
}
acpi_set_firmware_waking_vector( acpi_set_firmware_waking_vector(
(acpi_physical_address)acpi_wakeup_address); (acpi_physical_address)wakeup_pa);
} }
ACPI_FLUSH_CPU_CACHE(); ACPI_FLUSH_CPU_CACHE();
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <acpi/acpi_drivers.h> #include <acpi/acpi_drivers.h>
#include <acpi/processor.h> #include <acpi/processor.h>
#include <xen/xen.h>
#include <xen/interface/platform.h> #include <xen/interface/platform.h>
#include <asm/xen/hypercall.h> #include <asm/xen/hypercall.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册