qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 3/5] migration: Teach dirtyrate about qemu_target_page_siz


From: Juan Quintela
Subject: Re: [PATCH v2 3/5] migration: Teach dirtyrate about qemu_target_page_size()
Date: Thu, 11 May 2023 21:16:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]