Received: by 10.223.164.221 with SMTP id h29csp2759930wrb; Thu, 2 Nov 2017 17:27:46 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QJv8XucuM0mJsuzbzPTuwaqU4eCMy/FGizhUjjS8enk8XVosMkIjSnP8N67KaHA2eg53v1 X-Received: by 10.84.149.102 with SMTP id b35mr4950846plh.331.1509668866013; Thu, 02 Nov 2017 17:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509668865; cv=none; d=google.com; s=arc-20160816; b=kKNz179j+RffIkHm0ZO6RI1jlzoj0rMGNtKp1HlrVqLa/3gDvlynsVmPcrw8f7v+Ab U5xbF2E1ZHTjLH/dJwZYToJREIJiEAmpDYfOQ93JlVhr+rn4P4gB+qLQAc1/J68j1AfL ciogAgpIjGesbe8kgM/MI5FrlGyKFIzxy/QvqgSE1bZjqy+5zavd+VCcwj6CBLg2Wyi0 BBM2xOLZAZgLm5tYoDybbXzQYu5ztonf2yNpkjiF5hhiX1XFsXe9u3Ku8d2ImeH/9pBV VSleF75AB53TsN6cwm/+uBojORNm/VlxubUx5QEtKbtu9ceVDA1dYmep/9J609MhK+0G zl4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=j5730vAAp/WaEwDhGHa6vquhGC3NSsHi8uq9+yrW9L8=; b=KNCEj3ba4DVij5iOzNlb0V7d2mydZQrafxweOiCv0/E4eHJAQP8nHAQR33q0RngZ8Y +zPJNTLXRtX2sCEZx/QfjznwePte4aW3bMWIDwiN0eYJZEfASoLx9BWI2piHxnRUV4Vc YKkmTtW+ZViP7q6WAy7NHobrwUJtgSNyRHyX59wv8vM2D6i4pW/vUB85cvqNwdhw1TBo odLqx4LLSknGKIfWBe30Z5TcJHl9SxF8+rG4D6qre12XG9KuAx+94a8J/rhXGK5IwbCd WD6IymfDYrSGSNQTqCw5+sL38Hxibh3PtvrRsW6TR4eMXZ8lNlE15GufwQL34yRt0iBc u8kQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23si4942593pfg.402.2017.11.02.17.27.32; Thu, 02 Nov 2017 17:27:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934673AbdKCA04 (ORCPT + 96 others); Thu, 2 Nov 2017 20:26:56 -0400 Received: from mga09.intel.com ([134.134.136.24]:9494 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934556AbdKCA0y (ORCPT ); Thu, 2 Nov 2017 20:26:54 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Nov 2017 17:26:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,336,1505804400"; d="scan'208";a="1032883788" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.142]) by orsmga003.jf.intel.com with ESMTP; 02 Nov 2017 17:26:50 -0700 Date: Fri, 3 Nov 2017 08:26:57 +0800 From: Haozhong Zhang To: Konrad Rzeszutek Wilk Cc: Olif Chapman , kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , rkrcmar@redhat.com, Xiao Guangrong , Dan Williams , ivan.d.cuevas.escareno@intel.com, karthik.kumar@intel.com, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Mikulas Patocka , Tom Lendacky Subject: Re: [PATCH v2 0/2] KVM: MMU: fix kvm_is_mmio_pfn() Message-ID: <20171103002657.5kyxcnqiyquy52jd@hz-desktop> Mail-Followup-To: Konrad Rzeszutek Wilk , Olif Chapman , kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , rkrcmar@redhat.com, Xiao Guangrong , Dan Williams , ivan.d.cuevas.escareno@intel.com, karthik.kumar@intel.com, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Mikulas Patocka , Tom Lendacky References: <20171031114840.12615-1-haozhong.zhang@intel.com> <20171102173748.GU22924@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171102173748.GU22924@char.us.oracle.com> User-Agent: NeoMutt/20170714 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/02/17 13:37 -0400, Konrad Rzeszutek Wilk wrote: > On Tue, Oct 31, 2017 at 07:48:38PM +0800, Haozhong Zhang wrote: > > [I just copy the commit message from patch 2] > > > > Some reserved pages, such as those from NVDIMM DAX devices, are > > not for MMIO, and can be mapped with cached memory type for better > > performance. However, the above check misconceives those pages as > > MMIO. Because KVM maps MMIO pages with UC memory type, the > > performance of guest accesses to those pages would be harmed. > > Therefore, we check the host memory type by lookup_memtype() in > > addition and only treat UC/UC- pages as MMIO. > > Is there a specific workload you used to detect this? > Creating files on NVDIMM in VM is must slower than the same operation on the baremetal. As the wrong EPT memory type (UC vs. WB) is used, every guest access to NVDIMM would be slower than baremetal. Haozhong > Thanks! > > > > Changes in v2: > > * Switch to lookup_memtype() to get host memory type. > > * Rewrite the comment in KVM MMU patch. > > * Remove v1 patch 2, which is not necessary in v2. > > > > Haozhong Zhang (2): > > x86/mm: expose lookup_memtype() > > KVM: MMU: consider host cache mode in MMIO page check > > > > arch/x86/include/asm/pat.h | 2 ++ > > arch/x86/kvm/mmu.c | 30 +++++++++++++++++++++++++++--- > > arch/x86/mm/pat.c | 3 ++- > > 3 files changed, 31 insertions(+), 4 deletions(-) > > > > -- > > 2.14.1 > > From 1582976825350725770@xxx Thu Nov 02 17:39:01 +0000 2017 X-GM-THRID: 1582773659541235477 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread