From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: [PATCH] call preempt_notifier_init early enough Date: Tue, 23 Oct 2007 00:56:15 +0200 Message-ID: <471D2A8F.3070303@web.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2026077597==" To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============2026077597== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigAC40080A0E9175944977B14B" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAC40080A0E9175944977B14B Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable As vmx_create_vcpu already makes use of start/end_special_insn, we need to initialise the emulated preempt_notifier earlier. Let's move it to kvm_vcpu_init. This should fix an oops I've seen here at least once during kvm startup - so far the problem did not show up again. Signed-off-by: Jan Kiszka --- kernel/kvm_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: kvm-48/kernel/kvm_main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kvm-48.orig/kernel/kvm_main.c +++ kvm-48/kernel/kvm_main.c @@ -261,6 +261,8 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, vcpu->mp_state =3D VCPU_MP_STATE_UNINITIALIZED; init_waitqueue_head(&vcpu->wq); =20 + preempt_notifier_init(&vcpu->preempt_notifier, &kvm_preempt_ops); + page =3D alloc_page(GFP_KERNEL | __GFP_ZERO); if (!page) { r =3D -ENOMEM; @@ -2664,8 +2666,6 @@ static int kvm_vm_ioctl_create_vcpu(stru if (IS_ERR(vcpu)) return PTR_ERR(vcpu); =20 - preempt_notifier_init(&vcpu->preempt_notifier, &kvm_preempt_ops); - /* We do fxsave: this must be aligned. */ BUG_ON((unsigned long)&vcpu->host_fx_image & 0xF); =20 --------------enigAC40080A0E9175944977B14B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHHSqSniDOoMHTA+kRAgIwAJ4yb8DDVDU9OZfkW3vv2buEGuk/jQCdG712 QuraKqq0TIkFRdPklU+zSeA= =Zz9k -----END PGP SIGNATURE----- --------------enigAC40080A0E9175944977B14B-- --===============2026077597== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ --===============2026077597== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --===============2026077597==--