]> xenbits.xensource.com Git - xen.git/commit
properly reference count DOMCTL_{,un}pausedomain hypercalls
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 3 Jul 2014 14:51:13 +0000 (16:51 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 3 Jul 2014 14:51:13 +0000 (16:51 +0200)
commit3eb1c708ab0fe1067a436498a684907afa14dacf
treec06cca16edafde7d28fc8ddf0744368f794a6ae2
parent504f70b624063bbb32d43cdfe6e8409eaac1fa8e
properly reference count DOMCTL_{,un}pausedomain hypercalls

For safety reasons, c/s 6ae2df93c27 "mem_access: Add helper API to setup
ring and enable mem_access" has to pause the domain while it performs a set of
operations.

However without properly reference counted hypercalls, xc_mem_event_enable()
now unconditionally unpauses a previously paused domain.

To prevent toolstack software running wild, there is an arbitrary limit of 255
on the toolstack pause count.  This is high enough for several components of
the toolstack to safely use, but prevents over/underflow of d->pause_count.

The previous domain_{,un}pause_by_systemcontroller() functions are updated to
return an error code.  domain_pause_by_systemcontroller() is modified to have
a common stub and take a pause_fn pointer, allowing for both sync and nosync
domain pauses.  domain_pause_for_debugger() has a hand-rolled nosync pause
replaced with the new domain_pause_by_systemcontroller_nosync(), and has its
variables shuffled slightly to avoid rereading current multiple times.

Suggested-by: Don Slutz <dslutz@verizon.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
With a couple of formatting adjustments:
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domctl.c
xen/common/domain.c
xen/common/domctl.c
xen/include/xen/sched.h