From patchwork Tue Feb 2 08:18:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 76311 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o128JaBp029734 for ; Tue, 2 Feb 2010 08:19:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754532Ab0BBITf (ORCPT ); Tue, 2 Feb 2010 03:19:35 -0500 Received: from david.siemens.de ([192.35.17.14]:15536 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753516Ab0BBITe (ORCPT ); Tue, 2 Feb 2010 03:19:34 -0500 Received: from mail2.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o128JDvk019426; Tue, 2 Feb 2010 09:19:13 +0100 Received: from localhost.localdomain ([139.25.173.39]) by mail2.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o128J7sQ008551; Tue, 2 Feb 2010 09:19:12 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, Anthony Liguori , Alexander Graf , Glauber Costa , qemu-devel@nongnu.org Subject: [PATCH 10/21] KVM: Move and rename regs_modified Date: Tue, 2 Feb 2010 09:18:56 +0100 Message-Id: <6e4b4829232469aaaaaaad802ee3ae415c3dac51.1265098707.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: References: In-Reply-To: References: Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 02 Feb 2010 08:19:37 +0000 (UTC) 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); }