From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH 14/15] KVM: MTRR: do not map huage page for non-consistent range Date: Wed, 03 Jun 2015 10:56:56 +0800 Message-ID: <556E6CF8.9070602@linux.intel.com> References: <1432983566-15773-1-git-send-email-guangrong.xiao@linux.intel.com> <1432983566-15773-15-git-send-email-guangrong.xiao@linux.intel.com> <556C27A5.1040908@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: gleb@kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mga03.intel.com ([134.134.136.65]:37584 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751360AbbFCDAw (ORCPT ); Tue, 2 Jun 2015 23:00:52 -0400 In-Reply-To: <556C27A5.1040908@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 06/01/2015 05:36 PM, Paolo Bonzini wrote: > > > On 30/05/2015 12:59, Xiao Guangrong wrote: >> Currently guest MTRR is completely prohibited if cache snoop is supported on >> IOMMU (!noncoherent_dma) and host does the emulation based on the knowledge >> from host side, however, host side is not the good point to know >> what the purpose of guest is. A good example is that pass-throughed VGA >> frame buffer is not always UC as host expected > > Can you explain how? The original idea was that such a framebuffer > would be kvm_is_reserved_pfn and thus be unconditionally UC. Yes, frame-buffer is always UC in current code, however, UC for frame-buffer causes bad performance. It's quoted from Documentation/x86/mtrr.txt: | This is most useful when you have a video (VGA) card on a PCI or AGP bus. | Enabling write-combining allows bus write transfers to be combined into a | larger transfer before bursting over the PCI/AGP bus. This can increase | performance of image write operations 2.5 times or more. So that guest will configure the range to MTRR, this patchset follows guest MTRR and cooperates with guest PAT (ept.VMX_EPT_IPAT_BIT = 0) to emulate guest cache type as guest expects.