From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgCWU-0001hk-La for qemu-devel@nongnu.org; Sat, 25 May 2013 07:20:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UgCWR-0005W0-Mv for qemu-devel@nongnu.org; Sat, 25 May 2013 07:20:30 -0400 Received: from mail-ea0-x232.google.com ([2a00:1450:4013:c01::232]:51022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgCWR-0005VN-FQ for qemu-devel@nongnu.org; Sat, 25 May 2013 07:20:27 -0400 Received: by mail-ea0-f178.google.com with SMTP id q16so3175759ead.9 for ; Sat, 25 May 2013 04:20:26 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51A09E6F.7030109@redhat.com> Date: Sat, 25 May 2013 13:20:15 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1369133851-1894-1-git-send-email-pbonzini@redhat.com> <1369133851-1894-18-git-send-email-pbonzini@redhat.com> <51A05CDF.1090106@web.de> <51A06C9B.5060302@redhat.com> <51A09018.7000901@web.de> In-Reply-To: <51A09018.7000901@web.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, David Gibson Il 25/05/2013 12:19, Jan Kiszka ha scritto: > addr -= section->offset_within_address_space; > - len = MIN(section->size - addr, len); ^^^^^^^^^^^^^ ^^^^ This is the size of a section minus an offset in the section. > + diff = int128_sub(section->mr->size, int128_make64(addr)); ^^^^^^^^^^^^^^^^^ ^^^^ This is the size of a region minus the same offset in the section. > + len = MIN(int128_get64(diff), len); > > /* Compute offset within MemoryRegion */ > addr += section->offset_within_region; So this has to be moved above. Do you have a branch pushed somewhere that I can test against? Paolo