summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2019-12-10 16:15:18 +0000
committerBen Hutchings <ben@decadent.org.uk>2019-12-10 16:18:33 +0000
commit0c988160b174acf8f616c4c8ffea658583d9f67d (patch)
tree2bbf1dc81d9dc20a6d16321afbd91f392f037ee6
parent0349a3dfcd93c0e7be6f38f5ab373fcef1150bf0 (diff)
downloadlinux-stable-queue-0c988160b174acf8f616c4c8ffea658583d9f67d.tar.gz
Add a follow-up fix for x86/kxm
-rw-r--r--queue-3.16/kvm-mmu-don-t-read-pdptes-when-paging-is-not-enabled.patch37
-rw-r--r--queue-3.16/series1
2 files changed, 38 insertions, 0 deletions
diff --git a/queue-3.16/kvm-mmu-don-t-read-pdptes-when-paging-is-not-enabled.patch b/queue-3.16/kvm-mmu-don-t-read-pdptes-when-paging-is-not-enabled.patch
new file mode 100644
index 00000000..a05d8c58
--- /dev/null
+++ b/queue-3.16/kvm-mmu-don-t-read-pdptes-when-paging-is-not-enabled.patch
@@ -0,0 +1,37 @@
+From: Junaid Shahid <junaids@google.com>
+Date: Wed, 8 Aug 2018 17:45:24 -0700
+Subject: kvm: mmu: Don't read PDPTEs when paging is not enabled
+
+commit d35b34a9a70edae7ef923f100e51b8b5ae9fe899 upstream.
+
+kvm should not attempt to read guest PDPTEs when CR0.PG = 0 and
+CR4.PAE = 1.
+
+Signed-off-by: Junaid Shahid <junaids@google.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Cc: Sean Christopherson <sean.j.christopherson@intel.com>
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+ arch/x86/kvm/x86.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/x86/kvm/x86.c
++++ b/arch/x86/kvm/x86.c
+@@ -517,7 +517,7 @@ static bool pdptrs_changed(struct kvm_vc
+ gfn_t gfn;
+ int r;
+
+- if (is_long_mode(vcpu) || !is_pae(vcpu))
++ if (is_long_mode(vcpu) || !is_pae(vcpu) || !is_paging(vcpu))
+ return false;
+
+ if (!test_bit(VCPU_EXREG_PDPTR,
+@@ -6789,7 +6789,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct
+ kvm_update_cpuid(vcpu);
+
+ idx = srcu_read_lock(&vcpu->kvm->srcu);
+- if (!is_long_mode(vcpu) && is_pae(vcpu)) {
++ if (!is_long_mode(vcpu) && is_pae(vcpu) && is_paging(vcpu)) {
+ load_pdptrs(vcpu, vcpu->arch.walk_mmu, kvm_read_cr3(vcpu));
+ mmu_reset_needed = 1;
+ }
diff --git a/queue-3.16/series b/queue-3.16/series
index e7a9d0f9..9fe79616 100644
--- a/queue-3.16/series
+++ b/queue-3.16/series
@@ -29,6 +29,7 @@ btrfs-fix-use-after-free-when-using-the-tree-modification-log.patch
btrfs-relinquish-cpus-in-btrfs_compare_trees.patch
kvm-mmio-cleanup-kvm_set_mmio_spte_mask.patch
kvm-x86-manually-calculate-reserved-bits-when-loading-pdptrs.patch
+kvm-mmu-don-t-read-pdptes-when-paging-is-not-enabled.patch
cfg80211-purge-frame-registrations-on-iftype-change.patch
configfs-fix-a-deadlock-in-configfs_symlink.patch
powerpc-pseries-correctly-track-irq-state-in-default-idle.patch