[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/5] kvm: run cpu state synchronization on target vc
From: |
Jens Freimann |
Subject: |
[Qemu-devel] [PATCH 1/5] kvm: run cpu state synchronization on target vcpu thread |
Date: |
Thu, 28 Aug 2014 13:58:48 +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: Jens Freimann <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.9.3
- [Qemu-devel] [PATCH 0/5] s390x/kvm: avoid synchronize_rcu's in kernel, Jens Freimann, 2014/08/28
- [Qemu-devel] [PATCH 2/5] s390x/kvm: run guest triggered resets on the target vcpu thread, Jens Freimann, 2014/08/28
- [Qemu-devel] [PATCH 4/5] s390x/kvm: execute "system reset" cpu resets on the vcpu thread, Jens Freimann, 2014/08/28
- [Qemu-devel] [PATCH 3/5] s390x/kvm: execute sigp orders on the target vcpu thread, Jens Freimann, 2014/08/28
- [Qemu-devel] [PATCH 5/5] s390x/kvm: execute the first cpu reset on the vcpu thread, Jens Freimann, 2014/08/28
- [Qemu-devel] [PATCH 1/5] kvm: run cpu state synchronization on target vcpu thread,
Jens Freimann <=
- Re: [Qemu-devel] [PATCH 0/5] s390x/kvm: avoid synchronize_rcu's in kernel, Christian Borntraeger, 2014/08/28