All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org,  David Hildenbrand <david@redhat.com>,
	 Leonardo Bras <leobras@redhat.com>,
	 Richard Henderson <richard.henderson@linaro.org>,
	 Peter Xu <peterx@redhat.com>,
	 Andrei Gudkov <gudkov.andrei@huawei.com>,
	 Paolo Bonzini <pbonzini@redhat.com>,
	Zhenzhong Duan <zhenzhong.duan@intel.com>,
	 Hyman Huang <huangy81@chinatelecom.cn>
Subject: Re: [PATCH v2 3/5] migration: Teach dirtyrate about qemu_target_page_size()
Date: Thu, 11 May 2023 21:16:58 +0200	[thread overview]
Message-ID: <875y8y4r11.fsf@secure.mitica> (raw)
In-Reply-To: <da6c03af-fb68-4d30-5a9d-42b86c9b102d@linaro.org> ("Philippe Mathieu-Daudé"'s message of "Thu, 11 May 2023 20:56:19 +0200")

Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> On 11/5/23 16:12, Juan Quintela wrote:
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>>   migration/dirtyrate.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>> diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
>> index 38ea95af59..6706e3fe66 100644
>> --- a/migration/dirtyrate.c
>> +++ b/migration/dirtyrate.c
>> @@ -314,10 +314,10 @@ static void update_dirtyrate(uint64_t msec)
>>   static uint32_t get_ramblock_vfn_hash(struct RamblockDirtyInfo *info,
>>                                         uint64_t vfn)
>>   {
>> +    int page_size = qemu_target_page_size();
>
> size_t? Otherwise,

Nice catch.  Will change it.

Not that it matters in real life. The bigger value that
qemu_target_page_size() can give with current hardware is 64K, so
anything bigger than a short should work O:-)

>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
>>       uint32_t crc;
>>   -    crc = crc32(0, (info->ramblock_addr +
>> -                vfn * TARGET_PAGE_SIZE), TARGET_PAGE_SIZE);
>> +    crc = crc32(0, info->ramblock_addr + vfn * page_size, page_size);
>>         trace_get_ramblock_vfn_hash(info->idstr, vfn, crc);
>>       return crc;



  reply	other threads:[~2023-05-11 19:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 14:12 [PATCH v2 0/5] migration: Make dirtyrate.c target independent Juan Quintela
2023-05-11 14:12 ` [PATCH v2 1/5] softmmu: Create qemu_target_pages_to_MiB() Juan Quintela
2023-05-11 14:12 ` [PATCH v2 2/5] Use new created qemu_target_pages_to_MiB() Juan Quintela
2023-05-11 14:12 ` [PATCH v2 3/5] migration: Teach dirtyrate about qemu_target_page_size() Juan Quintela
2023-05-11 18:56   ` Philippe Mathieu-Daudé
2023-05-11 19:16     ` Juan Quintela [this message]
2023-05-11 14:12 ` [PATCH v2 4/5] migration: Teach dirtyrate about qemu_target_page_bits() Juan Quintela
2023-05-11 14:12 ` [PATCH v2 5/5] migration: Make dirtyrate.c target independent Juan Quintela
2023-05-11 18:58   ` Philippe Mathieu-Daudé
2023-05-11 17:16 ` [PATCH v2 0/5] " Richard Henderson

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=875y8y4r11.fsf@secure.mitica \
    --to=quintela@redhat.com \
    --cc=david@redhat.com \
    --cc=gudkov.andrei@huawei.com \
    --cc=huangy81@chinatelecom.cn \
    --cc=leobras@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=zhenzhong.duan@intel.com \
    /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.