aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/public/domctl.h
diff options
context:
space:
mode:
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>2011-12-01 18:14:24 +0000
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>2011-12-01 18:14:24 +0000
commit26a5c829c8e6c2379fc45529accddf8b65fbbcef (patch)
tree4b82488641d71d5535058e414893d9abe1754362 /xen/include/public/domctl.h
parentc93217edc3e3b904491df571c51f1f2588a58e58 (diff)
downloadxen-26a5c829c8e6c2379fc45529accddf8b65fbbcef.tar.gz
xen-26a5c829c8e6c2379fc45529accddf8b65fbbcef.tar.bz2
xen-26a5c829c8e6c2379fc45529accddf8b65fbbcef.zip
After preparing a page for page-in, allow immediate fill-in of the page contents
p2m_mem_paging_prep ensures that an mfn is backing the paged-out gfn, and transitions to the next state in the paging state machine for that page. Foreign mappings of the gfn will now succeed. This is the key idea, as it allows the pager to now map the gfn and fill in its contents. Unfortunately, it also allows any other foreign mapper to map the gfn and read its contents. This is particularly dangerous when the populate is launched by a foreign mapper in the first place, which will be actively retrying the map operation and might race with the pager. Qemu-dm being a prime example. Fix the race by allowing a buffer to be optionally passed in the prep operation, and having the hypervisor memcpy from that buffer into the newly prepped page before promoting the gfn type. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen/include/public/domctl.h')
-rw-r--r--xen/include/public/domctl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index b265a47aec..509442b22f 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -742,8 +742,12 @@ struct xen_domctl_mem_event_op {
uint32_t op; /* XEN_DOMCTL_MEM_EVENT_OP_*_* */
uint32_t mode; /* XEN_DOMCTL_MEM_EVENT_OP_* */
- /* OP_ENABLE */
- uint64_aligned_t shared_addr; /* IN: Virtual address of shared page */
+ union {
+ /* OP_ENABLE IN: Virtual address of shared page */
+ uint64_aligned_t shared_addr;
+ /* PAGING_PREP IN: buffer to immediately fill page in */
+ uint64_aligned_t buffer;
+ } u;
uint64_aligned_t ring_addr; /* IN: Virtual address of ring page */
/* Other OPs */