public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 2/3] Don't return to guest after CPU issued S3 command.
Date: Tue, 30 Dec 2008 14:32:56 +0200	[thread overview]
Message-ID: <20081230123256.GB3326@redhat.com> (raw)
In-Reply-To: <495A03BA.5060701@redhat.com>

On Tue, Dec 30, 2008 at 01:19:22PM +0200, Avi Kivity wrote:
>> +int kvm_shutdown(void *opaque, void *data); 
>
> That's a bad API.  What's the opaque?  what's the data?
>
How about this one:

Don't return to guest CPU after qemu_system_reset_request().
    
Signed-off-by: Gleb Natapov <gleb@redhat.com>

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 01c265b..8ec8f7f 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -1357,3 +1357,9 @@ int qemu_kvm_has_sync_mmu(void)
 {
     return kvm_has_sync_mmu(kvm_context);
 }
+
+void qemu_kvm_cpu_stop(CPUState *env)
+{
+    if (kvm_enabled())
+        env->kvm_cpu_state.stopped = 1;    
+}
diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h
index ec27d06..f8d724b 100644
--- a/qemu/qemu-kvm.h
+++ b/qemu/qemu-kvm.h
@@ -153,6 +153,7 @@ struct ioperm_data {
 };
 
 int qemu_kvm_has_sync_mmu(void);
+void qemu_kvm_cpu_stop(CPUState *env);
 
 #define kvm_enabled() (kvm_allowed)
 #define qemu_kvm_irqchip_in_kernel() kvm_irqchip_in_kernel(kvm_context)
@@ -168,6 +169,7 @@ void kvm_load_tsc(CPUState *env);
 #define kvm_has_sync_mmu() (0)
 #define kvm_load_registers(env) do {} while(0)
 #define kvm_save_registers(env) do {} while(0)
+#define qemu_kvm_cpu_stop(env) do {} while(0)
 static inline void kvm_init_vcpu(CPUState *env) { }
 static inline void void kvm_load_tsc(CPUState *env) {}
 
diff --git a/qemu/vl.c b/qemu/vl.c
index 0d1d236..a0c5472 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -3585,8 +3585,11 @@ void qemu_system_reset_request(void)
     } else {
         reset_requested = 1;
     }
-    if (cpu_single_env)
+
+    if (cpu_single_env) {
+        qemu_kvm_cpu_stop(cpu_single_env);
         cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
+    }
     main_loop_break();
 }
 
--
			Gleb.

  reply	other threads:[~2008-12-30 12:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-30 10:37 [PATCH 0/3] Remaining S3 bits Gleb Natapov
2008-12-30 10:37 ` [PATCH 1/3] Reset stack pointer to zero on S3 resume Gleb Natapov
2008-12-30 10:37 ` [PATCH 2/3] Don't return to guest after CPU issued S3 command Gleb Natapov
2008-12-30 11:19   ` Avi Kivity
2008-12-30 12:32     ` Gleb Natapov [this message]
2008-12-30 13:25       ` Avi Kivity
2008-12-30 10:37 ` [PATCH 3/3] KVM does not support SMM. Disable it Gleb Natapov
2008-12-30 11:25 ` [PATCH 0/3] Remaining S3 bits Avi Kivity

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=20081230123256.GB3326@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.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