[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/14] kvm: run cpu state synchronization on target v
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 01/14] kvm: run cpu state synchronization on target vcpu thread |
Date: |
Thu, 28 Aug 2014 16:09:00 +0200 |
From: David Hildenbrand <address@hidden>
As already done for kvm_cpu_synchronize_state(), let's trigger
kvm_arch_put_registers() via run_on_cpu() for kvm_cpu_synchronize_post_reset()
and kvm_cpu_synchronize_post_init().
This way, we make sure that the register synchronizing ioctls are
called from the proper vcpu thread; this avoids calls to
synchronize_rcu() in the kernel.
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
kvm-all.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index 1402f4f..b240bf8 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1669,18 +1669,32 @@ void kvm_cpu_synchronize_state(CPUState *cpu)
}
}
-void kvm_cpu_synchronize_post_reset(CPUState *cpu)
+static void do_kvm_cpu_synchronize_post_reset(void *arg)
{
+ CPUState *cpu = arg;
+
kvm_arch_put_registers(cpu, KVM_PUT_RESET_STATE);
cpu->kvm_vcpu_dirty = false;
}
-void kvm_cpu_synchronize_post_init(CPUState *cpu)
+void kvm_cpu_synchronize_post_reset(CPUState *cpu)
+{
+ run_on_cpu(cpu, do_kvm_cpu_synchronize_post_reset, cpu);
+}
+
+static void do_kvm_cpu_synchronize_post_init(void *arg)
{
+ CPUState *cpu = arg;
+
kvm_arch_put_registers(cpu, KVM_PUT_FULL_STATE);
cpu->kvm_vcpu_dirty = false;
}
+void kvm_cpu_synchronize_post_init(CPUState *cpu)
+{
+ run_on_cpu(cpu, do_kvm_cpu_synchronize_post_init, cpu);
+}
+
int kvm_cpu_exec(CPUState *cpu)
{
struct kvm_run *run = cpu->kvm_run;
--
1.8.3.1
- [Qemu-devel] [PULL 00/14] KVM changes for 2014-08-28, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 02/14] cpus: Define callback for QEMU "nmi" command, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 03/14] s390x: Convert QEMUMachine to MachineClass, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 04/14] s390x: Migrate to new NMI interface, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 01/14] kvm: run cpu state synchronization on target vcpu thread,
Paolo Bonzini <=
- [Qemu-devel] [PULL 05/14] spapr: Add support for new NMI interface, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 06/14] target-i386: Don't forbid NX bit on PAE PDEs and PTEs, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 07/14] x86: Use common variable range MTRR counts, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 09/14] x86: Clear MTRRs on vCPU reset, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 08/14] x86: kvm: Add MTRR support for kvm_get|put_msrs(), Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 11/14] vl: process -object after other backend options, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 10/14] checkpatch.pl: adjust typedef definition to QEMU coding style, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 12/14] target-i386: Add "mpx" CPU feature name, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 13/14] target-i386: Add "tsc_adjust" CPU feature name, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 14/14] mc146818rtc: reinitialize irq_reinject_on_ack_count on reset, Paolo Bonzini, 2014/08/28