Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp318221imm; Fri, 31 Aug 2018 01:02:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaB8PmoJNr21SYoyKx4Sv1zQw+T06mmDEBSv9Lw6ja8vyggIic7rYlKncPY9XtVw3xV2QfY X-Received: by 2002:a17:902:1566:: with SMTP id b35-v6mr14136553plh.135.1535702564290; Fri, 31 Aug 2018 01:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535702564; cv=none; d=google.com; s=arc-20160816; b=y2X/Pbc/cQ1+z9G8iP7XQmH7k65e2labf67lIiF6lq4zAMdAFRBqb7vrVXkJSScMYl wytg3nqJSJ5GUYBI4IKd4C9R7BsPrHp7uMXptlvOHjWs8KC/kbXMryy5cX96zfFC7YGD teiNyxzmo6cgU4p1ldoWtcxq941xzx1VLQmd1HCWGPfJuIv5CwTCfi1zFYCokU6EXH+B WkRTPrkl+TalgbI7fn4qLPFQFChBXjxxlbuCnNZ8V9QiqHu49rHf8EQJYc/6JG/n6pkE tbt0Hp4tEmox+zq28JyvaQqL4VJyVzXp4QWoFgzg0E0dSzeMir6abf2ZLMjWgc6gIwvD rDEw== 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=ahcPT4bUkIf0a+Z0pKwIumSNoBbIPctqPucXKhIFj2A=; b=bHCEySa2oRr4to7ikClUcpi4YaP1dbCMp3MFaADPA0b5zq/etpw1GKsSQ9xPw3zwis h5ocw1pa5l+aXV7UfYOYaCNNRoE+oUe28GatEEUQ236ATZd5M3QTFMb03bKFGOC9YwU8 6WndZjtnTsfi54nJPQUBTZDSkUeJ0q6uu1TmvHT76huuJ0krVz2jv09Y2ynHD3Wi8GfX NYRXapi5K/X+M/+uRlSVtno2F5CYFGXycSsVIpL7fgBHtyQs2jJr1xmJXE/jiOZQN5yX DZYCJw86t5d3jopqN1Ly2TRhj0pomSjDPE0qO6diGJPx54QOF871l0qVaqPBICgNBbpa jC3w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x22-v6si8526714pfh.84.2018.08.31.01.02.29; Fri, 31 Aug 2018 01:02:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727469AbeHaMHD (ORCPT + 99 others); Fri, 31 Aug 2018 08:07:03 -0400 Received: from mga05.intel.com ([192.55.52.43]:63090 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727233AbeHaMHD (ORCPT ); Fri, 31 Aug 2018 08:07:03 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Aug 2018 01:00:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,309,1531810800"; d="scan'208";a="84932414" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP; 31 Aug 2018 01:00:44 -0700 Received: from tiger-server (unknown [10.239.48.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 68AA4580224; Fri, 31 Aug 2018 01:00:42 -0700 (PDT) Date: Sat, 1 Sep 2018 00:39:42 +0800 From: Yi Zhang To: Dave Hansen Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, pbonzini@redhat.com, dan.j.williams@intel.com, dave.jiang@intel.com, yu.c.zhang@intel.com, pagupta@redhat.com, david@redhat.com, jack@suse.cz, hch@lst.de, linux-mm@kvack.org, rkrcmar@redhat.com, jglisse@redhat.com, yi.z.zhang@intel.com Subject: Re: [PATCH V4 4/4] kvm: add a check if pfn is from NVDIMM pmem. Message-ID: <20180831163941.GA1220@tiger-server> Mail-Followup-To: Dave Hansen , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, pbonzini@redhat.com, dan.j.williams@intel.com, dave.jiang@intel.com, yu.c.zhang@intel.com, pagupta@redhat.com, david@redhat.com, jack@suse.cz, hch@lst.de, linux-mm@kvack.org, rkrcmar@redhat.com, jglisse@redhat.com, yi.z.zhang@intel.com References: <4192066a-79f3-2b3e-386f-c4ec9b6dd8fd@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4192066a-79f3-2b3e-386f-c4ec9b6dd8fd@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-08-30 at 12:07:11 -0700, Dave Hansen wrote: > On 08/22/2018 03:58 AM, Zhang Yi wrote: > > bool kvm_is_reserved_pfn(kvm_pfn_t pfn) > > { > > - if (pfn_valid(pfn)) > > - return PageReserved(pfn_to_page(pfn)); > > + struct page *page; > > + > > + if (pfn_valid(pfn)) { > > + page = pfn_to_page(pfn); > > + return PageReserved(page) && !is_dax_page(page); > > + } > > This is in desperate need of commenting about what it is doing and why. > > The changelog alone doesn't cut it. Thanks, Dave, Will add some comments