Philippe Mathieu-Daudé <phi...@linaro.org> wrote:
> On 11/5/23 16:12, Juan Quintela wrote:
>> Signed-off-by: Juan Quintela <quint...@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é <phi...@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