u-boot/arch/x86/include/asm
Bin Meng 5ae5aa9310 x86: acpi: Fix Windows S3 resume failure
U-Boot sets up the real mode interrupt handler stubs starting from
address 0x1000. In most cases, the first 640K (0x00000 - 0x9ffff)
system memory is reported as system RAM in E820 table to the OS.
(see install_e820_map() implementation for each platform). So OS
can use these memories whatever it wants.

If U-Boot is in an S3 resume path, care must be taken not to corrupt
these memorie otherwise OS data gets lost. Testing shows that, on
Microsoft Windows 10 on Intel Baytrail its wake up vector happens to
be installed at the same address 0x1000. While on Linux its wake up
vector does not overlap this memory range, but after resume kernel
checks low memory range per config option CONFIG_X86_RESERVE_LOW
which is 64K by default to see whether a memory corruption occurs
during the suspend/resume (it's harmless, but warnings are shown
in the kernel dmesg logs).

We cannot simply mark the these memory as reserved in E820 table
because such configuration makes GRUB complain: unable to allocate
real mode page. Hence we choose to back up these memories to the
place where we reserved on our stack for our S3 resume work.
Before jumping to OS wake up vector, we need restore the original
content there.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Stefan Roese <sr@denx.de>
2017-05-17 17:11:46 +08:00
..
acpi x86: baytrail: Introduce ACPI global NVS 2016-07-12 13:46:01 +08:00
arch-baytrail x86: baytrail: Conditionally report S3 in the ACPI table 2017-05-17 17:11:46 +08:00
arch-broadwell x86: broadwell: Add support for SDRAM setup 2016-03-17 10:27:26 +08:00
arch-coreboot x86: Move sysinfo related to sysinfo.h 2016-03-17 10:27:21 +08:00
arch-ivybridge dm: x86: Move link to use driver model for video 2016-10-11 11:55:33 +08:00
arch-qemu x86: Drop asm/arch/gpio.h 2016-02-05 12:47:21 +08:00
arch-quark x86: acpi: Pack global NVS into ACPI table 2016-07-12 13:46:01 +08:00
arch-queensbay x86: Drop asm/arch/gpio.h 2016-02-05 12:47:21 +08:00
fsp x86: fsp: Fix cast for 64-bit compilation 2017-02-06 11:38:46 +08:00
video x86: Rename i386 to x86 2011-04-13 19:43:28 +10:00
acpi_s3.h x86: acpi: Fix Windows S3 resume failure 2017-05-17 17:11:46 +08:00
acpi_table.h x86: acpi: Refactor acpi_resume() 2017-05-17 17:11:46 +08:00
atomic.h x86: Add atomic operations 2015-04-29 21:02:33 -06:00
bitops.h x86: Use the generic bitops headers 2015-11-05 10:52:01 -05:00
bootm.h x86: Move kernel boot function to arch/x86/lib/bootm.c 2014-10-28 20:43:58 -06:00
bootparam.h x86: Synchronize list of x86 subarchitectures (update bootparam.h) 2017-02-06 11:38:46 +08:00
byteorder.h x86: Fix up byteorder.h for x86_64 2017-02-06 11:38:46 +08:00
cache.h x86: cache.h: Add default for CONFIG_SYS_CACHELINE_SIZE 2016-08-16 11:44:09 +08:00
cmos_layout.h x86: fsp: Save stack address to CMOS for next S3 boot 2017-05-17 17:11:46 +08:00
config.h generic-board: select SYS_GENERIC_BOARD for some architectures 2015-03-28 09:03:08 -04:00
control_regs.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
coreboot_tables.h x86: Prepare configuration tables in dedicated high memory region 2016-05-23 15:18:00 +08:00
cpu.h x86: Introduce minimal PMU driver for Intel MID platforms 2017-04-10 10:02:03 +08:00
cpu_common.h x86: Move common CPU code to its own place 2016-03-17 10:27:24 +08:00
cpu_x86.h cpu: Add get_vendor callback 2016-10-19 09:01:51 +02:00
e820.h x86: Move install_e820_map() out of zimage.c 2015-10-21 07:46:25 -06:00
early_cmos.h x86: Add an early CMOS access library 2017-05-17 17:11:46 +08:00
elf.h x86: Add asm/elf.h for x86-specific ELF definitions 2015-08-05 08:44:05 -06:00
global_data.h x86: acpi: Fix Windows S3 resume failure 2017-05-17 17:11:46 +08:00
gpio.h x86: Drop all the old pin configuration code 2016-03-17 10:27:25 +08:00
i8254.h x86: Fix cosmetic issues in the i8254 and i8259 codes 2015-11-13 06:46:17 -08:00
i8259.h x86: Fix cosmetic issues in the i8254 and i8259 codes 2015-11-13 06:46:17 -08:00
ibmpc.h x86: superio: Add keyboard controller support to smsc_lpc47m driver 2015-08-26 07:54:12 -07:00
intel_regs.h x86: Move common CPU code to its own place 2016-03-17 10:27:24 +08:00
interrupt.h x86: Rename CONFIG_SYS_NUM_IRQS to SYS_NUM_IRQS 2015-11-13 06:46:16 -08:00
io.h x86: Allow I/O functions to use pointers 2016-03-17 10:27:25 +08:00
ioapic.h x86: Add a function to set the IOAPIC ID 2016-03-17 10:27:27 +08:00
ioctl.h x86: Rename i386 to x86 2011-04-13 19:43:28 +10:00
irq.h x86: irq: Enable SCI on IRQ9 2016-05-23 15:18:00 +08:00
ist.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
lapic.h x86: Remove inline for lapic access routines 2015-07-14 18:03:17 -06:00
linkage.h x86: move arch-specific asmlinkage to <asm/linkage.h> 2014-12-15 07:22:53 -07:00
lpc_common.h x86: Move common LPC code to its own place 2016-03-17 10:27:24 +08:00
me_common.h x86: Move Intel Management Engine code to a common place 2016-03-17 10:27:24 +08:00
microcode.h x86: Update microcode for secondary CPUs 2016-03-17 10:27:25 +08:00
mp.h x86: Move the i386 code into its own directory 2017-02-06 11:38:46 +08:00
mpspec.h x86: Update mpspec to build on 64-bit machines 2017-02-06 11:38:46 +08:00
mrc_common.h x86: Add common SDRAM-init code 2016-03-17 10:27:27 +08:00
mrccache.h x86: Use struct mrc_region to describe a mrc region 2015-10-21 07:46:27 -06:00
msr-index.h x86: Add some more common MSR indexes 2016-03-17 10:27:23 +08:00
msr.h treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
mtrr.h x86: Change pci option rom area MTRR setting to cacheable 2015-07-28 10:36:22 -06:00
pch_common.h x86: Move common PCH code into a common place 2016-03-17 10:27:27 +08:00
pci.h x86: Drop pci_type1.c and DEFINE_PCI_DEVICE_TABLE 2016-02-05 12:47:24 +08:00
pirq_routing.h x86: irq: Move irq_router to a per driver priv 2016-02-05 12:47:22 +08:00
pmu.h x86: Introduce minimal PMU driver for Intel MID platforms 2017-04-10 10:02:03 +08:00
pnp_def.h x86: Add a simple superio driver for SMSC LPC47M 2014-12-13 22:32:05 -07:00
posix_types.h x86: Fix up type sizes for 64-bit 2017-02-06 11:38:46 +08:00
post.h x86: Add post codes for OS resume 2017-05-17 17:11:46 +08:00
processor-flags.h x86: Rename i386 to x86 2011-04-13 19:43:28 +10:00
processor.h x86: Rename PORT_RESET to IO_PORT_RESET 2016-03-17 10:27:24 +08:00
ptrace.h x86: Display correct CS/EIP/EFLAGS when there is an error code 2015-07-28 10:36:21 -06:00
report_platform.h x86: Move Intel Management Engine code to a common place 2016-03-17 10:27:24 +08:00
scu.h x86: Add SCU IPC driver for Intel MID platforms 2017-04-10 10:02:03 +08:00
sections.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
setjmp.h x86: Add implementations of setjmp() and longjmp() 2016-10-18 15:58:50 +08:00
sfi.h x86: Use unsigned long for address in table generation 2017-02-06 11:38:46 +08:00
sipi.h x86: Add comments to the SIPI vector 2016-03-17 10:27:23 +08:00
speedstep.h x86: Add Intel speedstep and turbo mode code 2014-11-25 06:34:02 -07:00
spl.h x86: Add an SPL implementation 2017-02-06 11:38:46 +08:00
string.h x86: Add an accelerated memmove() function 2016-10-11 11:55:33 +08:00
tables.h x86: acpi: Add one API to find OS wakeup vector 2017-05-17 17:11:46 +08:00
turbo.h x86: Add a CPU driver for baytrail 2015-04-30 16:13:50 -06:00
types.h x86: Fix up type sizes for 64-bit 2017-02-06 11:38:46 +08:00
u-boot-x86.h x86: fsp: Save stack address to CMOS for next S3 boot 2017-05-17 17:11:46 +08:00
u-boot.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
unaligned.h x86: Rename i386 to x86 2011-04-13 19:43:28 +10:00
zimage.h x86: Move install_e820_map() out of zimage.c 2015-10-21 07:46:25 -06:00