QEMU-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Julian Brown <julian@codesourcery.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/5] Fix arm_semi_flen_cb for BE32 system mode.
Date: Tue, 6 Dec 2016 15:11:54 +0000	[thread overview]
Message-ID: <20161206151154.71c69b41@squid.athome> (raw)
In-Reply-To: <55f516cd-7050-1e4a-139c-84012418c683@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

On Fri, 4 Nov 2016 10:00:19 +0100
Paolo Bonzini <pbonzini@redhat.com> 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

[-- Attachment #2: 0004-Fix-arm_semi_flen_cb-for-BE32-system-mode.patch --]
[-- Type: text/x-patch, Size: 1064 bytes --]

>From 0e5d7e43404250900bfea3f8dc21fefa59069190 Mon Sep 17 00:00:00 2001
From: Julian Brown <julian@codesourcery.com>
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


  reply	other threads:[~2016-12-06 15:13 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 17:30 [Qemu-devel] [PATCH 0/5] ARM BE8/BE32 big-endian system-mode fixes (semihosting, gdbstub) Julian Brown
2016-11-03 17:30 ` [Qemu-devel] [PATCH 1/5] ARM BE8/BE32 semihosting and gdbstub support Julian Brown
2016-11-03 22:23   ` Peter Maydell
2016-11-03 23:34     ` Julian Brown
2016-11-04  8:48       ` Paolo Bonzini
2016-11-04 10:25         ` Julian Brown
2016-11-04 11:01           ` Paolo Bonzini
2016-11-04  9:03     ` Paolo Bonzini
2016-12-06 15:11     ` Julian Brown
2016-12-06 15:44       ` Peter Maydell
2016-12-06 15:51         ` Julian Brown
2016-12-06 16:14           ` Peter Maydell
2016-11-03 17:30 ` [Qemu-devel] [PATCH 2/5] Fix Thumb-1 BE32 execution and disassembly Julian Brown
2016-11-04 13:30   ` Peter Maydell
2016-11-04 14:04     ` Julian Brown
2016-12-06 15:12       ` Julian Brown
2016-11-03 17:30 ` [Qemu-devel] [PATCH 3/5] Fix arm_semi_flen_cb for BE32 system mode Julian Brown
2016-11-04  9:00   ` Paolo Bonzini
2016-12-06 15:11     ` Julian Brown [this message]
2016-11-03 17:30 ` [Qemu-devel] [PATCH 4/5] ARM BE32 watchpoint fix Julian Brown
2016-11-03 23:14   ` Peter Maydell
2016-11-03 23:20     ` Julian Brown
2016-11-04  8:55       ` Paolo Bonzini
2016-12-06 15:12         ` Julian Brown
2016-11-03 21:26 ` [Qemu-devel] [PATCH 5/5] Fix typo in arm_cpu_do_interrupt_aarch32 Julian Brown
2016-11-04 13:02   ` Peter Maydell
2016-11-03 21:29 ` [Qemu-devel] [PATCH 0/5] ARM BE8/BE32 big-endian system-mode fixes (semihosting, gdbstub) no-reply
2016-11-03 21:37 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161206151154.71c69b41@squid.athome \
    --to=julian@codesourcery.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox