x86/S3: Drop {save,restore}_rest_processor_state() completely
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 11 Dec 2019 20:59:19 +0000 (20:59 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 29 Apr 2020 13:47:28 +0000 (14:47 +0100)
commit4304ff420e51b973ec9eb9dafd64a917dd9c0fb1
tree3e311c44f6a8a19a53fd1ce34f434b55886d6917
parent46d8f69d466a05863737fb81d8c9ef39c3be8b45
x86/S3: Drop {save,restore}_rest_processor_state() completely

There is no need to save/restore FS/GS/XCR0 state.  It will be handled
suitably on the context switch away from the idle.

The CR4 restoration in restore_rest_processor_state() was actually fighting
later code in enter_state() which tried to keep CR4.MCE clear until everything
was set up.  Delete the intermediate restoration, and defer final restoration
until after MCE is reconfigured.

Restoring PAT can be done earlier, and ideally before paging is enabled.  By
moving it into the trampoline during the setup for 64bit, the call can be
dropped from cpu_init().  The EFI path boot path doesn't disable paging, so
make the adjustment when switching onto Xen's pagetables.

The only remaing piece of restoration is load_system_tables(), so suspend.c
can be deleted in its entirety.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/Makefile
xen/arch/x86/acpi/power.c
xen/arch/x86/acpi/suspend.c [deleted file]
xen/arch/x86/acpi/wakeup_prot.S
xen/arch/x86/boot/trampoline.S
xen/arch/x86/cpu/common.c
xen/arch/x86/efi/efi-boot.h