From patchwork Wed Feb 3 23:55:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 76866 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 o13Nvf0g015048 for ; Wed, 3 Feb 2010 23:57:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757976Ab0BCX5i (ORCPT ); Wed, 3 Feb 2010 18:57:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35169 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932917Ab0BCX5g (ORCPT ); Wed, 3 Feb 2010 18:57:36 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o13NvMTj005204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Feb 2010 18:57:22 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o13NvKJ4023092; Wed, 3 Feb 2010 18:57:20 -0500 Received: from amt.cnet (vpn-9-161.rdu.redhat.com [10.11.9.161]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o13NvJWX026851; Wed, 3 Feb 2010 18:57:19 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id C005468A8F2; Wed, 3 Feb 2010 21:56:33 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o13NuUmR013150; Wed, 3 Feb 2010 21:56:30 -0200 From: Marcelo Tosatti To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Jan Kiszka Subject: [PATCH 5/6] KVM: Move and rename regs_modified Date: Wed, 3 Feb 2010 21:55:50 -0200 Message-Id: <9ded2744667292d020455f51664eb161a449c243.1265241351.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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 23:57:41 +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 f8350c9..6c0fd37 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; #ifdef KVM_CAP_COALESCED_MMIO struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; @@ -574,9 +573,9 @@ void kvm_flush_coalesced_mmio_buffer(void) 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; } } @@ -594,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); @@ -946,9 +945,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); }