From: "Jason J. Herne" <jjhe...@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 <jjhe...@us.ibm.com> Reviewed-by: Christian Borntraeger <borntrae...@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