* [PATCH] xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in
@ 2012-02-09 8:59 hongkaixing
2012-02-09 9:54 ` Olaf Hering
0 siblings, 1 reply; 3+ messages in thread
From: hongkaixing @ 2012-02-09 8:59 UTC (permalink / raw)
To: Olaf Hering; +Cc: bicky.shi, xiaowei.yang, xen-devel, yanqiangjun, hanweidong
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1522 bytes --]
# HG changeset patch
# User h00166998@h00166998.china.huawei.com
# Date 1328777881 -28800
# Node ID 68eae0b487aef8349f168518f56264ce61afb0a1
# Parent 9f4640e40d4f31563885427a5a8d9eae2e110514
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.
Signed-off-by£ºhongkaixing<hongkaixing@huawei.com>,shizhen<bicky.shi@huawei.com>
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;
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in
2012-02-09 8:59 [PATCH] xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in hongkaixing
@ 2012-02-09 9:54 ` Olaf Hering
2012-02-09 18:48 ` [PATCH] xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in [and 1 more messages] Ian Jackson
0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2012-02-09 9:54 UTC (permalink / raw)
To: hongkaixing; +Cc: bicky.shi, xiaowei.yang, xen-devel, yanqiangjun, hanweidong
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 <olaf@aepfle.de>
> Signed-off-by??hongkaixing<hongkaixing@huawei.com>,shizhen<bicky.shi@huawei.com>
>
> 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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in [and 1 more messages]
2012-02-09 9:54 ` Olaf Hering
@ 2012-02-09 18:48 ` Ian Jackson
0 siblings, 0 replies; 3+ messages in thread
From: Ian Jackson @ 2012-02-09 18:48 UTC (permalink / raw)
To: Olaf Hering, hongkaixing
Cc: bicky.shi, xiaowei.yang, xen-devel, yanqiangjun, hanweidong
hongkaixing@huawei.com writes ("[Xen-devel] [PATCH] xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in"):
> xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in
> tools/xenpaging
Thanks, and to Olaf for the ack.
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-09 18:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-09 8:59 [PATCH] xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in hongkaixing
2012-02-09 9:54 ` Olaf Hering
2012-02-09 18:48 ` [PATCH] xenpaging:add the dealing of MEM_EVENT_FLAG_EVICT_FAIL request in [and 1 more messages] Ian Jackson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).