[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] EPT: Flush running cpus, add mask to flush when scheduled in



The attached patch modifies ept_sync_domain() to make it more
efficient wrt flushing ept translations.

Specifically:
* It synchronously flushes only cpus on which the domain is currently
running (d->domain_dirty_cpumask)
* It introduces a new vmx-specific mask, "ept_needs_flush", set to the
complement of d->domain_dirty_cpumask
* In vmx_ctxt_switch_to(), if the cpu is set in ept_needs_flush, it
flushes ept before running.

Main change I'd like reviewed: in order to avoid a potential race
condition described below, I had to re-order the setting of
domain_dirty_cpumask and the calling of arch.ctxt_switch_to() in
__context_switch().

Potential race without the re-ordering:
p1: change ept
p2: check ept_needs_flush, finds it false, doesn't flush
p1: sets ept_needs_flush
p1: checks domain_dirty, finds p2 not in it
p2: sets domain_dirty

Thus the vcpu on p2 is scheduled without its ept translations being flushed.

I've tested this with a 2-vcpu VM doing a parallel compile and
ballooning, no problems.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.