qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH] memory: fix a bug of detection o


From: Peter Maydell
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] memory: fix a bug of detection of memory region collision
Date: Fri, 22 Mar 2013 12:50:00 +0000

On 22 March 2013 12:22, Stefan Hajnoczi <address@hidden> wrote:
> The int128_le() comparison below suggests that int128_gt() really should
> be int128_ge().

Agreed. It might be clearer to rephrase as:

 AddrRange thisrange = addrrange_make(int128_make64(offset),
                                      int128_make64(subregion->size));

 QTAILQ_FOREACH(....) {
     [...]
     AddrRange otherrange = addrrange_make(int128_make64(other->addr),
                                           int128_make64(other->size));
     if (!addrrange_intersects(thisrange, otherrange)) {
         continue;
     }
     [...]
 }

(maybe with a new utility addrrange_make_64() that takes uint64_ts;
there are a few other places in memory.c that could use it.)

-- PMM



reply via email to

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