qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] migration: check length directly to make sure t


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] migration: check length directly to make sure the range is aligned
Date: Fri, 19 Jul 2019 20:03:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 19/07/19 19:54, Dr. David Alan Gilbert wrote:
>> -        if ((uintptr_t)host_endaddr & (rb->page_size - 1)) {
>> -            error_report("ram_block_discard_range: Unaligned end address: 
>> %p",
>> -                         host_endaddr);
>> +        if (length & (rb->page_size - 1)) {
>> +            error_report("ram_block_discard_range: Unaligned length: %lx",
>> +                         length);
> Yes, I *think* this is safe, we'll need to watch out for any warnings;

Do you mean compiler or QEMU warning?  The patch is safe since there's an

    if ((uintptr_t)host_startaddr & (rb->page_size - 1)) {
        error_report("ram_block_discard_range: Unaligned start address: %p",
                     host_startaddr);
        goto err;
    }

just before this context.

Paolo



reply via email to

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