]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: obey KVM_X86_QUIRK_CD_NW_CLEARED in kvm_set_cr0()
authorLaszlo Ersek <lersek@redhat.com>
Wed, 4 Nov 2015 11:54:41 +0000 (12:54 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 4 Nov 2015 15:24:39 +0000 (16:24 +0100)
commitf729f26af64633e91263b9a89f11afb8909aaaea
tree439e034c0e83fc1a9168c95be630e41aac8667a6
parentad4a7c40fc565a2ae3a3925653ddeb2caa1bef08
KVM: x86: obey KVM_X86_QUIRK_CD_NW_CLEARED in kvm_set_cr0()

Commit a027f357b6a9 ("KVM: x86: fix CR0.CD virtualization") was
technically correct, but it broke OVMF guests by slowing down various
parts of the firmware.

Commit 2b6b79d4f64d ("KVM: vmx: obey KVM_QUIRK_CD_NW_CLEARED") quirked the
first function modified by a027f357b6a9, 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
a027f357b6a9, 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 a027f357b6a9.

Fixes: a027f357b6a97d34a62749d3c632722e33c9556a
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