From patchwork Fri Dec 21 13:55:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason J. Herne" X-Patchwork-Id: 207812 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 785BD2C0094 for ; Sat, 22 Dec 2012 00:56:17 +1100 (EST) Received: from localhost ([::1]:38805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm35D-0001EE-P2 for incoming@patchwork.ozlabs.org; Fri, 21 Dec 2012 08:56:15 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm34y-0001Dh-9w for qemu-devel@nongnu.org; Fri, 21 Dec 2012 08:56:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm34u-0004bs-44 for qemu-devel@nongnu.org; Fri, 21 Dec 2012 08:56:00 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:53474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm34t-0004Ys-RO for qemu-devel@nongnu.org; Fri, 21 Dec 2012 08:55:56 -0500 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Dec 2012 06:55:53 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Dec 2012 06:55:52 -0700 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 535283E4004E for ; Fri, 21 Dec 2012 06:55:47 -0700 (MST) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qBLDton7223134 for ; Fri, 21 Dec 2012 06:55:50 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qBLDtmKj027139 for ; Fri, 21 Dec 2012 06:55:50 -0700 Received: from w500-1204.ibm.com (sig-9-49-152-5.mts.ibm.com [9.49.152.5]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id qBLDtkbE027000; Fri, 21 Dec 2012 06:55:46 -0700 From: "Jason J. Herne" 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 Date: Fri, 21 Dec 2012 08:55:45 -0500 Message-Id: <1356098145-4772-1-git-send-email-jjherne@us.ibm.com> X-Mailer: git-send-email 1.7.9.5 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12122113-7606-0000-0000-000006B03F38 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.110.154 Cc: "Jason J. Herne" Subject: [Qemu-devel] [PATCH 1/7] KVM regsync: Rename KVM_PUT_ constants to KVM_REGSYNC_ X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Jason J. Herne" It makes sense to rename these to KVM_REGSYNC in order to use them for specifying a register level parameter for both kvm_arch_put_registers and kvm_arch_get_registers. Signed-off-by: Jason J. Herne Reviewed-by: Christian Borntraeger --- include/sysemu/kvm.h | 10 +++++----- kvm-all.c | 6 +++--- target-i386/kvm.c | 8 ++++---- target-ppc/kvm.c | 4 ++-- target-s390x/kvm.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 131d2bd..4271699 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -165,14 +165,14 @@ int kvm_arch_handle_exit(CPUArchState *env, struct kvm_run *run); int kvm_arch_process_async_events(CPUArchState *env); -int kvm_arch_get_registers(CPUArchState *env); - /* state subset only touched by the VCPU itself during runtime */ -#define KVM_PUT_RUNTIME_STATE 1 +#define KVM_REGSYNC_RUNTIME_STATE 1 /* state subset modified during VCPU reset */ -#define KVM_PUT_RESET_STATE 2 +#define KVM_REGSYNC_RESET_STATE 2 /* full state set, modified during initialization or on vmload */ -#define KVM_PUT_FULL_STATE 3 +#define KVM_REGSYNC_FULL_STATE 3 + +int kvm_arch_get_registers(CPUArchState *env); int kvm_arch_put_registers(CPUArchState *env, int level); diff --git a/kvm-all.c b/kvm-all.c index 5aa65c4..f4365de 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1507,13 +1507,13 @@ void kvm_cpu_synchronize_state(CPUArchState *env) void kvm_cpu_synchronize_post_reset(CPUArchState *env) { - kvm_arch_put_registers(env, KVM_PUT_RESET_STATE); + kvm_arch_put_registers(env, KVM_REGSYNC_RESET_STATE); env->kvm_vcpu_dirty = 0; } void kvm_cpu_synchronize_post_init(CPUArchState *env) { - kvm_arch_put_registers(env, KVM_PUT_FULL_STATE); + kvm_arch_put_registers(env, KVM_REGSYNC_FULL_STATE); env->kvm_vcpu_dirty = 0; } @@ -1531,7 +1531,7 @@ int kvm_cpu_exec(CPUArchState *env) do { if (env->kvm_vcpu_dirty) { - kvm_arch_put_registers(env, KVM_PUT_RUNTIME_STATE); + kvm_arch_put_registers(env, KVM_REGSYNC_RUNTIME_STATE); env->kvm_vcpu_dirty = 0; } diff --git a/target-i386/kvm.c b/target-i386/kvm.c index f63b1fb..58ac3a8 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -1029,7 +1029,7 @@ static int kvm_put_msrs(CPUX86State *env, int level) kvm_msr_entry_set(&msrs[n++], MSR_LSTAR, env->lstar); } #endif - if (level == KVM_PUT_FULL_STATE) { + if (level == KVM_REGSYNC_FULL_STATE) { /* * KVM is yet unable to synchronize TSC values of multiple VCPUs on * writeback. Until this is fixed, we only write the offset to SMP @@ -1045,7 +1045,7 @@ static int kvm_put_msrs(CPUX86State *env, int level) * too heavy for normal writeback. Limit them to reset or full state * updates. */ - if (level >= KVM_PUT_RESET_STATE) { + if (level >= KVM_REGSYNC_RESET_STATE) { kvm_msr_entry_set(&msrs[n++], MSR_KVM_SYSTEM_TIME, env->system_time_msr); kvm_msr_entry_set(&msrs[n++], MSR_KVM_WALL_CLOCK, env->wall_clock_msr); @@ -1470,7 +1470,7 @@ static int kvm_put_vcpu_events(CPUX86State *env, int level) events.sipi_vector = env->sipi_vector; events.flags = 0; - if (level >= KVM_PUT_RESET_STATE) { + if (level >= KVM_REGSYNC_RESET_STATE) { events.flags |= KVM_VCPUEVENT_VALID_NMI_PENDING | KVM_VCPUEVENT_VALID_SIPI_VECTOR; } @@ -1615,7 +1615,7 @@ int kvm_arch_put_registers(CPUX86State *env, int level) if (ret < 0) { return ret; } - if (level >= KVM_PUT_RESET_STATE) { + if (level >= KVM_REGSYNC_RESET_STATE) { ret = kvm_put_mp_state(env); if (ret < 0) { return ret; diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 88650d4..f2e6eca 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -474,7 +474,7 @@ int kvm_arch_put_registers(CPUPPCState *env, int level) env->tlb_dirty = false; } - if (cap_segstate && (level >= KVM_PUT_RESET_STATE)) { + if (cap_segstate && (level >= KVM_REGSYNC_RESET_STATE)) { struct kvm_sregs sregs; sregs.pvr = env->spr[SPR_PVR]; @@ -509,7 +509,7 @@ int kvm_arch_put_registers(CPUPPCState *env, int level) } } - if (cap_hior && (level >= KVM_PUT_RESET_STATE)) { + if (cap_hior && (level >= KVM_REGSYNC_RESET_STATE)) { uint64_t hior = env->spr[SPR_HIOR]; struct kvm_one_reg reg = { .id = KVM_REG_PPC_HIOR, diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 762231d..5a845c3 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -115,7 +115,7 @@ int kvm_arch_put_registers(CPUS390XState *env, int level) } /* Do we need to save more than that? */ - if (level == KVM_PUT_RUNTIME_STATE) { + if (level == KVM_REGSYNC_RUNTIME_STATE) { return 0; }