From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1Gi6-0007OO-1l for qemu-devel@nongnu.org; Mon, 12 Apr 2010 06:17:42 -0400 Received: from [140.186.70.92] (port=54755 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1Gi2-0007Nx-WB for qemu-devel@nongnu.org; Mon, 12 Apr 2010 06:17:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1Gi0-0005xv-Se for qemu-devel@nongnu.org; Mon, 12 Apr 2010 06:17:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34567) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1Gi0-0005xX-Kd for qemu-devel@nongnu.org; Mon, 12 Apr 2010 06:17:36 -0400 Message-ID: <4BC2F335.5010702@redhat.com> Date: Mon, 12 Apr 2010 13:17:25 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1270515084-24120-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> <1270515084-24120-3-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> <4BC2D340.2030402@redhat.com> <4BC2EA64.6060700@lab.ntt.co.jp> In-Reply-To: <4BC2EA64.6060700@lab.ntt.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v2 2/6] Introduce bit-based phys_ram_dirty for VGA, CODE, MIGRATION and MASTER. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yoshiaki Tamura Cc: aliguori@us.ibm.com, kvm@vger.kernel.org, ohmura.kei@lab.ntt.co.jp, mtosatti@redhat.com, qemu-devel@nongnu.org On 04/12/2010 12:39 PM, Yoshiaki Tamura wrote: >> Please put in some header file, maybe qemu-common.h. > > > OK. BTW, is qemu-kvm.h planned to go upstream? No. Use kvm.h for kvm specific symbols (qemu-kvm.h includes it). >> >> Should be nicer as a loop calling a helper to allocate each bitmap. This >> patch won't work by itself, will it? I think you need to merge it with >> the succeeding patches. > > Yeah. I originally wrote as you suggested, but I needed to skip 0x03 > because of the reason written below. > >> +/* Use DIRTY_FLAG as indexes of bit-based phys_ram_dirty. >> + 0x03 is empty to make it compatible with byte-based bitmap. */ >> +#define MASTER_DIRTY_FLAG 0x00 >> #define VGA_DIRTY_FLAG 0x01 >> #define CODE_DIRTY_FLAG 0x02 >> -#define MIGRATION_DIRTY_FLAG 0x08 >> +#define MIGRATION_DIRTY_FLAG 0x04 > > If you think if (i != 0x03) is better, I would modify it to a loop. You can have *_DIRTY_FLAG (1, 2, 4, 8) and *_DIRTY_IDX (0, 1, 2, 3); use _FLAG for compatibility with byte-based maps, and _IDX for multiple bitmaps. Alternatively, have only _IDX, and modify the callers to shift when necessary. At the end of the patchset, we'll only use bitmaps, so the shifts will be all gone. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.