From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJ1QR-0002Bh-3s for qemu-devel@nongnu.org; Fri, 22 Mar 2013 08:50:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJ1QL-0006fk-Ty for qemu-devel@nongnu.org; Fri, 22 Mar 2013 08:50:27 -0400 Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]:61854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJ1QL-0006fS-Lz for qemu-devel@nongnu.org; Fri, 22 Mar 2013 08:50:21 -0400 Received: by mail-la0-f41.google.com with SMTP id fo12so7213921lab.14 for ; Fri, 22 Mar 2013 05:50:20 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20130322122227.GB30604@stefanha-thinkpad.redhat.com> References: <1363329121-20625-1-git-send-email-hutao@cn.fujitsu.com> <20130322122227.GB30604@stefanha-thinkpad.redhat.com> From: Peter Maydell Date: Fri, 22 Mar 2013 12:50:00 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] memory: fix a bug of detection of memory region collision List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-trivial@nongnu.org, Hu Tao , qemu-devel@nongnu.org On 22 March 2013 12:22, Stefan Hajnoczi 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