Re: merge bouyer-xenpvh to HEAD

Jaromír Doleček <[email protected]> Wed, 22 Apr 2020 23:08:27 +0200
Newsgroups gmane.os.netbsd.ports.x86-64,gmane.os.netbsd.ports.xen,gmane.os.netbsd.ports.i386
Message-ID <CAMnsW5559aucNzs_m1iV6VkzAz4a5vER46JfH4-2qgGy_KqR-g@mail.gmail.com>
Le mer. 22 avr. 2020 à 22:26, Manuel Bouyer <[email protected]> a écrit :
> Maybe the backend block and network drivers too; I think they are protected
> by KERNEL_LOCK but I'm not completely sure (especially xbdback).

xenneback processing is protected by KERNEL_LOCK, both the event
handler and the softint. So should be fine. If we get MULTIPROCESSOR
for Dom0 it's also relatively straightforward to adjust to not rely on
KERNEL_LOCK.

xbdback is actually not MPSAFE. It runs request processing in a kernel
thread with held spinlock. The thread is created with KTHREAD_MPSAFE
and thus doesn't take KERNEL_LOCK() implicitly. Amusingly enough the
only MP-unsafe part is xbdback_iodone(), which takes KERNEL_LOCK()
explicitely, but this doesn't prevent the xbdback thread from
modifying internal state on other cpu. A quickest fix would be just to
remove the KTHREAD_MPSAFE from the thread. I'll fix this up, I'm
familiar with the area having recendly done some changes there.

Jaromir