[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kvm-commits
Subject:    [COMMIT master] Fix latent bug exposed by using cpu_env->stopped
From:       Avi Kivity <avi () redhat ! com>
Date:       2009-07-28 16:07:56
Message-ID: 20090728160756.7D862250061 () cleopatra ! tlv ! redhat ! com
[Download RAW message or body]

From: Avi Kivity <avi@redhat.com>

cpu_env->stopped is part of the cpu state that is implicitly cleared by reset.
kvm runs reset with all vcpus stopped, but the implicit clearing causes this
to fail.

Fix by moving ->stopped out of the implicit clear area.  Testcase is reboots
under smp.

Signed-off-by: Avi Kivity <avi@redhat.com>

diff --git a/cpu-defs.h b/cpu-defs.h
index ce9f96a..c1a0f8e 100644
--- a/cpu-defs.h
+++ b/cpu-defs.h
@@ -158,8 +158,6 @@ struct KVMCPUState {
     target_ulong mem_io_vaddr; /* target virtual addr at which the      \
                                      memory was accessed */             \
     uint32_t halted; /* Nonzero if the CPU is in suspend state */       \
-    uint32_t stop;   /* Stop request */                                 \
-    uint32_t stopped; /* Artificially stopped */                        \
     uint32_t interrupt_request;                                         \
     volatile sig_atomic_t exit_request;                                 \
     /* The meaning of the MMU modes is defined in the target code. */   \
@@ -209,6 +207,8 @@ struct KVMCPUState {
     struct KVMState *kvm_state;                                         \
     struct kvm_run *kvm_run;                                            \
     int kvm_fd;                                                         \
+    uint32_t stop;   /* Stop request */                                 \
+    uint32_t stopped; /* Artificially stopped */                        \
     struct KVMCPUState kvm_cpu_state;
 
 #endif
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic