qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Jason J. Herne" <jjherne@us.ibm.com>
To: agraf@suse.de, borntraeger@de.ibm.com, aliguori@us.ibm.com,
	mtosatti@redhat.com, qemu-devel@nongnu.org, R65777@freescale.com,
	jan.kiszka@siemens.com
Cc: "Jason J. Herne" <jjherne@us.ibm.com>
Subject: [Qemu-devel] [PATCH 2/7 v2] KVM regsync: Add register bitmap parameter to kvm_arch_[get|put]_registers
Date: Thu, 10 Jan 2013 10:28:43 -0500	[thread overview]
Message-ID: <1357831723-3884-1-git-send-email-jjherne@us.ibm.com> (raw)

From: "Jason J. Herne" <jjherne@us.ibm.com>

Modify kvm_arch_get_registers anf kvm_arch_put_registers interfaces such
that they accept a register bitmap parameter.  Also modify the only caller of
kvm_arch_get_registers such that it passes an appropriate bitmap.  The idea here
is that, for all currently existing calls we want to do nothing different.

Signed-off-by: Jason J. Herne <jjherne@us.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 include/sysemu/kvm.h |   11 ++---------
 kvm-all.c            |    2 +-
 target-i386/cpu.h    |   15 +++++++++++++++
 target-ppc/cpu.h     |   15 +++++++++++++++
 target-s390x/cpu.h   |   15 +++++++++++++++
 target-s390x/kvm.c   |    2 +-
 6 files changed, 49 insertions(+), 11 deletions(-)

diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 6756e16..e0738ba 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -165,16 +165,9 @@ int kvm_arch_handle_exit(CPUState *cpu, struct kvm_run *run);
 
 int kvm_arch_process_async_events(CPUState *cpu);
 
-int kvm_arch_get_registers(CPUState *cpu);
+int kvm_arch_get_registers(CPUState *cpu, int regmap);
 
-/* state subset only touched by the VCPU itself during runtime */
-#define KVM_REGSYNC_RUNTIME_STATE   1
-/* state subset modified during VCPU reset */
-#define KVM_REGSYNC_RESET_STATE     2
-/* full state set, modified during initialization or on vmload */
-#define KVM_REGSYNC_FULL_STATE      3
-
-int kvm_arch_put_registers(CPUState *cpu, int level);
+int kvm_arch_put_registers(CPUState *cpu, int regmap);
 
 int kvm_arch_init(KVMState *s);
 
diff --git a/kvm-all.c b/kvm-all.c
index aa58b74..1aa61bb 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1494,7 +1494,7 @@ static void do_kvm_cpu_synchronize_state(void *arg)
     CPUState *cpu = arg;
 
     if (!cpu->kvm_vcpu_dirty) {
-        kvm_arch_get_registers(cpu);
+        kvm_arch_get_registers(cpu, KVM_REGSYNC_FULL_STATE);
         cpu->kvm_vcpu_dirty = true;
     }
 }
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index e56921b..64d9f05 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -1223,4 +1223,19 @@ void enable_kvm_pv_eoi(void);
 /* Return name of 32-bit register, from a R_* constant */
 const char *get_register_name_32(unsigned int reg);
 
+/* Architecture specific register synchronization constants */
+#define KVM_REGSYNC_I386_RUNTIME_REGS 0x01
+#define KVM_REGSYNC_I386_RESET_REGS 0x02
+#define KVM_REGSYNC_I386_FULL_REGS 0x04
+
+/* General register sets made up of architeture specific registers*/
+/* state subset only touched by the VCPU itself during runtime */
+#define KVM_REGSYNC_RUNTIME_STATE   KVM_REGSYNC_I386_RUNTIME_REGS
+/* state subset modified during VCPU reset */
+#define KVM_REGSYNC_RESET_STATE     (KVM_REGSYNC_RUNTIME_STATE| \
+                                    KVM_REGSYNC_I386_RESET_REGS)
+/* full state set, modified during initialization or on vmload */
+#define KVM_REGSYNC_FULL_STATE      (KVM_REGSYNC_RESET_STATE| \
+                                    KVM_REGSYNC_I386_FULL_REGS)
+
 #endif /* CPU_I386_H */
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index e88ebe0..f890ebd 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -2233,4 +2233,19 @@ static inline void cpu_pc_from_tb(CPUPPCState *env, TranslationBlock *tb)
 
 void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUPPCState *env);
 
+/* Architecture specific register synchronization constants */
+#define KVM_REGSYNC_PPC_RUNTIME_REGS 0x01
+#define KVM_REGSYNC_PPC_RESET_REGS 0x02
+#define KVM_REGSYNC_PPC_FULL_REGS 0x04
+
+/* General register sets made up of architeture specific registers*/
+/* state subset only touched by the VCPU itself during runtime */
+#define KVM_REGSYNC_RUNTIME_STATE   KVM_REGSYNC_PPC_RUNTIME_REGS
+/* state subset modified during VCPU reset */
+#define KVM_REGSYNC_RESET_STATE     (KVM_REGSYNC_RUNTIME_STATE| \
+                                    KVM_REGSYNC_PPC_RESET_REGS)
+/* full state set, modified during initialization or on vmload */
+#define KVM_REGSYNC_FULL_STATE      (KVM_REGSYNC_RESET_STATE| \
+                                    KVM_REGSYNC_PPC_FULL_REGS)
+
 #endif /* !defined (__CPU_PPC_H__) */
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index cd565c9..55ea4ee 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -999,4 +999,19 @@ uint32_t set_cc_nz_f64(float64 v);
 /* misc_helper.c */
 void program_interrupt(CPUS390XState *env, uint32_t code, int ilc);
 
+/* Architecture specific register synchronization constants */
+#define KVM_REGSYNC_S390_RUNTIME_REGS 0x01
+#define KVM_REGSYNC_S390_RESET_REGS 0x02
+#define KVM_REGSYNC_S390_FULL_REGS 0x04
+
+/* General register sets made up of architeture specific registers*/
+/* state subset only touched by the VCPU itself during runtime */
+#define KVM_REGSYNC_RUNTIME_STATE   KVM_REGSYNC_S390_RUNTIME_REGS
+/* state subset modified during VCPU reset */
+#define KVM_REGSYNC_RESET_STATE     (KVM_REGSYNC_RUNTIME_STATE| \
+                                    KVM_REGSYNC_S390_RESET_REGS)
+/* full state set, modified during initialization or on vmload */
+#define KVM_REGSYNC_FULL_STATE      (KVM_REGSYNC_RESET_STATE| \
+                                    KVM_REGSYNC_S390_FULL_REGS)
+
 #endif
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index e7b5ad9..4b87f1c 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -151,7 +151,7 @@ int kvm_arch_put_registers(CPUState *cs, int level)
     return 0;
 }
 
-int kvm_arch_get_registers(CPUState *cs)
+int kvm_arch_get_registers(CPUState *cs, int regmap)
 {
     S390CPU *cpu = S390_CPU(cs);
     CPUS390XState *env = &cpu->env;
-- 
1.7.9.5

                 reply	other threads:[~2013-01-10 15:29 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=1357831723-3884-1-git-send-email-jjherne@us.ibm.com \
    --to=jjherne@us.ibm.com \
    --cc=R65777@freescale.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=mtosatti@redhat.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).