linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Juergen Gross <jgross@suse.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com
Subject: [PATCH 4.14 031/110] x86/xen: Zero MSR_IA32_SPEC_CTRL before suspend
Date: Wed,  7 Mar 2018 11:38:14 -0800	[thread overview]
Message-ID: <20180307191043.718826919@linuxfoundation.org> (raw)
In-Reply-To: <20180307191039.748351103@linuxfoundation.org>

4.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Juergen Gross <jgross@suse.com>

commit 71c208dd54ab971036d83ff6d9837bae4976e623 upstream.

Older Xen versions (4.5 and before) might have problems migrating pv
guests with MSR_IA32_SPEC_CTRL having a non-zero value. So before
suspending zero that MSR and restore it after being resumed.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Cc: xen-devel@lists.xenproject.org
Cc: boris.ostrovsky@oracle.com
Link: https://lkml.kernel.org/r/20180226140818.4849-1-jgross@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/xen/suspend.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -1,12 +1,15 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <linux/types.h>
 #include <linux/tick.h>
+#include <linux/percpu-defs.h>
 
 #include <xen/xen.h>
 #include <xen/interface/xen.h>
 #include <xen/grant_table.h>
 #include <xen/events.h>
 
+#include <asm/cpufeatures.h>
+#include <asm/msr-index.h>
 #include <asm/xen/hypercall.h>
 #include <asm/xen/page.h>
 #include <asm/fixmap.h>
@@ -15,6 +18,8 @@
 #include "mmu.h"
 #include "pmu.h"
 
