From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3cWD-0003cM-U9 for qemu-devel@nongnu.org; Tue, 03 Jun 2008 15:50:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3cWD-0003c4-I8 for qemu-devel@nongnu.org; Tue, 03 Jun 2008 15:50:05 -0400 Received: from [199.232.76.173] (port=50970 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3cWD-0003c0-6g for qemu-devel@nongnu.org; Tue, 03 Jun 2008 15:50:05 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:36196) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3cWC-0007dx-VL for qemu-devel@nongnu.org; Tue, 03 Jun 2008 15:50:05 -0400 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate01.web.de (Postfix) with ESMTP id 26D0FE2402C6 for ; Tue, 3 Jun 2008 21:50:03 +0200 (CEST) Received: from [88.65.38.172] (helo=[192.168.1.198]) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1K3cW9-0007H1-00 for qemu-devel@nongnu.org; Tue, 03 Jun 2008 21:50:01 +0200 Message-ID: <4845A068.2050305@web.de> Date: Tue, 03 Jun 2008 21:50:00 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <484444CC.8040202@web.de> <48459740.20606@codemonkey.ws> In-Reply-To: <48459740.20606@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH] Reset interrupt_request on loadvm Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Anthony Liguori wrote: > Jan Kiszka wrote: >> Trying to use savevm/loadvm to reduce my debug round-trip times, I came >> across this bug. The following reset is required to avoid spurious IRQ >> injections after the system state has been loaded from a snapshot. Not >> sure if it is a regression of SVN head, but Qemu from my Suse 10.3 seems >> to be immune. >> >> Signed-off-by: Jan Kiszka >> --- >> cpu-defs.h | 3 +++ >> vl.c | 3 +++ >> 2 files changed, 6 insertions(+) >> >> Index: b/cpu-defs.h >> =================================================================== >> --- a/cpu-defs.h >> +++ b/cpu-defs.h >> @@ -172,3 +172,6 @@ typedef struct CPUTLBEntry { >> const char *cpu_model_str; >> >> #endif >> + >> +#define foreach_cpu(env) \ >> + for(env = first_cpu; env != NULL; env = env->next_cpu) >> > > Please don't introduce this sort of wrapper in this patch. If you think > open coded iterations should be eliminated, do it in a separate patch. Sorry, I ripped this quickly (and incorrectly!) out of my queue where I'm using this for quite a while routinely. ---------- Trying to use savevm/loadvm to reduce my debug round-trip times, I came across this bug. The following reset is required to avoid spurious IRQ injections after the system state has been loaded from a snapshot. Not sure if it is a regression of SVN head, but Qemu from my Suse 10.3 seems to be immune. Signed-off-by: Jan Kiszka --- vl.c | 3 +++ 1 file changed, 3 insertions(+) Index: b/vl.c =================================================================== --- a/vl.c +++ b/vl.c @@ -6032,6 +6032,7 @@ static SaveStateEntry *find_se(const cha static int qemu_loadvm_state(QEMUFile *f) { SaveStateEntry *se; + CPUState *env; int len, ret, instance_id, record_len, version_id; int64_t total_len, end_pos, cur_pos; unsigned int v; @@ -6046,6 +6047,8 @@ static int qemu_loadvm_state(QEMUFile *f ret = -1; goto the_end; } + for (env = first_cpu; env != NULL; env = env->next_cpu) + env->interrupt_request = 0; total_len = qemu_get_be64(f); end_pos = total_len + qemu_ftell(f); for(;;) {