From patchwork Tue Dec 6 15:11:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 86856 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp2067353qgi; Tue, 6 Dec 2016 07:15:56 -0800 (PST) X-Received: by 10.55.99.200 with SMTP id x191mr64314028qkb.62.1481037355954; Tue, 06 Dec 2016 07:15:55 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id 82si1833103qks.109.2016.12.06.07.15.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 06 Dec 2016 07:15:55 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:60905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEHTH-0002oi-D1 for patch@linaro.org; Tue, 06 Dec 2016 10:15:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEHQe-0008Lk-Eb for qemu-devel@nongnu.org; Tue, 06 Dec 2016 10:13:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cEHQV-0000eL-0q for qemu-devel@nongnu.org; Tue, 06 Dec 2016 10:13:12 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:35056) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cEHQU-0000cl-QT for qemu-devel@nongnu.org; Tue, 06 Dec 2016 10:13:02 -0500 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1cEHQT-0006je-0J from Julian_Brown@mentor.com ; Tue, 06 Dec 2016 07:13:01 -0800 Received: from squid.athome (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 6 Dec 2016 15:12:02 +0000 Date: Tue, 6 Dec 2016 15:11:54 +0000 From: Julian Brown To: Paolo Bonzini Message-ID: <20161206151154.71c69b41@squid.athome> In-Reply-To: <55f516cd-7050-1e4a-139c-84012418c683@redhat.com> References: <1478194258-75276-1-git-send-email-julian@codesourcery.com> <1478194258-75276-4-git-send-email-julian@codesourcery.com> <55f516cd-7050-1e4a-139c-84012418c683@redhat.com> Organization: Mentor Graphics X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Originating-IP: [137.202.0.87] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 Subject: Re: [Qemu-devel] [PATCH 3/5] Fix arm_semi_flen_cb for BE32 system mode. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" On Fri, 4 Nov 2016 10:00:19 +0100 Paolo Bonzini wrote: > On 03/11/2016 18:30, Julian Brown wrote: > > +#ifdef CONFIG_USER_ONLY > > size = be32_to_cpu(size); > > +#else > > + /* If we're running in BE32 system mode, we don't need to do > > an explicit > > + * byte swap, because (I think) target memory is already > > stored in > > + * byte-swapped format. > > Isn't this true also of user-mode (both BE8 and BE32)? I'm not sure, I don't think the "load-time" byteswapping affects user mode in the same way. Anyway, this can be refactored as attached, which looks a bit more plausible perhaps. Thanks, Julian >From 0e5d7e43404250900bfea3f8dc21fefa59069190 Mon Sep 17 00:00:00 2001 From: Julian Brown Date: Thu, 6 Oct 2016 04:02:08 -0700 Subject: [PATCH 4/4] Fix arm_semi_flen_cb for BE32 system mode. This patch fixes the arm_semi_flen_cb callback so that it doesn't return a byte-swapped size in BE32 system mode. --- target-arm/arm-semi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-arm/arm-semi.c b/target-arm/arm-semi.c index a9cf5f2..1ad1e63 100644 --- a/target-arm/arm-semi.c +++ b/target-arm/arm-semi.c @@ -187,7 +187,7 @@ static void arm_semi_flen_cb(CPUState *cs, target_ulong ret, target_ulong err) /* The size is always stored in big-endian order, extract the value. We assume the size always fit in 32 bits. */ uint32_t size; - cpu_memory_rw_debug(cs, arm_flen_buf(cpu) + 32, (uint8_t *)&size, 4, 0); + armsemi_memory_rw_debug(cs, arm_flen_buf(cpu) + 32, (uint8_t *)&size, 4, 0); size = be32_to_cpu(size); if (is_a64(env)) { env->xregs[0] = size; -- 1.9.1