+static DEFINE_PER_CPU(u64, spec_ctrl);
+
 void xen_arch_pre_suspend(void)
 {
 	if (xen_pv_domain())
@@ -31,6 +36,9 @@ void xen_arch_post_suspend(int cancelled
 
 static void xen_vcpu_notify_restore(void *data)
 {
+	if (xen_pv_domain() && boot_cpu_has(X86_FEATURE_SPEC_CTRL))
+		wrmsrl(MSR_IA32_SPEC_CTRL, this_cpu_read(spec_ctrl));
+
 	/* Boot processor notified via generic timekeeping_resume() */
 	if (smp_processor_id() == 0)
 		return;
@@ -40,7 +48,15 @@ static void xen_vcpu_notify_restore(void
 
 static void xen_vcpu_notify_suspend(void *data)
 {
+	u64 tmp;
+
 	tick_suspend_local();
+
+	if (xen_pv_domain() && boot_cpu_has(X86_FEATURE_SPEC_CTRL)) {
+		rdmsrl(MSR_IA32_SPEC_CTRL, tmp);
+		this_cpu_write(spec_ctrl, tmp);
+		wrmsrl(MSR_IA32_SPEC_CTRL, 0);
+	}
 }
 
 void xen_arch_resume(void)

  parent reply	other threads:[~2018-03-07 19:38 UTC|newest]

Thread overview: 129+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 19:37 [PATCH 4.14 000/110] 4.14.25-stable review Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 001/110] Bluetooth: btusb: Use DMI matching for QCA reset_resume quirking Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 002/110] ixgbe: fix crash in build_skb Rx code path Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 003/110] tpm: st33zp24: fix potential buffer overruns caused by bit glitches on the bus Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 004/110] tpm: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 005/110] tpm_i2c_infineon: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 006/110] tpm_i2c_nuvoton: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 007/110] tpm_tis: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 008/110] tpm: constify transmit data pointers Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 009/110] tpm_tis_spi: Use DMA-safe memory for SPI transfers Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 010/110] ALSA: usb-audio: Add a quirck for B&W PX headphones Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 011/110] ALSA: control: Fix memory corruption risk in snd_ctl_elem_read Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 012/110] ALSA: x86: Fix missing spinlock and mutex initializations Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 013/110] ALSA: hda: Add a power_save blacklist Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 014/110] ALSA: hda - Fix pincfg at resume on Lenovo T470 dock Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 015/110] mmc: sdhci-pci: Fix S0i3 for Intel BYT-based controllers Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 016/110] mmc: dw_mmc-k3: Fix out-of-bounds access through DT alias Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 017/110] mmc: dw_mmc: Avoid accessing registers in runtime suspended state Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 018/110] mmc: dw_mmc: Factor out dw_mci_init_slot_caps Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 019/110] mmc: dw_mmc: Fix out-of-bounds access for slots caps Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 020/110] timers: Forward timer base before migrating timers Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 021/110] parisc: Use cr16 interval timers unconditionally on qemu Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 022/110] parisc: Reduce irq overhead when run in qemu Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 023/110] parisc: Fix ordering of cache and TLB flushes Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 024/110] btrfs: use proper endianness accessors for super_copy Greg Kroah-Hartman
2018-03-15 18:55   ` Christoph Biedl
2018-03-16 12:30     ` Greg Kroah-Hartman
2018-03-16 13:22       ` David Sterba
2018-03-16 14:02         ` Greg Kroah-Hartman
2018-03-16 16:21           ` Anand Jain
2018-03-17 17:27       ` Christoph Biedl
2018-03-19 19:32         ` David Sterba
2018-03-20  9:32           ` Anand Jain
2018-03-16 16:21     ` Anand Jain
2018-03-07 19:38 ` [PATCH 4.14 025/110] block: fix the count of PGPGOUT for WRITE_SAME Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 026/110] block: kyber: fix domain token leak during requeue Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 027/110] vfio: disable filesystem-dax page pinning Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 028/110] cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 029/110] dax: fix vma_is_fsdax() helper Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 030/110] direct-io: Fix sleep in atomic due to sync AIO Greg Kroah-Hartman
2018-03-07 19:38 ` Greg Kroah-Hartman [this message]
2018-03-07 19:38 ` [PATCH 4.14 032/110] x86/platform/intel-mid: Handle Intel Edison reboot correctly Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 033/110] x86/cpu_entry_area: Sync cpu_entry_area to initial_page_table Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 034/110] bridge: check brport attr show in brport_show Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 035/110] fib_semantics: Dont match route with mismatching tclassid Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 036/110] hdlc_ppp: carrier detect ok, dont turn off negotiation Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 037/110] ipv6 sit: work around bogus gcc-8 -Wrestrict warning Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 038/110] net: amd-xgbe: fix comparison to bitshift when dealing with a mask Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 039/110] net: ethernet: ti: cpsw: fix net watchdog timeout Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 040/110] net: fix race on decreasing number of TX queues Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 041/110] net: ipv4: dont allow setting net.ipv4.route.min_pmtu below 68 Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 042/110] netlink: ensure to loop over all netns in genlmsg_multicast_allns() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 043/110] net: sched: report if filter is too large to dump Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 044/110] ppp: prevent unregistered channels from connecting to PPP units Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 045/110] sctp: verify size of a new chunk in _sctp_make_chunk() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 046/110] udplite: fix partial checksum initialization Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 047/110] net/mlx5e: Fix TCP checksum in LRO buffers Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 048/110] sctp: fix dst refcnt leak in sctp_v4_get_dst Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 049/110] mlxsw: spectrum_switchdev: Check success of FDB add operation Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 050/110] net/mlx5e: Specify numa node when allocating drop rq Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 051/110] net: phy: fix phy_start to consider PHY_IGNORE_INTERRUPT Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 052/110] tcp: Honor the eor bit in tcp_mtu_probe Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 053/110] rxrpc: Fix send in rxrpc_send_data_packet() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 054/110] tcp_bbr: better deal with suboptimal GSO Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 055/110] doc: Change the min default value of tcp_wmem/tcp_rmem Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 056/110] net/mlx5e: Fix loopback self test when GRO is off Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 057/110] net_sched: gen_estimator: fix broken estimators based on percpu stats Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 058/110] net/sched: cls_u32: fix cls_u32 on filter replace Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 059/110] sctp: do not pr_err for the duplicated node in transport rhlist Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 060/110] tcp: revert F-RTO middle-box workaround Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 061/110] tcp: revert F-RTO extension to detect more spurious timeouts Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 062/110] mlxsw: spectrum_router: Fix error path in mlxsw_sp_vr_create Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 063/110] net: ipv4: Set addr_type in hash_keys for forwarded case Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 064/110] sctp: fix dst refcnt leak in sctp_v6_get_dst() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 065/110] bridge: Fix VLAN reference count problem Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 066/110] net/mlx5e: Verify inline header size do not exceed SKB linear size Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 067/110] amd-xgbe: Restore PCI interrupt enablement setting on resume Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 068/110] cls_u32: fix use after free in u32_destroy_key() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 069/110] mlxsw: spectrum_router: Do not unconditionally clear route offload indication Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 070/110] netlink: put module reference if dump start fails Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 071/110] tcp: purge write queue upon RST Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 072/110] tuntap: correctly add the missing XDP flush Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 073/110] tuntap: disable preemption during XDP processing Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 074/110] virtio-net: disable NAPI only when enabled during XDP set Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 075/110] s390/qeth: fix underestimated count of buffer elements Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 076/110] s390/qeth: fix SETIP command handling Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 077/110] s390/qeth: fix overestimated count of buffer elements Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 078/110] s390/qeth: fix IP removal on offline cards Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 079/110] s390/qeth: fix double-free on IP add/remove race Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 080/110] Revert "s390/qeth: fix using of ref counter for rxip addresses" Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 081/110] s390/qeth: fix IP address lookup for L3 devices Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 082/110] s390/qeth: fix IPA command submission race Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 083/110] blk-mq: dont call io scheds .requeue_request when requeueing rq to ->dispatch Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 084/110] media: m88ds3103: dont call a non-initalized function Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 085/110] EDAC, sb_edac: Fix out of bound writes during DIMM configuration on KNL Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 086/110] KVM: s390: take care of clock-comparator sign control Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 087/110] KVM: s390: provide only a single function for setting the tod (fix SCK) Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 088/110] KVM: s390: consider epoch index on hotplugged CPUs Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 089/110] KVM: s390: consider epoch index on TOD clock syncs Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 090/110] nospec: Allow index argument to have const-qualified type Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 091/110] x86/mm: Fix {pmd,pud}_{set,clear}_flags() Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 092/110] ARM: orion: fix orion_ge00_switch_board_info initialization Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 093/110] ARM: dts: rockchip: Remove 1.8 GHz operation point from phycore som Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 094/110] ARM: mvebu: Fix broken PL310_ERRATA_753970 selects Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 095/110] ARM: kvm: fix building with gcc-8 Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 096/110] KVM: x86: extend usage of RET_MMIO_PF_* constants Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 097/110] KVM: X86: Fix SMRAM accessing even if VM is shutdown Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 098/110] KVM: mmu: Fix overlap between public and private memslots Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 099/110] KVM/x86: Remove indirect MSR op calls from SPEC_CTRL Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 100/110] KVM: x86: move LAPIC initialization after VMCS creation Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 101/110] KVM/VMX: Optimize vmx_vcpu_run() and svm_vcpu_run() by marking the RDMSR path as unlikely() Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 102/110] KVM: x86: fix vcpu initialization with userspace lapic Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 103/110] PCI/ASPM: Deal with missing root ports in link state handling Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 104/110] KVM/x86: Fix wrong macro references of X86_CR0_PG_BIT and X86_CR4_PAE_BIT in kvm_valid_sregs() Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 105/110] KVM/x86: remove WARN_ON() for when vm_munmap() fails Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 106/110] ACPI / bus: Parse tables as term_list for Dell XPS 9570 and Precision M5530 Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 107/110] ARM: dts: LogicPD SOM-LV: Fix I2C1 pinmux Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 108/110] ARM: dts: LogicPD Torpedo: " Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 109/110] md: only allow remove_and_add_spares when no sync_thread running Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 110/110] nvme-rdma: dont suppress send completions Greg Kroah-Hartman
2018-03-07 23:57 ` [PATCH 4.14 000/110] 4.14.25-stable review Shuah Khan
2018-03-08  4:19 ` kernelci.org bot
2018-03-09  0:05   ` Kevin Hilman
2018-03-09  1:09     ` Greg Kroah-Hartman
2018-03-09  8:02     ` Quentin Schulz
2018-03-09 17:49       ` Kevin Hilman
2018-03-08  8:36 ` Naresh Kamboju
2018-03-08 12:00   ` Naresh Kamboju
2018-03-08 14:22 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180307191043.718826919@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).