]> git.proxmox.com Git - pve-kernel-jessie.git/commitdiff
add kvm-x86-obey-KVM_X86_QUIRK_CD_NW_CLEARED-in-kvm_set_cr0.patch
authorDietmar Maurer <dietmar@proxmox.com>
Sun, 15 Nov 2015 14:51:37 +0000 (15:51 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Sun, 15 Nov 2015 14:51:37 +0000 (15:51 +0100)
Makefile
changelog.Debian
kvm-x86-obey-KVM_X86_QUIRK_CD_NW_CLEARED-in-kvm_set_cr0.patch [new file with mode: 0644]

index 96a9f8a4cb87ff43ce87c40cca66b24e3039b76e..87026bd36b1f7d46762e7e00c1f4a6f51fb04624 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ RELEASE=4.0
 
 # also update proxmox-ve/changelog if you change KERNEL_VER or KREL
 KERNEL_VER=4.2.3
-PKGREL=21
+PKGREL=22
 # also include firmware of previous version into
 # the fw package:  fwlist-2.6.32-PREV-pve
 KREL=2
@@ -212,6 +212,7 @@ ${KERNEL_SRC}/README ${KERNEL_CFG_ORG}: ${KERNELSRCTAR}
        #cd ${KERNEL_SRC}; patch -p1 <../override_for_missing_acs_capabilities.patch
        #cd ${KERNEL_SRC}; patch -p1 <../vhost-net-extend-device-allocation-to-vmalloc.patch
        cd ${KERNEL_SRC}; patch -p1 <../kvmstealtime.patch
+       cd ${KERNEL_SRC}; patch -p1 <../kvm-x86-obey-KVM_X86_QUIRK_CD_NW_CLEARED-in-kvm_set_cr0.patch
        sed -i ${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/'
        touch $@
 
index 5cdd6e811b699e85b177d2458da2588f31682889..c1328f9c5f53ce8041afda90d1a128f5ef3e1594 100644 (file)
@@ -1,3 +1,9 @@
+pve-kernel (4.2.3-22) unstable; urgency=medium
+
+  * add kvm-x86-obey-KVM_X86_QUIRK_CD_NW_CLEARED-in-kvm_set_cr0.patch
+
+ -- Proxmox Support Team <support@proxmox.com>  Sun, 15 Nov 2015 15:50:52 +0100
+
 pve-kernel (4.2.3-21) unstable; urgency=medium
 
   * update spl/zfs to 0.6.5.3
diff --git a/kvm-x86-obey-KVM_X86_QUIRK_CD_NW_CLEARED-in-kvm_set_cr0.patch b/kvm-x86-obey-KVM_X86_QUIRK_CD_NW_CLEARED-in-kvm_set_cr0.patch
new file mode 100644 (file)
index 0000000..64cdd6b
--- /dev/null
@@ -0,0 +1,53 @@
+From 879ae1880449c88db11c1ebdaedc2da79b2fe73f Mon Sep 17 00:00:00 2001
+From: Laszlo Ersek <lersek@redhat.com>
+Date: Wed, 4 Nov 2015 12:54:41 +0100
+Subject: KVM: x86: obey KVM_X86_QUIRK_CD_NW_CLEARED in kvm_set_cr0()
+
+Commit b18d5431acc7 ("KVM: x86: fix CR0.CD virtualization") was
+technically correct, but it broke OVMF guests by slowing down various
+parts of the firmware.
+
+Commit fb279950ba02 ("KVM: vmx: obey KVM_QUIRK_CD_NW_CLEARED") quirked the
+first function modified by b18d5431acc7, vmx_get_mt_mask(), for OVMF's
+sake. This restored the speed of the OVMF code that runs before
+PlatformPei (including the memory intensive LZMA decompression in SEC).
+
+This patch extends the quirk to the second function modified by
+b18d5431acc7, kvm_set_cr0(). It eliminates the intrusive slowdown that
+hits the EFI_MP_SERVICES_PROTOCOL implementation of edk2's
+UefiCpuPkg/CpuDxe -- which is built into OVMF --, when CpuDxe starts up
+all APs at once for initialization, in order to count them.
+
+We also carry over the kvm_arch_has_noncoherent_dma() sub-condition from
+the other half of the original commit b18d5431acc7.
+
+Fixes: b18d5431acc7a2fd22767925f3a6f597aa4bd29e
+Cc: stable@vger.kernel.org
+Cc: Jordan Justen <jordan.l.justen@intel.com>
+Cc: Alex Williamson <alex.williamson@redhat.com>
+Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
+Tested-by: Janusz Mocek <januszmk6@gmail.com>
+Signed-off-by: Laszlo Ersek <lersek@redhat.com>#
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+---
+ arch/x86/kvm/x86.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
+index a24bae0..30723a4 100644
+--- a/arch/x86/kvm/x86.c
++++ b/arch/x86/kvm/x86.c
+@@ -625,7 +625,9 @@ int kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
+       if ((cr0 ^ old_cr0) & update_bits)
+               kvm_mmu_reset_context(vcpu);
+-      if ((cr0 ^ old_cr0) & X86_CR0_CD)
++      if (((cr0 ^ old_cr0) & X86_CR0_CD) &&
++          kvm_arch_has_noncoherent_dma(vcpu->kvm) &&
++          !kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED))
+               kvm_zap_gfn_range(vcpu->kvm, 0, ~0ULL);
+       return 0;
+-- 
+cgit v0.11.2
+