x86/spec-ctrl: Don't use spec_ctrl_{enter,exit}_idle() for S3
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 28 Jan 2022 12:03:42 +0000 (12:03 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 4 Feb 2022 15:45:25 +0000 (15:45 +0000)
commit72ef02da23861f686c349a6808b2f4c9adc15f9f
tree62744f7c1bc9feae0568e8ee96063386870f8c6d
parent08fc03c855c071e9b1aaaa96403f2a90433336a7
x86/spec-ctrl: Don't use spec_ctrl_{enter,exit}_idle() for S3

'idle' here refers to hlt/mwait.  The S3 path isn't an idle path - it is a
platform reset.

We need to load default_xen_spec_ctrl unilaterally on the way back up.
Currently it happens as a side effect of X86_FEATURE_SC_MSR_IDLE or the next
return-to-guest, but that's fragile behaviour.

Conversely, there is no need to clear IBRS and flush the store buffers on the
way down; we're microseconds away from cutting power.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit 71fac402e05ade7b0af2c34f77517449f6f7e2c1)
xen/arch/x86/acpi/power.c