qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Jason J. Herne" <jjherne@us.ibm.com>
To: borntraeger@de.ibm.com, qemu-devel@nongnu.org,
	jan.kiszka@siemens.com, agraf@suse.de, jfrei@linux.vnet.ibm.com,
	graalfs@linux.vnet.ibm.com
Cc: "Jason J. Herne" <jjherne@us.ibm.com>
Subject: [Qemu-devel] [PATCH 3/7] KVM regsync: Add register level parameter to do_kvm_cpu_synchronize_state
Date: Fri, 21 Dec 2012 08:56:01 -0500	[thread overview]
Message-ID: <1356098161-4848-1-git-send-email-jjherne@us.ibm.com> (raw)

From: "Jason J. Herne" <jjherne@us.ibm.com>

do_kvm_cpu_synchronize_state is called via run_on_cpu, so we can only pass
a single argument.  Create SyncStateArgs struct for this purpose and add
register level data member to it.

Signed-off-by: Jason J. Herne <jjherne@us.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 include/sysemu/kvm.h |    6 ++++++
 kvm-all.c            |   16 ++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index c19b9d1..9a0e071 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -230,6 +230,12 @@ int kvm_check_extension(KVMState *s, unsigned int extension);
 
 uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
                                       uint32_t index, int reg);
+
+struct kvm_cpu_syncstate_args {
+    CPUArchState *env;
+    int register_level;
+};
+
 void kvm_cpu_synchronize_state(CPUArchState *env);
 void kvm_cpu_synchronize_post_reset(CPUArchState *env);
 void kvm_cpu_synchronize_post_init(CPUArchState *env);
diff --git a/kvm-all.c b/kvm-all.c
index fceda59..d227e8b 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1486,22 +1486,26 @@ void kvm_flush_coalesced_mmio_buffer(void)
     s->coalesced_flush_in_progress = false;
 }
 
-static void do_kvm_cpu_synchronize_state(void *_env)
+static void do_kvm_cpu_synchronize_state(void *_args)
 {
-    CPUArchState *env = _env;
+    struct kvm_cpu_syncstate_args *args = _args;
 
-    if (!env->kvm_vcpu_dirty) {
-        kvm_arch_get_registers(env, KVM_REGSYNC_FULL_STATE);
-        env->kvm_vcpu_dirty = 1;
+    if (!args->env->kvm_vcpu_dirty) {
+        kvm_arch_get_registers(args->env, args->register_level);
+        args->env->kvm_vcpu_dirty = 1;
     }
 }
 
 void kvm_cpu_synchronize_state(CPUArchState *env)
 {
     CPUState *cpu = ENV_GET_CPU(env);
+    struct kvm_cpu_syncstate_args args;
+
+    args.env = env;
+    args.register_level = KVM_REGSYNC_FULL_STATE;
 
     if (!env->kvm_vcpu_dirty) {
-        run_on_cpu(cpu, do_kvm_cpu_synchronize_state, env);
+        run_on_cpu(cpu, do_kvm_cpu_synchronize_state, &args);
     }
 }
 
-- 
1.7.9.5

                 reply	other threads:[~2012-12-21 13:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1356098161-4848-1-git-send-email-jjherne@us.ibm.com \
    --to=jjherne@us.ibm.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=graalfs@linux.vnet.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).