KVM regsync: Add register bitmap parameter to kvm_arch_[get|put]_registers
PATCH v2 2/7 KVM regsync: Add register bitmap parameter to kvm_arch_[get|put]_registers
From: "Jason J. Herne" <[email protected]>
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 <[email protected]>
Reviewed-by Christian Borntraeger <[email protected]>
--- 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(-)
include/sysemu/kvm.h +2 -9
@@ -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);
kvm-all.c +1 -1
@@ -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; } }
target-i386/cpu.h +15 -0
@@ -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 */
target-ppc/cpu.h +15 -0
@@ -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__) */
target-s390x/cpu.h +15 -0
@@ -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
target-s390x/kvm.c +1 -1
@@ -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;
Signature · 1 line
1.7.9.5