|
|
9ae3a8 |
From 2611b6a31041da5b9ed3793152d309aae77932bb Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
|
|
|
9ae3a8 |
Date: Wed, 22 Oct 2014 09:46:35 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 4/6] Introduce cpu_clean_all_dirty
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Message-id: <1413971197-4624-4-git-send-email-dgilbert@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 61791
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.1 qemu-kvm PATCH 3/5] Introduce cpu_clean_all_dirty
|
|
|
9ae3a8 |
Bugzilla: 1098602 1130428
|
|
|
9ae3a8 |
RH-Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Marcelo Tosatti <mtosatti@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Introduce cpu_clean_all_dirty, to force subsequent cpu_synchronize_all_states
|
|
|
9ae3a8 |
to read in-kernel register state.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit de9d61e83d43be9069e6646fa9d57a3f47779d28)
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts:
|
|
|
9ae3a8 |
cpus.c
|
|
|
9ae3a8 |
kvm-all.c
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
dgilbert: Had to replace CPU_FOREACH by a loop
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
cpus.c | 9 +++++++++
|
|
|
9ae3a8 |
include/sysemu/cpus.h | 1 +
|
|
|
9ae3a8 |
include/sysemu/kvm.h | 8 ++++++++
|
|
|
9ae3a8 |
kvm-all.c | 5 +++++
|
|
|
9ae3a8 |
4 files changed, 23 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/cpus.c b/cpus.c
|
|
|
9ae3a8 |
index caccf5a..3948cdf 100644
|
|
|
9ae3a8 |
--- a/cpus.c
|
|
|
9ae3a8 |
+++ b/cpus.c
|
|
|
9ae3a8 |
@@ -437,6 +437,15 @@ bool cpu_is_stopped(CPUState *cpu)
|
|
|
9ae3a8 |
return !runstate_is_running() || cpu->stopped;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+void cpu_clean_all_dirty(void)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ CPUArchState *cpu;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ for (cpu = first_cpu; cpu; cpu = cpu->next_cpu) {
|
|
|
9ae3a8 |
+ cpu_clean_state(ENV_GET_CPU(cpu));
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
static int do_vm_stop(RunState state)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
int ret = 0;
|
|
|
9ae3a8 |
diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
|
|
|
9ae3a8 |
index 6502488..4f8a3df 100644
|
|
|
9ae3a8 |
--- a/include/sysemu/cpus.h
|
|
|
9ae3a8 |
+++ b/include/sysemu/cpus.h
|
|
|
9ae3a8 |
@@ -10,6 +10,7 @@ void cpu_stop_current(void);
|
|
|
9ae3a8 |
void cpu_synchronize_all_states(void);
|
|
|
9ae3a8 |
void cpu_synchronize_all_post_reset(void);
|
|
|
9ae3a8 |
void cpu_synchronize_all_post_init(void);
|
|
|
9ae3a8 |
+void cpu_clean_all_dirty(void);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
void qtest_clock_warp(int64_t dest);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
|
|
|
9ae3a8 |
index e722027..0c6833f 100644
|
|
|
9ae3a8 |
--- a/include/sysemu/kvm.h
|
|
|
9ae3a8 |
+++ b/include/sysemu/kvm.h
|
|
|
9ae3a8 |
@@ -274,6 +274,7 @@ int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr,
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
void kvm_cpu_synchronize_post_reset(CPUState *cpu);
|
|
|
9ae3a8 |
void kvm_cpu_synchronize_post_init(CPUState *cpu);
|
|
|
9ae3a8 |
+void kvm_cpu_clean_state(CPUState *cpu);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
static inline void cpu_synchronize_post_reset(CPUState *cpu)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
@@ -289,6 +290,13 @@ static inline void cpu_synchronize_post_init(CPUState *cpu)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+static inline void cpu_clean_state(CPUState *cpu)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ if (kvm_enabled()) {
|
|
|
9ae3a8 |
+ kvm_cpu_clean_state(cpu);
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg);
|
|
|
9ae3a8 |
int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg);
|
|
|
9ae3a8 |
void kvm_irqchip_release_virq(KVMState *s, int virq);
|
|
|
9ae3a8 |
diff --git a/kvm-all.c b/kvm-all.c
|
|
|
9ae3a8 |
index f7f621b..fc6e3ab 100644
|
|
|
9ae3a8 |
--- a/kvm-all.c
|
|
|
9ae3a8 |
+++ b/kvm-all.c
|
|
|
9ae3a8 |
@@ -1615,6 +1615,11 @@ void kvm_cpu_synchronize_post_init(CPUState *cpu)
|
|
|
9ae3a8 |
cpu->kvm_vcpu_dirty = false;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+void kvm_cpu_clean_state(CPUState *cpu)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ cpu->kvm_vcpu_dirty = false;
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
int kvm_cpu_exec(CPUArchState *env)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
CPUState *cpu = ENV_GET_CPU(env);
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|