Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755299AbbHKHo7 (ORCPT ); Tue, 11 Aug 2015 03:44:59 -0400 Received: from casper.infradead.org ([85.118.1.10]:43061 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755242AbbHKHo5 (ORCPT ); Tue, 11 Aug 2015 03:44:57 -0400 Date: Tue, 11 Aug 2015 09:44:54 +0200 From: Peter Zijlstra To: Larry Finger Cc: Paolo Bonzini , LKML Subject: Re: Kernel crashes in VirtualBox module after commit 2ecd9d29abb1 Message-ID: <20150811074454.GI16853@twins.programming.kicks-ass.net> References: <55C91C7D.2020506@lwfinger.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55C91C7D.2020506@lwfinger.net> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1500 Lines: 34 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/