All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org,
	anthony@codemonkey.ws, aliguori@us.ibm.com, mtosatti@redhat.com,
	ohmura.kei@lab.ntt.co.jp
Subject: Re: [PATCH v2 2/6] Introduce bit-based phys_ram_dirty for VGA, CODE, MIGRATION and MASTER.
Date: Mon, 12 Apr 2010 13:17:25 +0300	[thread overview]
Message-ID: <4BC2F335.5010702@redhat.com> (raw)
In-Reply-To: <4BC2EA64.6060700@lab.ntt.co.jp>

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.


WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Cc: aliguori@us.ibm.com, kvm@vger.kernel.org,
	ohmura.kei@lab.ntt.co.jp, mtosatti@redhat.com,
	qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH v2 2/6] Introduce bit-based phys_ram_dirty for VGA, CODE, MIGRATION and MASTER.
Date: Mon, 12 Apr 2010 13:17:25 +0300	[thread overview]
Message-ID: <4BC2F335.5010702@redhat.com> (raw)
In-Reply-To: <4BC2EA64.6060700@lab.ntt.co.jp>

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.

  reply	other threads:[~2010-04-12 10:17 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06  0:51 [PATCH v2 0/6] Introduce bit-based phys_ram_dirty, and bit-based dirty page checker Yoshiaki Tamura
2010-04-06  0:51 ` [Qemu-devel] " Yoshiaki Tamura
2010-04-06  0:51 ` [PATCH v2 1/6] Modify DIRTY_FLAG value to use as indexes of bit-based phys_ram_dirty Yoshiaki Tamura
2010-04-06  0:51   ` [Qemu-devel] " Yoshiaki Tamura
2010-04-06  0:51 ` [PATCH v2 2/6] Introduce bit-based phys_ram_dirty for VGA, CODE, MIGRATION and MASTER Yoshiaki Tamura
2010-04-06  0:51   ` [Qemu-devel] " Yoshiaki Tamura
2010-04-12  8:01   ` Avi Kivity
2010-04-12  8:01     ` [Qemu-devel] " Avi Kivity
2010-04-12  9:39     ` Yoshiaki Tamura
2010-04-12  9:39       ` [Qemu-devel] " Yoshiaki Tamura
2010-04-12 10:17       ` Avi Kivity [this message]
2010-04-12 10:17         ` Avi Kivity
2010-04-06  0:51 ` [PATCH v2 3/6] Modifies wrapper functions for byte-based phys_ram_dirty bitmap to bit-based phys_ram_dirty bitmap Yoshiaki Tamura
2010-04-06  0:51   ` [Qemu-devel] " Yoshiaki Tamura
2010-04-12  8:10   ` Avi Kivity
2010-04-12  8:10     ` [Qemu-devel] " Avi Kivity
2010-04-12 10:58     ` Yoshiaki Tamura
2010-04-12 10:58       ` [Qemu-devel] " Yoshiaki Tamura
2010-04-12 11:09       ` Avi Kivity
2010-04-12 11:09         ` [Qemu-devel] " Avi Kivity
2010-04-13  8:01         ` Yoshiaki Tamura
2010-04-13  8:01           ` [Qemu-devel] " Yoshiaki Tamura
2010-04-13  9:20           ` Avi Kivity
2010-04-13  9:20             ` [Qemu-devel] " Avi Kivity
2010-04-13 10:49             ` Yoshiaki Tamura
2010-04-13 10:49               ` [Qemu-devel] " Yoshiaki Tamura
2010-04-06  0:51 ` [PATCH v2 4/6] Introduce cpu_physical_memory_get_dirty_range() Yoshiaki Tamura
2010-04-06  0:51   ` [Qemu-devel] " Yoshiaki Tamura
2010-04-06  0:51 ` [PATCH v2 5/6] Use cpu_physical_memory_set_dirty_range() to update phys_ram_dirty Yoshiaki Tamura
2010-04-06  0:51   ` [Qemu-devel] " Yoshiaki Tamura
2010-04-06  0:51 ` [PATCH v2 6/6] Use cpu_physical_memory_get_dirty_range() to check multiple dirty pages Yoshiaki Tamura
2010-04-06  0:51   ` [Qemu-devel] " Yoshiaki Tamura

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BC2F335.5010702@redhat.com \
    --to=avi@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=ohmura.kei@lab.ntt.co.jp \
    --cc=qemu-devel@nongnu.org \
    --cc=tamura.yoshiaki@lab.ntt.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.