qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/7] KVM regsync: Add register level parameter to do


From: Jason J. Herne
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

From: "Jason J. Herne" <address@hidden>

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 <address@hidden>
Reviewed-by: Christian Borntraeger <address@hidden>
---
 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 via email to

[Prev in Thread] Current Thread [Next in Thread]