public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: Kernel crashes in VirtualBox module after commit 2ecd9d29abb1
Date: Tue, 11 Aug 2015 09:44:54 +0200	[thread overview]
Message-ID: <20150811074454.GI16853@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <55C91C7D.2020506@lwfinger.net>

On Mon, Aug 10, 2015 at 04:49:49PM -0500, Larry Finger wrote:
> A problem with the VirtualBox kernel module vboxdrv.ko has been bisected to
> commit 2ecd9d29abb1 "sched, preempt_notifier: separate notifier registration
> from static_key inc/dec".  The affected kernels crash is various ways. The
> most instructive includes a warning issued at kernel/sched/core.c:2342 in
> prempt_notifier_register() for "registering prempt_notifier while notifiers
> disabled" The call from vboxdrv is as follows:
> 
>         /*
>          * Register the callback.
>          */
>         preempt_disable();
>         pThis->fEnabled = true;
>         preempt_notifier_register(&pThis->LnxPreemptNotifier);
>         preempt_enable();
> 
> As I have no reason to suspect the kernel after this patch, I would like
> some suggestions regarding the best method to patch/fix the VirtualBox code.

You have to call preempt_notifier_inc() when creating your virtual box
instance _before_ creating your vCPU threads which will register the
preempt_notifiers.

You also have to call a matching preempt_notifier_dec() when destroying
your virtual box instance.

The patch you refer adds these calls in
kvm_create_vm()/kvm_destroy_vm(). Mirror that and things should work
again.

      reply	other threads:[~2015-08-11  7:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-10 21:49 Kernel crashes in VirtualBox module after commit 2ecd9d29abb1 Larry Finger
2015-08-11  7:44 ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150811074454.GI16853@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox