public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: tdempsey42-xwVYE8SWAR3R7s880joybQ@public.gmane.org
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: KVM-49 - XP crash on startup/install
Date: Tue, 30 Oct 2007 05:48:13 +0200	[thread overview]
Message-ID: <4726A97D.3080202@qumranet.com> (raw)
In-Reply-To: <200710291806.07959.tdempsey42-xwVYE8SWAR3R7s880joybQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

tdempsey42-xwVYE8SWAR3R7s880joybQ@public.gmane.org wrote:
> Hello again,
>
> I attempted to install Windows XP(sp2) as a guest and it crashes with a blank 
> window and "QEMU/KVM[Stopped]" in the title. The install starts fine 
> with -no-kvm. Below is the output from /proc/version, /proc/cpuinfo and 
> dmesg. I am using kvm-49. Also, the only way to get rid of qemu 
> dmesg output:
> BUG: using smp_processor_id() in preemptible [00000001] code: 
> qemu-system-x86/9551
> caller is kvm_flush_remote_tlbs+0x6c/0x140 [kvm]
>  [<c02602ed>] debug_smp_processor_id+0xad/0xb0
>  [<f984e10c>] kvm_flush_remote_tlbs+0x6c/0x140 [kvm]
>   

Does the attached patch help?

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


[-- Attachment #2: fix-smp_call_function_mask-emulation.patch --]
[-- Type: text/x-patch, Size: 847 bytes --]

diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h
index 6fd0ef6..5d5fd60 100644
--- a/kernel/external-module-compat.h
+++ b/kernel/external-module-compat.h
@@ -464,15 +464,17 @@ static inline int kvm_smp_call_function_mask(cpumask_t mask,
 	cpumask_t allbutself;
 	int cpus;
 	int cpu;
+	int me;
 
+	me = get_cpu();
 	allbutself = cpu_online_map;
-	cpu_clear(smp_processor_id(), allbutself);
+	cpu_clear(me, allbutself);
 
 	cpus_and(mask, mask, allbutself);
 	cpus = cpus_weight(mask);
 
 	if (!cpus)
-		return 0;
+		goto out;
 
 	data.func = func;
 	data.info = info;
@@ -490,12 +492,14 @@ static inline int kvm_smp_call_function_mask(cpumask_t mask,
 	}
 
 	if (!wait)
-		return 0;
+		goto out;
 
 	while (atomic_read(&data.finished) != cpus) {
 		cpu_relax();
 		barrier();
 	}
+out:
+	put_cpu();
 	return 0;
 }
 

[-- Attachment #3: Type: text/plain, Size: 314 bytes --]

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

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

  parent reply	other threads:[~2007-10-30  3:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29 22:06 KVM-49 - XP crash on startup/install tdempsey42-xwVYE8SWAR3R7s880joybQ
     [not found] ` <200710291806.07959.tdempsey42-xwVYE8SWAR3R7s880joybQ@public.gmane.org>
2007-10-29 22:48   ` Alexey Eremenko
2007-10-30  3:48   ` Avi Kivity [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-10-29 23:11 Tim Dempsey

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=4726A97D.3080202@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=tdempsey42-xwVYE8SWAR3R7s880joybQ@public.gmane.org \
    /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