]> git.baikalelectronics.ru Git - kernel.git/commit
xen/smp: Update pv_lock_ops functions before alternative code starts under PVHVM
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 16 Aug 2013 18:39:56 +0000 (14:39 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 9 Sep 2013 16:06:31 +0000 (12:06 -0400)
commit55292cd6aceb066d25f44493f4208a2592cb1da5
tree0dd73b283ee84972da958df36943071ba278428b
parent9ab17cf82dc51f7a9becb37baf0367dc5d415681
xen/smp: Update pv_lock_ops functions before alternative code starts under PVHVM

Before this patch we would patch all of the pv_lock_ops sites
using alternative assembler. Then later in the bootup cycle
change the unlock_kick and lock_spinning to the Xen specific -
without re patching.

That meant that for the core of the kernel we would be running
with the baremetal version of unlock_kick and lock_spinning while
for modules we would have the proper Xen specific slowpaths.

As most of the module uses some API from the core kernel that ended
up with slowpath lockers waiting forever to be kicked (b/c they
would be using the Xen specific slowpath logic). And the
kick never came b/c the unlock path that was taken was the
baremetal one.

On PV we do not have the problem as we initialise before the
alternative code kicks in.

The fix is to make the updating of the pv_lock_ops function
be done before the alternative code starts patching.

Note that this patch fixes issues discovered by commit
e943bc94cb9aafe697cb00689960ab2c21061b46.
("xen: disable PV spinlocks on HVM") wherein it mentioned

   PV spinlocks cannot possibly work with the current code because they are
   enabled after pvops patching has already been done, and because PV
   spinlocks use a different data structure than native spinlocks so we
   cannot switch between them dynamically.

The first problem is solved by this patch.

The second problem has been solved by commit
11c894665035ad2f27115c4c8126fa6209e6919c
(Merge branch 'x86-spinlocks-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip)

P.S.
There is still the commit 983303b99beae417c424a265e8a509d624651e82
(xen/spinlock: Disable IRQ spinlock (PV) allocation on PVHVM) to
revert but that can be done later after all other bugs have been
fixed.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
arch/x86/xen/smp.c