From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Md9Bz-0003Wb-8z for qemu-devel@nongnu.org; Mon, 17 Aug 2009 16:52:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Md9Bu-0003S9-EQ for qemu-devel@nongnu.org; Mon, 17 Aug 2009 16:52:34 -0400 Received: from [199.232.76.173] (port=60492 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Md9Bu-0003Rt-9x for qemu-devel@nongnu.org; Mon, 17 Aug 2009 16:52:30 -0400 Received: from mail.gmx.net ([213.165.64.20]:45853) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Md9Bs-0007F8-VU for qemu-devel@nongnu.org; Mon, 17 Aug 2009 16:52:29 -0400 Date: Mon, 17 Aug 2009 22:52:26 +0200 From: Reimar =?iso-8859-1?Q?D=F6ffinger?= Subject: Re: [Qemu-devel] [PATCH] kvm: Simplify cpu_synchronize_state() Message-ID: <20090817205226.GA13129@1und1.de> References: <1250540393-3998-1-git-send-email-avi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1250540393-3998-1-git-send-email-avi@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org On Mon, Aug 17, 2009 at 11:19:53PM +0300, Avi Kivity wrote: > diff --git a/kvm-all.c b/kvm-all.c > index f669c3a..15c30d4 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -57,6 +57,7 @@ struct KVMState > KVMSlot slots[32]; > int fd; > int vmfd; > + int regs_modified; > int coalesced_mmio; > int broken_set_mem_region; > int migration_log; I think regs_modified is a really bad name since it has nothing at all to do with whether the registers were modified. IMO it actually indicates if the register copy in the KVM or in CPUState is valid. So maybe cpustate_regs_valid is a more straight-forward name? (implying that when the cpustate regs are valid, the kvm ones probably aren't - though the way qemu access registers we can't know). One disadvantage is that code that only needs to read registers will now uselessly do kvm_arch_put_registers. A fancy way to do it would be to add a "mode" flag indicating if we only want read or read-write access to registers, but since we can't enforce that it might be a bad idea.