u-boot-brain/arch/x86/cpu
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
..
baytrail x86: baytrail: acpi: Add APIs for determining/clearing sleep state 2017-05-17 17:11:46 +08:00
broadwell board_f: Drop setup_dram_config() wrapper 2017-04-05 16:36:51 -04:00
coreboot fs: Kconfig: Add a separate config for FS_CBFS 2017-04-30 13:40:57 -04:00
efi board_f: Drop setup_dram_config() wrapper 2017-04-05 16:36:51 -04:00
i386 x86: Force 32-bit jumps in interrupt handlers 2017-02-21 14:53:29 +08:00
intel_common dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
ivybridge board_f: Drop setup_dram_config() wrapper 2017-04-05 16:36:51 -04:00
qemu board_f: Drop setup_dram_config() wrapper 2017-04-05 16:36:51 -04:00
quark board_f: Drop setup_dram_config() wrapper 2017-04-05 16:36:51 -04:00
queensbay dm: core: Add flags parameter to device_remove() 2017-04-04 20:15:10 -06:00
x86_64 board_f: x86: Use checkcpu() for CPU init 2017-04-05 13:55:09 -04:00
call32.S x86: Add a way to call 32-bit code from 64-bit mode 2015-08-05 08:44:07 -06:00
config.mk x86: Update compile/link flags to support 64-bit U-Boot 2017-02-07 13:14:54 +08:00
cpu_x86.c x86: Drop leading spaces in cpu_x86_get_desc() 2017-04-18 15:51:21 +08:00
cpu.c x86: acpi: Fix Windows S3 resume failure 2017-05-17 17:11:46 +08:00
ioapic.c x86: Add a function to set the IOAPIC ID 2016-03-17 10:27:27 +08:00
irq.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
lapic.c x86: Remove SMP limitation in lapic_setup() 2016-05-23 15:27:41 +08:00
Makefile x86: acpi: Add wake up assembly stub 2017-05-17 17:11:46 +08:00
mp_init.c x86: Intel MID platforms has no microcode update 2017-02-21 15:10:56 +08:00
mtrr.c x86: Test mtrr support flag before accessing mtrr msr 2015-01-23 17:24:55 -07:00
pci.c x86: pci: Drop legacy PCI APIs 2016-02-05 12:47:23 +08:00
resetvec.S Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
sipi_vector.S x86: Add comments to the SIPI vector 2016-03-17 10:27:23 +08:00
start16.S x86: fsp: Load GDT before calling FspInitEntry 2015-07-14 18:03:15 -06:00
start64.S x86: Add 64-bit start-up code 2017-02-06 11:38:46 +08:00
start.S x86: make LOAD_FROM_32_BIT visible for platforms 2017-02-07 13:36:50 +08:00
turbo.c x86: Move turbo_state to global_data 2017-02-07 13:07:26 +08:00
u-boot-64.lds x86: Add a link script for 64-bit x86 2017-02-06 11:38:46 +08:00
u-boot-spl.lds x86: Add a link script for SPL 2017-02-06 11:38:46 +08:00
u-boot.lds x86: Use X86_16BIT_INIT instead of X86_RESET_VECTOR 2017-02-06 11:38:46 +08:00
wakeup.S x86: acpi: Add wake up assembly stub 2017-05-17 17:11:46 +08:00