Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759067AbdLRMzk (ORCPT ); Mon, 18 Dec 2017 07:55:40 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:37658 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753083AbdLRMzg (ORCPT ); Mon, 18 Dec 2017 07:55:36 -0500 X-Google-Smtp-Source: ACJfBosQ7NpQdgT0vCtMCteyhpL317Vy6dPCgQMrFAjxy7Ph8L4F0hQdxuHdX/yuyYIUctplWKCUIw== Subject: Re: [PATCH v5 1/2] x86/mm: add a function to check if a pfn is UC/UC- To: Haozhong Zhang , kvm@vger.kernel.org, x86@kernel.org Cc: linux-kernel@vger.kernel.org, rkrcmar@redhat.com, Xiao Guangrong , Dan Williams , ivan.d.cuevas.escareno@intel.com, karthik.kumar@intel.com, Konrad Rzeszutek Wilk , Olif Chapman , Mikulas Patocka , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Tom Lendacky References: <20171108075630.16991-1-haozhong.zhang@intel.com> <20171108075630.16991-2-haozhong.zhang@intel.com> From: Paolo Bonzini Message-ID: <2da7d38c-8135-a722-8d93-f3d1a618b12e@redhat.com> Date: Mon, 18 Dec 2017 13:55:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171108075630.16991-2-haozhong.zhang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 453 Lines: 16 On 08/11/2017 08:56, Haozhong Zhang wrote: > +bool pat_pfn_is_uc_or_uc_minus(unsigned long pfn) > +{ > + enum page_cache_mode cm = lookup_memtype(PFN_PHYS(pfn)); > + > + return cm == _PAGE_CACHE_MODE_UC || cm == _PAGE_CACHE_MODE_UC_MINUS; > +} > +EXPORT_SYMBOL_GPL(pat_pfn_is_uc_or_uc_minus); > + As discussed in the reply to v2, this should include WC too. The function name could become something like pat_pfn_downgraded_by_uc_mtrr. Thanks, Paolo