From patchwork Wed Feb 3 21:29:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 76819 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 o13LUJuI014984 for ; Wed, 3 Feb 2010 21:30:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932622Ab0BCVaP (ORCPT ); Wed, 3 Feb 2010 16:30:15 -0500 Received: from goliath.siemens.de ([192.35.17.28]:21964 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932329Ab0BCVaK (ORCPT ); Wed, 3 Feb 2010 16:30:10 -0500 Received: from mail2.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o13LTlVH013384; Wed, 3 Feb 2010 22:29:47 +0100 Received: from localhost.localdomain ([139.25.173.3]) by mail2.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o13LTjGv031176; Wed, 3 Feb 2010 22:29:46 +0100 From: Jan Kiszka To: Anthony Liguori Cc: qemu-devel@nongnu.org, Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org Subject: [PATCH 3/4] KVM: Move and rename regs_modified Date: Wed, 3 Feb 2010 22:29:44 +0100 Message-Id: <9f39dff4178a33fa83c03273ecb767447a95f538.1265232579.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]); Wed, 03 Feb 2010 21:30:20 +0000 (UTC) diff --git a/cpu-defs.h b/cpu-defs.h index 95068b5..7fdbe97 100644 --- a/cpu-defs.h +++ b/cpu-defs.h @@ -197,6 +197,7 @@ typedef struct CPUWatchpoint { const char *cpu_model_str; \ struct KVMState *kvm_state; \ struct kvm_run *kvm_run; \ - int kvm_fd; + int kvm_fd; \ + int kvm_vcpu_dirty; #endif diff --git a/kvm-all.c b/kvm-all.c index 15ec38e..67b44b5 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -57,7 +57,6 @@ struct KVMState KVMSlot slots[32]; int fd; int vmfd; - int regs_modified; int coalesced_mmio; int broken_set_mem_region; int migration_log; @@ -567,9 +566,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; } } @@ -587,9 +586,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); @@ -939,9 +938,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); }