From patchwork Thu Jan 10 15:28:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason J. Herne" X-Patchwork-Id: 211084 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 D1DE92C0348 for ; Fri, 11 Jan 2013 03:37:56 +1100 (EST) Received: from localhost ([::1]:42758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtK4T-0006Rv-9q for incoming@patchwork.ozlabs.org; Thu, 10 Jan 2013 10:29:33 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtK3v-0005Dj-7D for qemu-devel@nongnu.org; Thu, 10 Jan 2013 10:29:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtK3l-0007qQ-E1 for qemu-devel@nongnu.org; Thu, 10 Jan 2013 10:28:59 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:58190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtK3l-0007nR-7X for qemu-devel@nongnu.org; Thu, 10 Jan 2013 10:28:49 -0500 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 Jan 2013 10:28:41 -0500 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e7.ny.us.ibm.com (192.168.1.107) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 10 Jan 2013 10:28:38 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 9153538C8026 for ; Thu, 10 Jan 2013 10:28:38 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0AFScLE284804 for ; Thu, 10 Jan 2013 10:28:38 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0AFSbfm026975 for ; Thu, 10 Jan 2013 10:28:38 -0500 Received: from w500-1204.endicott.ibm.com (w500-1204.endicott.ibm.com [9.60.75.168] (may be forged)) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r0AFSbsV026939; Thu, 10 Jan 2013 10:28:37 -0500 From: "Jason J. Herne" 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 Date: Thu, 10 Jan 2013 10:28:36 -0500 Message-Id: <1357831717-3851-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: 13011015-5806-0000-0000-00001E0EFA10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.182.137 Cc: "Jason J. Herne" Subject: [Qemu-devel] [PATCH 1/7 v2] 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 | 6 +++--- kvm-all.c | 6 +++--- target-i386/kvm.c | 8 ++++---- target-ppc/kvm.c | 4 ++-- target-s390x/kvm.c | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 3db19ff..6756e16 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -168,11 +168,11 @@ int kvm_arch_process_async_events(CPUState *cpu); int kvm_arch_get_registers(CPUState *cpu); /* 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_put_registers(CPUState *cpu, int level); diff --git a/kvm-all.c b/kvm-all.c index fc0c6e7..aa58b74 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1512,7 +1512,7 @@ void kvm_cpu_synchronize_post_reset(CPUArchState *env) { CPUState *cpu = ENV_GET_CPU(env); - kvm_arch_put_registers(cpu, KVM_PUT_RESET_STATE); + kvm_arch_put_registers(cpu, KVM_REGSYNC_RESET_STATE); cpu->kvm_vcpu_dirty = false; } @@ -1520,7 +1520,7 @@ void kvm_cpu_synchronize_post_init(CPUArchState *env) { CPUState *cpu = ENV_GET_CPU(env); - kvm_arch_put_registers(cpu, KVM_PUT_FULL_STATE); + kvm_arch_put_registers(cpu, KVM_REGSYNC_FULL_STATE); cpu->kvm_vcpu_dirty = false; } @@ -1539,7 +1539,7 @@ int kvm_cpu_exec(CPUArchState *env) do { if (cpu->kvm_vcpu_dirty) { - kvm_arch_put_registers(cpu, KVM_PUT_RUNTIME_STATE); + kvm_arch_put_registers(cpu, KVM_REGSYNC_RUNTIME_STATE); cpu->kvm_vcpu_dirty = false; } diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 3acff40..fc84922 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -1049,7 +1049,7 @@ static int kvm_put_msrs(X86CPU *cpu, 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 @@ -1065,7 +1065,7 @@ static int kvm_put_msrs(X86CPU *cpu, 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); @@ -1504,7 +1504,7 @@ static int kvm_put_vcpu_events(X86CPU *cpu, 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; } @@ -1653,7 +1653,7 @@ int kvm_arch_put_registers(CPUState *cpu, int level) if (ret < 0) { return ret; } - if (level >= KVM_PUT_RESET_STATE) { + if (level >= KVM_REGSYNC_RESET_STATE) { ret = kvm_put_mp_state(x86_cpu); if (ret < 0) { return ret; diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 436ca47..f705b4c 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -489,7 +489,7 @@ int kvm_arch_put_registers(CPUState *cs, 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]; @@ -524,7 +524,7 @@ int kvm_arch_put_registers(CPUState *cs, 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 6ec5e6d..e7b5ad9 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -117,7 +117,7 @@ int kvm_arch_put_registers(CPUState *cs, int level) } /* Do we need to save more than that? */ - if (level == KVM_PUT_RUNTIME_STATE) { + if (level == KVM_REGSYNC_RUNTIME_STATE) { return 0; }