From: Jan Beulich on
With the pv-ops based spinlocks reportedly having measurable overhead
on native execution, and with them also not easily fit (at least) fully
virtualized Xen guests, this patch series introduces a replacement
mechanism based on alternative instruction patching, and then uses it
for fully virtualized Xen guests. While coded to be orthogonal to
pv-ops, it really isn't, and it shouldn't be difficult to make pv-ops guests
use this in place of pv-ops spin locks.

The only additional overhead this introduces for native execution is
the writing of the owning CPU in the lock acquire paths. If this is
considered a problem, even that code could be eliminated for native
execution (by further alternative instruction patching).

(1) base implementation
(2) Xen implementation
(3) [optional] eliminate on NOPs in unlock path (introduced in (1))

Signed-off-by: Jan Beulich <jbeulich(a)novell.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge(a)citrix.com>