linux/include/asm-x86
Rafael J. Wysocki d158cbdf39 Hibernation: Arbitrary boot kernel support on x86_64
Make it possible to restore a hibernation image on x86_64 with the help of a
kernel different from the one in the image.

The idea is to split the core restoration code into two separate parts and to
place each of them in a different page.   The first part belongs to the boot
kernel and is executed as the last step of the image kernel's memory
restoration procedure.   Before being executed, it is relocated to a safe page
that won't be overwritten while copying the image kernel pages.

The final operation performed by it is a jump to the second part of the core
restoration code that belongs to the image kernel and has just been restored.
This code makes the CPU switch to the image kernel's page tables and restores
the state of general purpose registers (including the stack pointer) from
before the hibernation.

The main issue with this idea is that in order to jump to the second part of
the core restoration code the boot kernel needs to know its address.
 However, this address may be passed to it in the image header.   Namely, the
part of the image header previously used for checking if the version of the
image kernel is correct can be replaced with some architecture specific data
that will allow the boot kernel to jump to the right address within the image
kernel.   These data should also be used for checking if the image kernel is
compatible with the boot kernel (as far as the memory restroration procedure
is concerned).  It can be done, for example, with the help of a "magic" value
that has to be equal in both kernels, so that they can be regarded as
compatible.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-18 14:37:19 -07:00
..
mach-bigsmp
mach-default i386: fix 4 bit apicid assumption of mach-default 2007-10-17 20:15:24 +02:00
mach-es7000
mach-generic
mach-numaq
mach-summit
mach-visws x86: visws extern inline to static inline 2007-10-17 20:16:39 +02:00
mach-voyager
xen
a.out_32.h
a.out_64.h
a.out.h
acpi_32.h
acpi_64.h
acpi.h
agp.h x86: unify include/asm/agp_32/64.h 2007-10-17 20:17:12 +02:00
alternative_32.h
alternative_64.h
alternative-asm.h x86: rename .i assembler includes to .h 2007-10-17 20:16:29 +02:00
alternative.h
apic_32.h
apic_64.h x86_64: remove now unused code 2007-10-12 23:04:23 +02:00
apic.h
apicdef_32.h
apicdef_64.h
apicdef.h
arch_hooks.h
atomic_32.h
atomic_64.h x86: make atomic64_t work like atomic_t 2007-10-17 20:16:21 +02:00
atomic.h
auxvec.h x86: unify include/asm/auxvec_32/64.h 2007-10-17 20:17:13 +02:00
bitops_32.h
bitops_64.h x86: Eliminate result signage problem in asm-x86_64/bitops.h 2007-10-17 20:16:27 +02:00
bitops.h
boot.h
bootparam.h [x86] remove uses of magic macros for boot_params access 2007-10-16 17:38:31 -07:00
bug.h x86: unify include/asm/bug_32/64.h 2007-10-17 20:26:16 +02:00
bugs.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
byteorder_32.h
byteorder_64.h
byteorder.h
cache.h x86: unify include/asm/cache_32/64.h 2007-10-17 20:17:15 +02:00
cacheflush.h x86: unify include/asm/cacheflush_32/64.h 2007-10-17 20:17:14 +02:00
calgary.h
calling.h
checksum_32.h
checksum_64.h
checksum.h
cmpxchg_32.h
cmpxchg_64.h
cmpxchg.h
compat.h
cpu.h i386: no need to make enable_cpu_hotplug a variable 2007-10-17 20:16:16 +02:00
cpufeature_32.h I/OAT: Add DCA services 2007-10-16 09:43:09 -07:00
cpufeature_64.h minimal build fixes for uml (fallout from x86 merge) 2007-10-13 09:57:15 -07:00
cpufeature.h
cputime.h x86: trivial header merges 2007-10-17 20:17:08 +02:00
current_32.h
current_64.h
current.h
debugreg.h x86: unify include/asm/debugreg_32/64.h 2007-10-17 20:35:37 +02:00
delay.h x86: unify include/asm/delay_32/64.h 2007-10-17 20:17:17 +02:00
desc_32.h
desc_64.h
desc_defs.h
desc.h
device.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
div64_32.h
div64_64.h
div64.h
dma_32.h
dma_64.h
dma-mapping_32.h i386 dma_map_sg: convert to using sg helpers 2007-10-16 11:26:01 +02:00
dma-mapping_64.h x86-64: enable sg chaining 2007-10-16 11:26:02 +02:00
dma-mapping.h
dma.h
dmi.h x86: unify include/asm/dmi_32/64.h 2007-10-17 20:17:18 +02:00
dwarf2_32.h
dwarf2_64.h
dwarf2.h
e820_32.h
e820_64.h
e820.h
edac.h x86: unify include/asm/cache_32/64.h 2007-10-17 20:17:19 +02:00
elf_32.h increase AT_VECTOR_SIZE to terminate saved_auxv properly 2007-10-17 08:43:00 -07:00
elf_64.h
elf.h
emergency-restart.h
errno.h x86: trivial header merges 2007-10-17 20:17:08 +02:00
fb.h x86: unify include/asm/cache_32/64.h 2007-10-17 20:17:21 +02:00
fcntl.h
fixmap_32.h
fixmap_64.h
fixmap.h
floppy.h x86: unify include/asm/floppy_32/64.h 2007-10-17 20:24:56 +02:00
fpu32.h
frame.h x86: rename .i assembler includes to .h 2007-10-17 20:16:29 +02:00
futex_32.h
futex_64.h
futex.h
genapic_32.h
genapic_64.h
genapic.h
geode.h x86: Geode Multi-Function General Purpose Timers support 2007-10-12 23:04:06 +02:00
hardirq_32.h x86: expand /proc/interrupts to include missing vectors, v2 2007-10-17 20:16:53 +02:00
hardirq_64.h
hardirq.h
highmem.h
hpet.h x86: HPET force enable for ICH5 2007-10-12 23:04:24 +02:00
hw_irq_32.h
hw_irq_64.h x86: Add parenthesis to IRQ vector macros 2007-10-17 20:16:28 +02:00
hw_irq.h
hypertransport.h
i387_32.h
i387_64.h
i387.h
i8253.h i386: Remove the useless #ifdef in i8253.h 2007-10-12 23:04:23 +02:00
i8259.h
ia32_unistd.h
ia32.h
ide.h
idle.h
intel_arch_perfmon.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
io_32.h x86: asm-i386/io.h fix constness 2007-10-17 20:16:40 +02:00
io_64.h Remove dma_cache_(wback|inv|wback_inv) functions 2007-10-17 08:42:57 -07:00
io_apic_32.h i386: Expose IOAPIC register definitions even if CONFIG_X86_IO_APIC is not set 2007-10-13 10:18:17 +02:00
io_apic_64.h
io_apic.h
io.h
ioctl.h
ioctls.h x86: unify include/asm/ioctls_32/64.h 2007-10-17 20:26:11 +02:00
iommu.h
ipcbuf.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
ipi.h
irq_32.h
irq_64.h
irq_regs_32.h
irq_regs_64.h
irq_regs.h
irq.h
irqflags_32.h lockdep: i386: connect the sysexit hook 2007-10-11 22:11:12 +02:00
irqflags_64.h lockdep: x86_64: connect the sysexit hook 2007-10-11 22:11:12 +02:00
irqflags.h
ist.h
k8.h
Kbuild x86: unify include/asm/debugreg_32/64.h 2007-10-17 20:35:37 +02:00
kdebug.h x86: unify include/asm/kdebug_32/64.h 2007-10-17 20:26:12 +02:00
kexec_32.h
kexec_64.h
kexec.h
kmap_types.h x86: unify include/asm/agp_32/64.h 2007-10-17 20:26:13 +02:00
kprobes_32.h kprobes: support kretprobe blacklist 2007-10-16 09:43:10 -07:00
kprobes_64.h kprobes: support kretprobe blacklist 2007-10-16 09:43:10 -07:00
kprobes.h
ldt.h x86: unify include/asm/ldt_32/64.h 2007-10-17 20:16:47 +02:00
linkage_32.h
linkage_64.h
linkage.h
local_32.h
local_64.h
local.h
mach_apic.h
math_emu.h
mc146818rtc_32.h
mc146818rtc_64.h
mc146818rtc.h
mca_dma.h
mca.h
mce.h x86: unify include/asm/mce_32/64.h 2007-10-17 20:16:44 +02:00
mman.h x86: unify include/asm/mman_32/64.h 2007-10-17 20:26:15 +02:00
mmsegment.h
mmu_32.h x86: convert mm_context_t semaphore to a mutex 2007-10-17 20:17:05 +02:00
mmu_64.h x86: convert mm_context_t semaphore to a mutex 2007-10-17 20:17:00 +02:00
mmu_context_32.h
mmu_context_64.h
mmu_context.h
mmu.h
mmx.h
mmzone_32.h
mmzone_64.h
mmzone.h
module_32.h
module_64.h
module.h
mpspec_32.h
mpspec_64.h
mpspec_def.h
mpspec.h
msgbuf_32.h
msgbuf_64.h
msgbuf.h
msidef.h
msr_32.h
msr_64.h
msr-index.h
msr.h
mtrr_32.h
mtrr_64.h
mtrr.h
mutex_32.h
mutex_64.h
mutex.h
namei.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
nmi_32.h
nmi_64.h
nmi.h
numa_32.h
numa_64.h x86: clean up apicid_to_node declaration 2007-10-17 20:15:16 +02:00
numa.h
numaq.h
page_32.h
page_64.h x86_64: SPARSEMEM_VMEMMAP 2M page size support 2007-10-16 09:42:51 -07:00
page.h
param.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
paravirt.h paravirt: clean up lazy mode handling 2007-10-16 11:51:29 -07:00
parport.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
pci_32.h PCI: merge almost all of pci_32.h and pci_64.h together 2007-10-12 15:03:20 -07:00
pci_64.h PCI: merge almost all of pci_32.h and pci_64.h together 2007-10-12 15:03:20 -07:00
pci-direct.h
pci.h PCI: merge almost all of pci_32.h and pci_64.h together 2007-10-12 15:03:20 -07:00
pda.h x86: expand /proc/interrupts to include missing vectors, v2 2007-10-17 20:16:53 +02:00
percpu_32.h
percpu_64.h
percpu.h
pgalloc_32.h
pgalloc_64.h
pgalloc.h
pgtable_32.h Slab API: remove useless ctor parameter and reorder parameters 2007-10-17 08:42:45 -07:00
pgtable_64.h x86_64: SPARSEMEM_VMEMMAP 2M page size support 2007-10-16 09:42:51 -07:00
pgtable-2level-defs.h
pgtable-2level.h
pgtable-3level-defs.h paravirt: refactor struct paravirt_ops into smaller pv_*_ops 2007-10-16 11:51:29 -07:00
pgtable-3level.h
pgtable.h
poll.h
posix_types_32.h
posix_types_64.h
posix_types.h
prctl.h
processor_32.h x86: multi-byte single instruction NOPs 2007-10-17 20:17:04 +02:00
processor_64.h x86: multi-byte single instruction NOPs 2007-10-17 20:17:04 +02:00
processor-cyrix.h
processor-flags.h KVM: Use standard CR8 flags, and fix TPR definition 2007-10-13 10:18:19 +02:00
processor.h
proto.h x86_64: remove now unused code 2007-10-12 23:04:23 +02:00
ptrace_32.h
ptrace_64.h
ptrace-abi.h x86: unify include/asm/ptrace-abi_32/64.h 2007-10-17 20:16:45 +02:00
ptrace.h
reboot_fixups.h
reboot.h
required-features_32.h
required-features_64.h
required-features.h
resource.h x86: trivial header merges 2007-10-17 20:17:08 +02:00
resume-trace_32.h
resume-trace_64.h
resume-trace.h
rio.h
rtc.h x86: trivial header merges 2007-10-17 20:17:08 +02:00
rwlock.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
rwsem.h
scatterlist_32.h i386: enable sg chaining 2007-10-16 11:26:01 +02:00
scatterlist_64.h x86-64: enable sg chaining 2007-10-16 11:26:02 +02:00
scatterlist.h
seccomp_32.h
seccomp_64.h
seccomp.h
sections.h x86: trivial header merges 2007-10-17 20:17:08 +02:00
segment_32.h
segment_64.h
segment.h
semaphore_32.h kill DECLARE_MUTEX_LOCKED 2007-10-17 08:42:47 -07:00
semaphore_64.h kill DECLARE_MUTEX_LOCKED 2007-10-17 08:42:47 -07:00
semaphore.h
sembuf.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
serial.h x86: merge some trivially mergeable headers 2007-10-17 20:17:09 +02:00
setup_32.h [x86] remove uses of magic macros for boot_params access 2007-10-16 17:38:31 -07:00
setup_64.h [x86] remove uses of magic macros for boot_params access 2007-10-16 17:38:31 -07:00
setup.h
shmbuf_32.h
shmbuf_64.h
shmbuf.h
shmparam.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
sigcontext32.h
sigcontext_32.h
sigcontext_64.h
sigcontext.h
siginfo.h x86: unify include/asm/siginfo_32/64.h 2007-10-17 20:26:17 +02:00
signal_32.h
signal_64.h
signal.h
smp_32.h i386: export i386 smp_call_function_mask() to modules 2007-10-17 20:15:21 +02:00
smp_64.h x86: remove x86_cpu_to_log_apicid 2007-10-17 20:16:24 +02:00
smp.h
socket.h
sockios.h x86: merge some trivially mergeable headers 2007-10-17 20:17:09 +02:00
sparsemem_32.h
sparsemem_64.h
sparsemem.h
spinlock_32.h
spinlock_64.h
spinlock_types.h
spinlock.h
srat.h
stacktrace.h x86: constify stacktrace_ops 2007-10-17 20:16:11 +02:00
stat_32.h
stat_64.h
stat.h
statfs_32.h
statfs_64.h
statfs.h
string_32.h i386: Remove strrchr assembler implementation 2007-10-17 20:16:23 +02:00
string_64.h
string.h
suspend_32.h
suspend_64.h Hibernation: Arbitrary boot kernel support on x86_64 2007-10-18 14:37:19 -07:00
suspend.h
swiotlb.h
sync_bitops.h
system_32.h x86: Create clflush() inline, remove hardcoded wbinvd 2007-10-17 20:16:12 +02:00
system_64.h x86: remove STR() macros 2007-10-17 20:16:25 +02:00
system.h
tce.h
termbits.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
termios.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
therm_throt.h
thread_info_32.h
thread_info_64.h
thread_info.h
time.h
timer.h
timex.h x86: unify timex.h variants 2007-10-12 23:04:23 +02:00
tlb.h x86: unify include/asm/tlb_32/64.h 2007-10-17 20:26:18 +02:00
tlbflush_32.h
tlbflush_64.h
tlbflush.h
topology_32.h Convert cpu_sibling_map to be a per cpu variable 2007-10-16 09:42:50 -07:00
topology_64.h Convert cpu_sibling_map to be a per cpu variable 2007-10-16 09:42:50 -07:00
topology.h
tsc.h x86: unify timex.h variants 2007-10-12 23:04:23 +02:00
types.h x86: unify include/asm/types_32/64.h 2007-10-17 20:32:07 +02:00
uaccess_32.h
uaccess_64.h
uaccess.h
ucontext.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
unaligned.h x86: unify some more trivial include/asm-x86/ 32/64 variants 2007-10-17 20:17:10 +02:00
unistd_32.h
unistd_64.h x86: cleanup 64bit unistd.h 2007-10-17 20:16:36 +02:00
unistd.h
unwind.h x86: unify include/asm/unwind_32/64.h 2007-10-17 20:32:38 +02:00
user32.h
user_32.h
user_64.h
user.h
vga.h
vgtod.h
vic.h
vm86.h
vmi_time.h
vmi.h
voyager.h
vsyscall32.h
vsyscall.h i386/x8664: cleanup the shared hpet code 2007-10-12 23:04:23 +02:00
xor_32.h
xor_64.h
xor.h