From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZINu7-0006tK-06 for qemu-devel@nongnu.org; Thu, 23 Jul 2015 17:19:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZINu1-0007ML-RH for qemu-devel@nongnu.org; Thu, 23 Jul 2015 17:19:46 -0400 Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:35520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZINu1-0007M6-LT for qemu-devel@nongnu.org; Thu, 23 Jul 2015 17:19:41 -0400 Received: by qkbm65 with SMTP id m65so3338126qkb.2 for ; Thu, 23 Jul 2015 14:19:41 -0700 (PDT) Sender: Richard Henderson References: <1436974021-28978-1-git-send-email-pbonzini@redhat.com> From: Richard Henderson Message-ID: <55B15A69.2000004@twiddle.net> Date: Thu, 23 Jul 2015 14:19:37 -0700 MIME-Version: 1.0 In-Reply-To: <1436974021-28978-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/2] tcg: aarch64: use 32-bit offset for 32-bit user-mode emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: claudio.fontana@huawei.com, aurelien@aurel32.net On 07/15/2015 08:26 AM, Paolo Bonzini wrote: > The register allocator may sometimes pass a 64-bit value to a 32-bit > operation if truncations are considered no-ops by the backend. > When this happens, user-mode emulation may use an incorrect offset > for loads and stores. This affects aarch64 and x86, because other > architectures already zero-extend the offset before using it for a > load or store. > > To fix this for aarch64, use the uxtw modifier on load and store > instructions. > > Paolo > > Paolo Bonzini (2): > tcg: aarch64: add ext argument to tcg_out_insn_3310 > tcg: aarch64: use 32-bit offset for 32-bit user-mode emulation > > tcg/aarch64/tcg-target.c | 63 +++++++++++++++++++++++++++--------------------- > 1 file changed, 36 insertions(+), 27 deletions(-) > Applied to tcg-for-2.4. r~