From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH 05/10] VMX: add help functions to support PML Date: Fri, 10 Apr 2015 10:03:04 +0100 Message-ID: <20150410090304.GB12937@deinos.phlegethon.org> References: <1427423754-11841-1-git-send-email-kai.huang@linux.intel.com> <1427423754-11841-6-git-send-email-kai.huang@linux.intel.com> <20150409120033.GF17031@deinos.phlegethon.org> <5527764A.506@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5527764A.506@linux.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Kai Huang Cc: yang.z.zhang@intel.com, andrew.cooper3@citrix.com, kevin.tian@intel.com, jbeulich@suse.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 15:05 +0800 on 10 Apr (1428678346), Kai Huang wrote: > > > On 04/09/2015 08:00 PM, Tim Deegan wrote: > > Hi, > > > > That's also buggy, because there's no locking here to make sure > > gfn->mfn->gfn ends up in the right place. :( > Yes you are right. Thanks for pointing out. > > Just curious, looks if I use get_gfn_type_access and put_gfn here, the > gfn->mfn->gfn can be guaranteed, and it's safe to use them here, right? Yes, that would be the right way to do it. In this particular case, there's another race too: the gfn might have been entirely deleted after it's logged by PML but before the entry is processed here. I don't think that's a problem here, because if the gfn's not mapped any more it's not relevant that it's dirty. Just mentioning it out of interest. Cheers, Tim.