qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Reset interrupt_request on loadvm
@ 2008-06-02 19:06 Jan Kiszka
  2008-06-03 19:10 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2008-06-02 19:06 UTC (permalink / raw)
  To: qemu-devel

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 <jan.kiszka@web.de>
---
 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)
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;
     }
+    foreach_cpu(env)
+        env->interrupt_request = 0;
     total_len = qemu_get_be64(f);
     end_pos = total_len + qemu_ftell(f);
     for(;;) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Reset interrupt_request on loadvm
  2008-06-02 19:06 [Qemu-devel] [PATCH] Reset interrupt_request on loadvm Jan Kiszka
@ 2008-06-03 19:10 ` Anthony Liguori
  2008-06-03 19:50   ` [Qemu-devel] " Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2008-06-03 19:10 UTC (permalink / raw)
  To: qemu-devel

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 <jan.kiszka@web.de>
> ---
>  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.

Regards,

Anthony Liguori

> 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;
>      }
> +    foreach_cpu(env)
> +        env->interrupt_request = 0;
>      total_len = qemu_get_be64(f);
>      end_pos = total_len + qemu_ftell(f);
>      for(;;) {
>
>
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH] Reset interrupt_request on loadvm
  2008-06-03 19:10 ` Anthony Liguori
@ 2008-06-03 19:50   ` Jan Kiszka
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2008-06-03 19:50 UTC (permalink / raw)
  To: qemu-devel

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 <jan.kiszka@web.de>
>> ---
>>  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 <jan.kiszka@web.de>
---
 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(;;) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-03 19:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-02 19:06 [Qemu-devel] [PATCH] Reset interrupt_request on loadvm Jan Kiszka
2008-06-03 19:10 ` Anthony Liguori
2008-06-03 19:50   ` [Qemu-devel] " Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).