From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH] KVM: x86: obey KVM_X86_QUIRK_CD_NW_CLEARED in kvm_set_cr0() Date: Wed, 4 Nov 2015 11:09:06 +0800 Message-ID: <563976D2.6080909@linux.intel.com> References: <1446575660-16560-1-git-send-email-lersek@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini , Jordan Justen , Janusz Mocek , Alex Williamson To: Laszlo Ersek , kvm@vger.kernel.org Return-path: Received: from mga02.intel.com ([134.134.136.20]:53146 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751589AbbKDDPw (ORCPT ); Tue, 3 Nov 2015 22:15:52 -0500 In-Reply-To: <1446575660-16560-1-git-send-email-lersek@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 11/04/2015 02:34 AM, Laszlo Ersek wrote: > 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. Reviewed-by: Xiao Guangrong