From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoshiaki Tamura Subject: Re: [PATCH 1/6] qemu-kvm: Introduce bit-based phys_ram_dirty for VGA, CODE and MIGRATION. Date: Tue, 16 Mar 2010 22:01:13 +0900 Message-ID: <4B9F8119.5040404@lab.ntt.co.jp> References: <1268736839-27371-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> <1268736839-27371-2-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> <4B9F7909.8010904@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, anthony@codemonkey.ws, ohmura.kei@lab.ntt.co.jp To: Avi Kivity Return-path: Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]:61000 "EHLO tama500.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755528Ab0CPNBf (ORCPT ); Tue, 16 Mar 2010 09:01:35 -0400 In-Reply-To: <4B9F7909.8010904@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > On 03/16/2010 12:53 PM, Yoshiaki Tamura wrote: >> Replaces byte-based phys_ram_dirty bitmap with >> three bit-based phys_ram_dirty bitmap. >> On allocation, it sets all bits in the bitmap. >> >> Signed-off-by: Yoshiaki Tamura >> Signed-off-by: OHMURA Kei >> --- >> exec.c | 22 +++++++++++++++++----- >> 1 files changed, 17 insertions(+), 5 deletions(-) >> >> diff --git a/exec.c b/exec.c >> index 9bcb4de..ba334e7 100644 >> --- a/exec.c >> +++ b/exec.c >> @@ -119,7 +119,9 @@ uint8_t *code_gen_ptr; >> >> #if !defined(CONFIG_USER_ONLY) >> int phys_ram_fd; >> -uint8_t *phys_ram_dirty; >> +unsigned long *phys_ram_vga_dirty; >> +unsigned long *phys_ram_code_dirty; >> +unsigned long *phys_ram_migration_dirty; > > Would be nice to make this an array. Thanks for pointing out. I have a question regarding the index of the array. From the compatibility perspective, I would prefer using the existing macros. #define VGA_DIRTY_FLAG 0x01 #define CODE_DIRTY_FLAG 0x02 #define MIGRATION_DIRTY_FLAG 0x08 However, if I use them as is, I'll get a sparse array... Is it acceptable to change these values like 0, 1, 2?