x86/suspend: Fix restoration of guest state across S3/S4
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 20 Jun 2018 07:43:57 +0000 (15:43 +0800)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 4 Jul 2018 11:12:14 +0000 (12:12 +0100)
commit0c30171cb977adaf62067dfe8ddd1b283a2d7a0b
tree7f814f22ec405470cdc70c6a6af35898d7d72fd4
parent3c675b32720518e87d879f47939b0965d726bab6
x86/suspend: Fix restoration of guest state across S3/S4

The call to freeze_domains() in enter_state() guarentees that we are
running in idle context for the duration of S3/S4.

In restore_rest_processor_state(), the stts() is problematic as it
unilaterally sets %cr0.ts even in fully_eager FPU context.  It also fails to
account for the non-lazy xsave state.  Luckily, these are both latent bugs, as
the FPU state is corrected by the subsequent context switch away from the idle
vcpu.

Another aspect is that the !is_idle_vcpu(curr) paths in
restore_rest_processor_state() are actually dead code, and removing
these highlights that the segment saving logic is also unused.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/suspend.c