Received: by 10.223.164.202 with SMTP id h10csp1012969wrb; Tue, 7 Nov 2017 19:47:53 -0800 (PST) X-Google-Smtp-Source: ABhQp+Q/YukbmwXCrLxASrST5dgzW5BRcXgClTQPGX/5m6n0cMuV71hoYfn9uSaDytwOGRDlphfp X-Received: by 10.99.111.197 with SMTP id k188mr944751pgc.344.1510112873544; Tue, 07 Nov 2017 19:47:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510112873; cv=none; d=google.com; s=arc-20160816; b=m29V/H3/+tdOeoqZN7MhLAfNOi2PdC53JKWEexIHQlK7844z7fdqbU99Uqp3XdtKwc 2Foxp6u8nPihwuhAbRvsBksvYx6MvVxX/6y+B+zcASxee00odKlrH3t+sGSd+61FnSNA 6EUybUS8NmCCSmoTu3WKyDeLnUnaboO5T7fo5fFD2Th+EspcftMay1gID2AkC3gXyhIQ 98SkYIuNbgewjMhaAuCHYvD8AW8KU3zvHvXjKlMGfHOIMVQL3lFJPunZY+IxRIdkHA1x CC92N4vTMMkeaoQbVbGCxjQ/pdNr6bWISL+2wDOBCkRH25uv4QJWuO555FLTrxlILEQU kPDg== 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=ZzABDl95A16TaCe6ehDR4w7PEhZAIL0QGxloes7u/4Y=; b=lKV/YcKHE2ECMWawRNJGxZjcIsD7WN9FN/lSaYMfDxopsAFr+94fIr3O3cH/Q9uezB mv8lwtxDBmv4iUoAh/JkD/aMO3ei+QmNi7LCX0JdIMhosFd9DNCnYeFsIerssY3HKQRU QCgaApaXmHCKoRXm1EcLCIyJpU+Jv5Huqx/WkTvbJmrPVIAiVSVdQUECdTzSznwPSg3e uIqi1kk6oVwZz7GhZXxXNsBZPNN52es9vexljT4g+313356bPvPMVr+b+UP4Y9SpnTDh QRszmIvgOTYqf4tiX9XmGTo83xcknGmmXJ785cNPvt6nH5u7wvDBn4vLrKYmygg46oyd mZhA== 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 a87si2868676pfl.192.2017.11.07.19.47.41; Tue, 07 Nov 2017 19:47:53 -0800 (PST) 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 S1753356AbdKHBaj (ORCPT + 90 others); Tue, 7 Nov 2017 20:30:39 -0500 Received: from mga07.intel.com ([134.134.136.100]:30824 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbdKHBah (ORCPT ); Tue, 7 Nov 2017 20:30:37 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 07 Nov 2017 17:30:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,361,1505804400"; d="scan'208";a="333532614" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.142]) by fmsmga004.fm.intel.com with ESMTP; 07 Nov 2017 17:30:33 -0800 Date: Wed, 8 Nov 2017 09:30:32 +0800 From: Haozhong Zhang To: Mikulas Patocka Cc: 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 , Tom Lendacky Subject: Re: [PATCH v2 0/2] KVM: MMU: fix kvm_is_mmio_pfn() Message-ID: <20171108013032.n5xyjt75bgy2g73w@hz-desktop> Mail-Followup-To: Mikulas Patocka , 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 , Tom Lendacky References: <20171031114840.12615-1-haozhong.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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/03/17 10:15 -0400, Mikulas Patocka wrote: > > > On Tue, 31 Oct 2017, 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 > > Note that cached memory type on persistent memory has horrible > performance. The clwb instruction on Broadwell is very slow - when you > write to persistent memory and use clwb to flush cache, the performance is > about 350MB/s. Wasn't clwb first introduced on Skylake? Haozhong > > Using write-combining memory type for persistent memory is much faster, it > can sustain performance of one 8-byte write per tick. > > Mikulas > > > 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. > > > > 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 1583054699750407527@xxx Fri Nov 03 14:16:48 +0000 2017 X-GM-THRID: 1582773659541235477 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread