From: "Jan Beulich" Subject: Re: [v5][PATCH 1/2] xen:x86:mm:p2m: introduce set_identity_p2m_entry Date: Tue, 29 Jul 2014 10:53:01 +0100 Message-ID: <53D78B1D0200007800027393@mail.emea.novell.com> References: <1406616052-11973-1-git-send-email-tiejun.chen@intel.com> <53D763C5020000780002719D@mail.emea.novell.com> <53D74EDC.4010100@intel.com> <53D7754302000078000272AB@mail.emea.novell.com> <53D76555.5000601@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53D76555.5000601@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tiejun Chen Cc: yang.z.zhang@intel.com, kevin.tian@intel.com, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 29.07.14 at 11:11, wrote: > On 2014/7/29 16:19, Jan Beulich wrote: >> ? Of course it may still be necessary to also inspect the obtained p2mt >> and a. >> > > Are you saying this? > > if ( !p2m_is_valid(p2mt) || > !mfn_valid(mfn) || > (a != p2m_access_rw) ) I'm afraid that's not enough context to know whether what you mean to do is sufficient. Plus !p2m_is_valid() is too weak. You simply need to properly think through what should happen if you find a valid mapping, but any of the tuple (mfn, p2mt, a) don't match what you intend to be there. Jan