Skip to contentSkip to conversation

call preempt_notifier_init early enough

PATCH In review Jan Kiszka 2 participants 2 messages Oct 22, 2007 – Oct 23, 2007 1 message not in the archive KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 call preempt_notifier_init early enough

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.

---
 kernel/kvm_main.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/kvm_main.c +2 -2
Index: kvm-48/kernel/kvm_main.c
===================================================================
@@ -261,6 +261,8 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu,
 		vcpu->mp_state = VCPU_MP_STATE_UNINITIALIZED;
 	init_waitqueue_head(&vcpu->wq);
 
+	preempt_notifier_init(&vcpu->preempt_notifier, &kvm_preempt_ops);
+
 	page = alloc_page(GFP_KERNEL | __GFP_ZERO);
 	if (!page) {
 		r = -ENOMEM;
@@ -2664,8 +2666,6 @@ static int kvm_vm_ioctl_create_vcpu(stru
 	if (IS_ERR(vcpu))
 		return PTR_ERR(vcpu);
 
-	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);
 

-------------------------------------------------------------------------
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/

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

A message that is not in the archive (sent off-list or not yet received): 471D2A8F.3070303-S0/[email protected]

#2 lore raw
Quoted 5 lines · Jan Kiszka

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.

An alternative fix has already been committed.

Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
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/