From patchwork Fri Sep 11 14:41:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 33465 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id EE6A5B6F56 for ; Sat, 12 Sep 2009 00:51:54 +1000 (EST) Received: from localhost ([127.0.0.1]:56347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm7Tc-0001Wy-C7 for incoming@patchwork.ozlabs.org; Fri, 11 Sep 2009 10:51:52 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mm7Jm-0001e4-3t for qemu-devel@nongnu.org; Fri, 11 Sep 2009 10:41:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mm7Jg-0001bf-Od for qemu-devel@nongnu.org; Fri, 11 Sep 2009 10:41:41 -0400 Received: from [199.232.76.173] (port=43008 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm7Jg-0001ba-Hv for qemu-devel@nongnu.org; Fri, 11 Sep 2009 10:41:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33217) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mm7Jg-0006w3-3I for qemu-devel@nongnu.org; Fri, 11 Sep 2009 10:41:36 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8BEfZx5013805; Fri, 11 Sep 2009 10:41:35 -0400 Received: from localhost.localdomain (vpn-10-25.bos.redhat.com [10.16.10.25]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8BEfXA3005220; Fri, 11 Sep 2009 10:41:34 -0400 From: Glauber Costa To: qemu-devel@nongnu.org Date: Fri, 11 Sep 2009 11:41:32 -0300 Message-Id: <1252680092-5208-1-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH] temporary fix for on_vcpu X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Recent changes made on_vcpu hit the abort() path, even with the IO thread disabled. This is because cpu_single_env is no longer set when we call this function. Although the correct fix is a little bit more complicated that that, the recent thread in which I proposed qemu_queue_work (which fixes that, btw), is likely to go on a quite different direction. So for the benefit of those using guest debugging, I'm proposing this simple fix in the interim. Signed-off-by: Glauber Costa --- kvm-all.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index df4e849..2c24440 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -902,11 +902,15 @@ void kvm_setup_guest_memory(void *start, size_t size) #ifdef KVM_CAP_SET_GUEST_DEBUG static void on_vcpu(CPUState *env, void (*func)(void *data), void *data) { +#ifdef CONFIG_IOTHREAD if (env == cpu_single_env) { func(data); return; } abort(); +#else + func(data); +#endif } struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env,