From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH] xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in Date: Thu, 9 Feb 2012 10:54:37 +0100 Message-ID: <20120209095437.GA13435@aepfle.de> References: <68eae0b487aef8349f16.1328777959@h00166998.china.huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <68eae0b487aef8349f16.1328777959@h00166998.china.huawei.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: hongkaixing@huawei.com Cc: bicky.shi@huawei.com, xiaowei.yang@huawei.com, xen-devel@lists.xensource.com, yanqiangjun@huawei.com, hanweidong@huawei.com List-Id: xen-devel@lists.xenproject.org On Thu, Feb 09, hongkaixing@huawei.com wrote: > xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in > tools/xenpaging > > If a page is nominated but not evicted,then dom0 accesses the page,it > will change the page's p2mt to be p2m_ram_paging_in,and the req.flags is > MEM_EVENT_FLAG_EVICT_FAIL;so it will fail in p2m_mem_paging_evict() because > of the p2mt;and paging->num_paged_out will not increase in this case;After > the paging process is terminated, the p2mt p2m_ram_paging_in still remains > in p2m table.Once domU accesses the nominated page,it will result in BSOD > or vm'stuck. > The patch adds the dealing of this request to resume the page before xenpaging > is ended. This can happen if p2m_mem_paging_populate() was called by a foreign domain. In this case MEM_EVENT_FLAG_VCPU_PAUSED is not set and xenpaging will not sent a response. And in this case the ring is in an inconsistent state anyway, new requests cant be added, I think. Acked-by: Olaf Hering > Signed-off-by??hongkaixing,shizhen > > diff -r 9f4640e40d4f -r 68eae0b487ae tools/xenpaging/xenpaging.c > --- a/tools/xenpaging/xenpaging.c Thu Feb 09 16:50:52 2012 +0800 > +++ b/tools/xenpaging/xenpaging.c Thu Feb 09 16:58:01 2012 +0800 > @@ -911,7 +911,7 @@ > !!(req.flags & MEM_EVENT_FLAG_EVICT_FAIL) ); > > /* Tell Xen to resume the vcpu */ > - if ( req.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) > + if (( req.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) || ( req.flags & MEM_EVENT_FLAG_EVICT_FAIL )) > { > /* Prepare the response */ > rsp.gfn = req.gfn;