aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenpaging
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2012-02-09 18:47:53 +0000
committerOlaf Hering <olaf@aepfle.de>2012-02-09 18:47:53 +0000
commitc411a2bcbcce6034e90f3b802eb2dd4d8b8ad690 (patch)
tree98439726bbc980c9afafee5b7ddbc4705ff8fc6b /tools/xenpaging
parent6f77e95164674e38738bbd55572555d49657c76a (diff)
downloadxen-c411a2bcbcce6034e90f3b802eb2dd4d8b8ad690.tar.gz
xen-c411a2bcbcce6034e90f3b802eb2dd4d8b8ad690.tar.bz2
xen-c411a2bcbcce6034e90f3b802eb2dd4d8b8ad690.zip
xenpaging: deal with 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. - Olaf ] Signed-off-by: hongkaixing <hongkaixing@huawei.com> Signed-off-by: shizhen <bicky.shi@huawei.com> Acked-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/xenpaging')
-rw-r--r--tools/xenpaging/xenpaging.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
index 101c4e2866..2e8c10d143 100644
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -911,7 +911,7 @@ int main(int argc, char *argv[])
!!(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;