From patchwork Wed Feb 3 08:53:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 44358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3069FB7D4B for ; Wed, 3 Feb 2010 20:19:11 +1100 (EST) Received: from localhost ([127.0.0.1]:56983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcbO6-0000Ot-N9 for incoming@patchwork.ozlabs.org; Wed, 03 Feb 2010 04:19:06 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ncazy-00021D-GI for qemu-devel@nongnu.org; Wed, 03 Feb 2010 03:54:11 -0500 Received: from [199.232.76.173] (port=56386 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ncazw-0001zS-V5 for qemu-devel@nongnu.org; Wed, 03 Feb 2010 03:54:09 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ncazl-00078z-FG for qemu-devel@nongnu.org; Wed, 03 Feb 2010 03:54:08 -0500 Received: from mx20.gnu.org ([199.232.41.8]:46399) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ncazk-00078B-PQ for qemu-devel@nongnu.org; Wed, 03 Feb 2010 03:53:56 -0500 Received: from goliath.siemens.de ([192.35.17.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ncazi-0001Mk-Hv for qemu-devel@nongnu.org; Wed, 03 Feb 2010 03:53:54 -0500 Received: from mail3.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o138rrrq013730; Wed, 3 Feb 2010 09:53:53 +0100 Received: from localhost.localdomain ([139.25.173.28]) by mail3.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o138rkCB012112; Wed, 3 Feb 2010 09:53:52 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Wed, 3 Feb 2010 09:53:35 +0100 Message-Id: <52e855c88df8326d8a8f78f39dd8030e993b798b.1265187223.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.4-2.6 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Anthony Liguori , Glauber Costa , Alexander Graf , kvm@vger.kernel.org, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH v2 10/21] KVM: Move and rename regs_modified X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Touching the user space representation of KVM's VCPU state is - naturally - a per-VCPU thing. So move the dirty flag into KVM_CPU_COMMON and rename it at this chance to reflect its true meaning. Signed-off-by: Jan Kiszka --- cpu-defs.h | 1 + kvm-all.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cpu-defs.h b/cpu-defs.h index cf502e9..49a9e8d 100644 --- a/cpu-defs.h +++ b/cpu-defs.h @@ -208,6 +208,7 @@ struct KVMCPUState { struct KVMState *kvm_state; \ struct kvm_run *kvm_run; \ int kvm_fd; \ + int kvm_vcpu_dirty; \ uint32_t stop; /* Stop request */ \ uint32_t stopped; /* Artificially stopped */ \ struct KVMCPUState kvm_cpu_state; diff --git a/kvm-all.c b/kvm-all.c index 6cbca97..3516f01 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -573,9 +573,9 @@ static void kvm_run_coalesced_mmio(CPUState *env, struct kvm_run *run) void kvm_cpu_synchronize_state(CPUState *env) { - if (!env->kvm_state->regs_modified) { + if (!env->kvm_vcpu_dirty) { kvm_arch_get_registers(env); - env->kvm_state->regs_modified = 1; + env->kvm_vcpu_dirty = 1; } } @@ -593,9 +593,9 @@ int kvm_cpu_exec(CPUState *env) break; } - if (env->kvm_state->regs_modified) { + if (env->kvm_vcpu_dirty) { kvm_arch_put_registers(env); - env->kvm_state->regs_modified = 0; + env->kvm_vcpu_dirty = 0; } kvm_arch_pre_run(env, run); @@ -951,9 +951,9 @@ static void kvm_invoke_set_guest_debug(void *data) struct kvm_set_guest_debug_data *dbg_data = data; CPUState *env = dbg_data->env; - if (env->kvm_state->regs_modified) { + if (env->kvm_vcpu_dirty) { kvm_arch_put_registers(env); - env->kvm_state->regs_modified = 0; + env->kvm_vcpu_dirty = 0; } dbg_data->err = kvm_vcpu_ioctl(env, KVM_SET_GUEST_DEBUG, &dbg_data->dbg); }