x86: suppress BTI mitigations around S3 suspend/resume
authorJan Beulich <jbeulich@suse.com>
Fri, 18 May 2018 10:08:25 +0000 (12:08 +0200)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 22 May 2018 17:41:33 +0000 (18:41 +0100)
commita110459b79c4cd3197526e45aa8cfb835a9251fd
tree907e40b1f3db86719b24a18f672ee6f2890c37a8
parentb66839b85b266f52804f8fe6de2de80a0352c2ea
x86: suppress BTI mitigations around S3 suspend/resume

NMI and #MC can occur at any time after S3 resume, yet the MSR_SPEC_CTRL
may become available only once we're reloaded microcode. Make
SPEC_CTRL_ENTRY_FROM_INTR_IST and DO_SPEC_CTRL_EXIT_TO_XEN no-ops for
the critical period of time.

Also set the MSR back to its intended value.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
x86: Use spec_ctrl_{enter,exit}_idle() in the S3/S5 path

The main purpose of this patch is to avoid opencoding the recovery logic at
the end, but also has the positive side effect of relaxing the SPEC_CTRL
mitigations when working to shut the final CPU down.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 710a8ebf2bc111a34bba04d1c85b6d07ed3d9389
master date: 2018-04-16 14:09:55 +0200
master commit: ef3ab46493f650b7e5cca2b2578a99ca0cbff195
master date: 2018-04-19 10:55:59 +0100

(cherry picked from commit 7f2959f8f6d0ad9fc92fe020ae6ad9a5708dd45e)

Gbp-Pq: Name x86-suppress-bti-mitigations-around-s3-s.patch
xen/arch/x86/acpi/power.c