From: "Jason J. Herne" <jjherne@us.ibm.com>
To: borntraeger@de.ibm.com, qemu-devel@nongnu.org,
jan.kiszka@siemens.com, agraf@suse.de, jfrei@linux.vnet.ibm.com,
graalfs@linux.vnet.ibm.com
Cc: "Jason J. Herne" <jjherne@us.ibm.com>
Subject: [Qemu-devel] [PATCH 4/7] KVM regsync: Add register level parameter to kvm_cpu_synchronize_state
Date: Fri, 21 Dec 2012 08:56:09 -0500 [thread overview]
Message-ID: <1356098169-4886-1-git-send-email-jjherne@us.ibm.com> (raw)
From: "Jason J. Herne" <jjherne@us.ibm.com>
kvm_cpu_synchronize_state is updated to take/propagate the register level
parameter. All callers are modified to specify the runtime state.
Signed-off-by: Jason J. Herne <jjherne@us.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
hw/spapr_rtas.c | 2 +-
include/sysemu/kvm.h | 4 ++--
kvm-all.c | 4 ++--
kvm-stub.c | 2 +-
target-i386/kvm.c | 10 +++++-----
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/hw/spapr_rtas.c b/hw/spapr_rtas.c
index 81eecd0..3c7ffee 100644
--- a/hw/spapr_rtas.c
+++ b/hw/spapr_rtas.c
@@ -190,7 +190,7 @@ static void rtas_start_cpu(sPAPREnvironment *spapr,
/* This will make sure qemu state is up to date with kvm, and
* mark it dirty so our changes get flushed back before the
* new cpu enters */
- kvm_cpu_synchronize_state(env);
+ kvm_cpu_synchronize_state(env, KVM_REGSYNC_FULL_STATE);
env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME);
env->nip = start;
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 9a0e071..2f3e485 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -236,7 +236,7 @@ struct kvm_cpu_syncstate_args {
int register_level;
};
-void kvm_cpu_synchronize_state(CPUArchState *env);
+void kvm_cpu_synchronize_state(CPUArchState *env, int register_level);
void kvm_cpu_synchronize_post_reset(CPUArchState *env);
void kvm_cpu_synchronize_post_init(CPUArchState *env);
@@ -245,7 +245,7 @@ void kvm_cpu_synchronize_post_init(CPUArchState *env);
static inline void cpu_synchronize_state(CPUArchState *env)
{
if (kvm_enabled()) {
- kvm_cpu_synchronize_state(env);
+ kvm_cpu_synchronize_state(env, KVM_REGSYNC_FULL_STATE);
}
}
diff --git a/kvm-all.c b/kvm-all.c
index d227e8b..aee5bdd 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1496,13 +1496,13 @@ static void do_kvm_cpu_synchronize_state(void *_args)
}
}
-void kvm_cpu_synchronize_state(CPUArchState *env)
+void kvm_cpu_synchronize_state(CPUArchState *env, int register_level)
{
CPUState *cpu = ENV_GET_CPU(env);
struct kvm_cpu_syncstate_args args;
args.env = env;
- args.register_level = KVM_REGSYNC_FULL_STATE;
+ args.register_level = register_level;
if (!env->kvm_vcpu_dirty) {
run_on_cpu(cpu, do_kvm_cpu_synchronize_state, &args);
diff --git a/kvm-stub.c b/kvm-stub.c
index 5b97152..112b4e9 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -38,7 +38,7 @@ void kvm_flush_coalesced_mmio_buffer(void)
{
}
-void kvm_cpu_synchronize_state(CPUArchState *env)
+void kvm_cpu_synchronize_state(CPUArchState *env, int register_level)
{
}
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 4472738..1b6a604 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1768,7 +1768,7 @@ int kvm_arch_process_async_events(CPUX86State *env)
env->interrupt_request &= ~CPU_INTERRUPT_MCE;
- kvm_cpu_synchronize_state(env);
+ kvm_cpu_synchronize_state(env, KVM_REGSYNC_FULL_STATE);
if (env->exception_injected == EXCP08_DBLE) {
/* this means triple fault */
@@ -1799,16 +1799,16 @@ int kvm_arch_process_async_events(CPUX86State *env)
env->halted = 0;
}
if (env->interrupt_request & CPU_INTERRUPT_INIT) {
- kvm_cpu_synchronize_state(env);
+ kvm_cpu_synchronize_state(env, KVM_REGSYNC_FULL_STATE);
do_cpu_init(cpu);
}
if (env->interrupt_request & CPU_INTERRUPT_SIPI) {
- kvm_cpu_synchronize_state(env);
+ kvm_cpu_synchronize_state(env, KVM_REGSYNC_FULL_STATE);
do_cpu_sipi(cpu);
}
if (env->interrupt_request & CPU_INTERRUPT_TPR) {
env->interrupt_request &= ~CPU_INTERRUPT_TPR;
- kvm_cpu_synchronize_state(env);
+ kvm_cpu_synchronize_state(env, KVM_REGSYNC_FULL_STATE);
apic_handle_tpr_access_report(env->apic_state, env->eip,
env->tpr_access_type);
}
@@ -2086,7 +2086,7 @@ int kvm_arch_handle_exit(CPUX86State *env, struct kvm_run *run)
bool kvm_arch_stop_on_emulation_error(CPUX86State *env)
{
- kvm_cpu_synchronize_state(env);
+ kvm_cpu_synchronize_state(env, KVM_REGSYNC_FULL_STATE);
return !(env->cr[0] & CR0_PE_MASK) ||
((env->segs[R_CS].selector & 3) != 3);
}
--
1.7.9.5
reply other threads:[~2012-12-21 13:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356098169-4886-1-git-send-email-jjherne@us.ibm.com \
--to=jjherne@us.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=graalfs@linux.vnet.ibm.com \
--cc=jan.kiszka@siemens.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).