qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1263747] [NEW] Arm64 fails to run a binary which runs OK on real hardware
@ 2013-12-23 18:38 Richard Jones
  2013-12-23 20:13 ` Peter Maydell
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Richard Jones @ 2013-12-23 18:38 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Note this is using the not-yet-upstream aarch64 patches from:

https://github.com/susematz/qemu/tree/aarch64-1.6

---- ----

This binary:

http://oirase.annexia.org/tmp/test.gz

runs OK on real aarch64 hardware.  It is a statically linked Linux
binary which (if successful) will print "hello, world" and exit cleanly.

On qemu-arm64 userspace emulator it doesn't print anything and loops
forever using 100% CPU.

---- ----

The following section is only if you wish to compile this binary from
source, otherwise you can ignore it.

First compile OCaml from:

https://github.com/ocaml/ocaml

(note you have to compile it on aarch64 or in qemu, it's not possible to
cross-compile).  You will have to apply the one-line patch from:

https://sympa.inria.fr/sympa/arc/caml-list/2013-12/msg00179.html

    ./configure
    make -j1 world.opt

Then do:

    echo 'print_endline "hello, world"' > test.ml
    ./boot/ocamlrun ./ocamlopt -I stdlib stdlib.cmxa test.ml -o test
    ./test

** Affects: qemu
     Importance: Undecided
         Status: New

** Description changed:

+ Note this is using the not-yet-upstream aarch64 patches from:
+ 
+ https://github.com/susematz/qemu/tree/aarch64-1.6
+ 
+ ---- ----
+ 
  This binary:
  
  http://oirase.annexia.org/tmp/test.gz
  
  runs OK on real aarch64 hardware.  It is a statically linked Linux
  binary which (if successful) will print "hello, world" and exit cleanly.
  
  On qemu-arm64 userspace emulator it doesn't print anything and loops
  forever using 100% CPU.
  
- ----
- The following section is only if you wish to compile this binary from source, otherwise you can ignore it.
+ ---- ----
+ 
+ The following section is only if you wish to compile this binary from
+ source, otherwise you can ignore it.
  
  First compile OCaml from:
  
  https://github.com/ocaml/ocaml
  
  (note you have to compile it on aarch64 or in qemu, it's not possible to
  cross-compile).  You will have to apply the one-line patch from:
  
  https://sympa.inria.fr/sympa/arc/caml-list/2013-12/msg00179.html
  
-     ./configure
-     make -j1 world.opt
+     ./configure
+     make -j1 world.opt
  
  Then do:
  
-     echo 'print_endline "hello, world"' > test.ml
-     ./boot/ocamlrun ./ocamlopt -I stdlib stdlib.cmxa test.ml -o test
-     ./test
+     echo 'print_endline "hello, world"' > test.ml
+     ./boot/ocamlrun ./ocamlopt -I stdlib stdlib.cmxa test.ml -o test
+     ./test

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1263747

Title:
  Arm64 fails to run a binary which runs OK on real hardware

Status in QEMU:
  New

Bug description:
  Note this is using the not-yet-upstream aarch64 patches from:

  https://github.com/susematz/qemu/tree/aarch64-1.6

  ---- ----

  This binary:

  http://oirase.annexia.org/tmp/test.gz

  runs OK on real aarch64 hardware.  It is a statically linked Linux
  binary which (if successful) will print "hello, world" and exit
  cleanly.

  On qemu-arm64 userspace emulator it doesn't print anything and loops
  forever using 100% CPU.

  ---- ----

  The following section is only if you wish to compile this binary from
  source, otherwise you can ignore it.

  First compile OCaml from:

  https://github.com/ocaml/ocaml

  (note you have to compile it on aarch64 or in qemu, it's not possible
  to cross-compile).  You will have to apply the one-line patch from:

  https://sympa.inria.fr/sympa/arc/caml-list/2013-12/msg00179.html

      ./configure
      make -j1 world.opt

  Then do:

      echo 'print_endline "hello, world"' > test.ml
      ./boot/ocamlrun ./ocamlopt -I stdlib stdlib.cmxa test.ml -o test
      ./test

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1263747/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Bug 1263747] [NEW] Arm64 fails to run a binary which runs OK on real hardware
  2013-12-23 18:38 [Qemu-devel] [Bug 1263747] [NEW] Arm64 fails to run a binary which runs OK on real hardware Richard Jones
@ 2013-12-23 20:13 ` Peter Maydell
  2013-12-23 21:27 ` [Qemu-devel] [Bug 1263747] " Richard Jones
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2013-12-23 20:13 UTC (permalink / raw)
  To: Bug 1263747; +Cc: QEMU Developers

On 23 December 2013 18:38, Richard Jones <rjones@redhat.com> wrote:
> This binary:
>
> http://oirase.annexia.org/tmp/test.gz
>
> runs OK on real aarch64 hardware.  It is a statically linked Linux
> binary which (if successful) will print "hello, world" and exit cleanly.
>
> On qemu-arm64 userspace emulator it doesn't print anything and loops
> forever using 100% CPU.

Does the equivalent binary run OK in 32 bit ARM QEMU?
Does the binary use multiple threads?

If you have the time to investigate more closely what the binary
is actually doing when it loops (eg by running under a host gdb,
or using the debug log tracing of TCG input and output code and
execution) that would be helpful. Otherwise it's likely to be quite a
long time before I get round to looking at this kind of thing, because
"runs complex binaries/runtimes like ocaml" is not very high up the
priority list, I'm afraid.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1263747] Re: Arm64 fails to run a binary which runs OK on real hardware
  2013-12-23 18:38 [Qemu-devel] [Bug 1263747] [NEW] Arm64 fails to run a binary which runs OK on real hardware Richard Jones
  2013-12-23 20:13 ` Peter Maydell
@ 2013-12-23 21:27 ` Richard Jones
  2013-12-23 22:19   ` Peter Maydell
  2013-12-23 21:51 ` Richard Jones
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Richard Jones @ 2013-12-23 21:27 UTC (permalink / raw)
  To: qemu-devel

It's an Aarch64 binary so it won't run on 32 bit ARM at all.  However I
guess you meant does the equivalent program run on 32 bit ARM, and the
answer is yes, but that doesn't tell us much because OCaml uses separate
code generators for 32 and 64 bit ARM.

The binary is single threaded.

I enabled tracing on qemu and got this:

http://oirase.annexia.org/tmp/arm64-call-trace.txt

The associate disassembly of the binary is here:

http://oirase.annexia.org/tmp/arm64-disassembly.txt

I'm not exactly sure which instruction fails to be emulated properly,
but it looks like one of the ones in the caml_c_call function.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1263747

Title:
  Arm64 fails to run a binary which runs OK on real hardware

Status in QEMU:
  New

Bug description:
  Note this is using the not-yet-upstream aarch64 patches from:

  https://github.com/susematz/qemu/tree/aarch64-1.6

  ---- ----

  This binary:

  http://oirase.annexia.org/tmp/test.gz

  runs OK on real aarch64 hardware.  It is a statically linked Linux
  binary which (if successful) will print "hello, world" and exit
  cleanly.

  On qemu-arm64 userspace emulator it doesn't print anything and loops
  forever using 100% CPU.

  ---- ----

  The following section is only if you wish to compile this binary from
  source, otherwise you can ignore it.

  First compile OCaml from:

  https://github.com/ocaml/ocaml

  (note you have to compile it on aarch64 or in qemu, it's not possible
  to cross-compile).  You will have to apply the one-line patch from:

  https://sympa.inria.fr/sympa/arc/caml-list/2013-12/msg00179.html

      ./configure
      make -j1 world.opt

  Then do:

      echo 'print_endline "hello, world"' > test.ml
      ./boot/ocamlrun ./ocamlopt -I stdlib stdlib.cmxa test.ml -o test
      ./test

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1263747/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1263747] Re: Arm64 fails to run a binary which runs OK on real hardware
  2013-12-23 18:38 [Qemu-devel] [Bug 1263747] [NEW] Arm64 fails to run a binary which runs OK on real hardware Richard Jones
  2013-12-23 20:13 ` Peter Maydell
  2013-12-23 21:27 ` [Qemu-devel] [Bug 1263747] " Richard Jones
@ 2013-12-23 21:51 ` Richard Jones
  2013-12-23 22:03 ` Richard Jones
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Richard Jones @ 2013-12-23 21:51 UTC (permalink / raw)
  To: qemu-devel

One thing I notice is that caml_c_call is the only function that uses
the instruction "ret xM" (in all other places the code uses the default
"ret" with implicit x30).  Hmmm .. do we emulate "ret xM"?

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1263747

Title:
  Arm64 fails to run a binary which runs OK on real hardware

Status in QEMU:
  New

Bug description:
  Note this is using the not-yet-upstream aarch64 patches from:

  https://github.com/susematz/qemu/tree/aarch64-1.6

  ---- ----

  This binary:

  http://oirase.annexia.org/tmp/test.gz

  runs OK on real aarch64 hardware.  It is a statically linked Linux
  binary which (if successful) will print "hello, world" and exit
  cleanly.

  On qemu-arm64 userspace emulator it doesn't print anything and loops
  forever using 100% CPU.

  ---- ----

  The following section is only if you wish to compile this binary from
  source, otherwise you can ignore it.

  First compile OCaml from:

  https://github.com/ocaml/ocaml

  (note you have to compile it on aarch64 or in qemu, it's not possible
  to cross-compile).  You will have to apply the one-line patch from:

  https://sympa.inria.fr/sympa/arc/caml-list/2013-12/msg00179.html

      ./configure
      make -j1 world.opt

  Then do:

      echo 'print_endline "hello, world"' > test.ml
      ./boot/ocamlrun ./ocamlopt -I stdlib stdlib.cmxa test.ml -o test
      ./test

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1263747/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1263747] Re: Arm64 fails to run a binary which runs OK on real hardware
  2013-12-23 18:38 [Qemu-devel] [Bug 1263747] [NEW] Arm64 fails to run a binary which runs OK on real hardware Richard Jones
                   ` (2 preceding siblings ...)
  2013-12-23 21:51 ` Richard Jones
@ 2013-12-23 22:03 ` Richard Jones
  2014-01-25  2:03 ` sumanth
  2016-06-27 21:20 ` T. Huth
  5 siblings, 0 replies; 8+ messages in thread
From: Richard Jones @ 2013-12-23 22:03 UTC (permalink / raw)
  To: qemu-devel

The attached patch fixes the ret xM variant of ret.  I verified that it
fixes the bug.

** Patch added: "0001-arm64-Set-source-for-ret-instruction-correctly.patch"
   https://bugs.launchpad.net/qemu/+bug/1263747/+attachment/3934836/+files/0001-arm64-Set-source-for-ret-instruction-correctly.patch

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1263747

Title:
  Arm64 fails to run a binary which runs OK on real hardware

Status in QEMU:
  New

Bug description:
  Note this is using the not-yet-upstream aarch64 patches from:

  https://github.com/susematz/qemu/tree/aarch64-1.6

  ---- ----

  This binary:

  http://oirase.annexia.org/tmp/test.gz

  runs OK on real aarch64 hardware.  It is a statically linked Linux
  binary which (if successful) will print "hello, world" and exit
  cleanly.

  On qemu-arm64 userspace emulator it doesn't print anything and loops
  forever using 100% CPU.

  ---- ----

  The following section is only if you wish to compile this binary from
  source, otherwise you can ignore it.

  First compile OCaml from:

  https://github.com/ocaml/ocaml

  (note you have to compile it on aarch64 or in qemu, it's not possible
  to cross-compile).  You will have to apply the one-line patch from:

  https://sympa.inria.fr/sympa/arc/caml-list/2013-12/msg00179.html

      ./configure
      make -j1 world.opt

  Then do:

      echo 'print_endline "hello, world"' > test.ml
      ./boot/ocamlrun ./ocamlopt -I stdlib stdlib.cmxa test.ml -o test
      ./test

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1263747/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Bug 1263747] Re: Arm64 fails to run a binary which runs OK on real hardware
  2013-12-23 21:27 ` [Qemu-devel] [Bug 1263747] " Richard Jones
@ 2013-12-23 22:19   ` Peter Maydell
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2013-12-23 22:19 UTC (permalink / raw)
  To: Bug 1263747; +Cc: QEMU Developers

On 23 December 2013 21:27, Richard Jones <rjones@redhat.com> wrote:
> It's an Aarch64 binary so it won't run on 32 bit ARM at all.  However I
> guess you meant does the equivalent program run on 32 bit ARM, and the
> answer is yes, but that doesn't tell us much because OCaml uses separate
> code generators for 32 and 64 bit ARM.

Yes, that's why I said "equivalent binary". It's a useful check because it
can tell us whether the program is using things our linux-user emulation
doesn't get right at all (examples: multiple threads; some interactions of
signals and blocking syscalls); so it divides the bug into "probably in
linux-user" vs "probably a target-arm bug".

I see you've tracked the issue down in this case, though.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1263747] Re: Arm64 fails to run a binary which runs OK on real hardware
  2013-12-23 18:38 [Qemu-devel] [Bug 1263747] [NEW] Arm64 fails to run a binary which runs OK on real hardware Richard Jones
                   ` (3 preceding siblings ...)
  2013-12-23 22:03 ` Richard Jones
@ 2014-01-25  2:03 ` sumanth
  2016-06-27 21:20 ` T. Huth
  5 siblings, 0 replies; 8+ messages in thread
From: sumanth @ 2014-01-25  2:03 UTC (permalink / raw)
  To: qemu-devel

>> runs OK on real aarch64 hardware.
May I know which hardware you are talking about. Is there an aarch64 hardware target available ?

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1263747

Title:
  Arm64 fails to run a binary which runs OK on real hardware

Status in QEMU:
  New

Bug description:
  Note this is using the not-yet-upstream aarch64 patches from:

  https://github.com/susematz/qemu/tree/aarch64-1.6

  ---- ----

  This binary:

  http://oirase.annexia.org/tmp/test.gz

  runs OK on real aarch64 hardware.  It is a statically linked Linux
  binary which (if successful) will print "hello, world" and exit
  cleanly.

  On qemu-arm64 userspace emulator it doesn't print anything and loops
  forever using 100% CPU.

  ---- ----

  The following section is only if you wish to compile this binary from
  source, otherwise you can ignore it.

  First compile OCaml from:

  https://github.com/ocaml/ocaml

  (note you have to compile it on aarch64 or in qemu, it's not possible
  to cross-compile).  You will have to apply the one-line patch from:

  https://sympa.inria.fr/sympa/arc/caml-list/2013-12/msg00179.html

      ./configure
      make -j1 world.opt

  Then do:

      echo 'print_endline "hello, world"' > test.ml
      ./boot/ocamlrun ./ocamlopt -I stdlib stdlib.cmxa test.ml -o test
      ./test

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1263747/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1263747] Re: Arm64 fails to run a binary which runs OK on real hardware
  2013-12-23 18:38 [Qemu-devel] [Bug 1263747] [NEW] Arm64 fails to run a binary which runs OK on real hardware Richard Jones
                   ` (4 preceding siblings ...)
  2014-01-25  2:03 ` sumanth
@ 2016-06-27 21:20 ` T. Huth
  5 siblings, 0 replies; 8+ messages in thread
From: T. Huth @ 2016-06-27 21:20 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1263747

Title:
  Arm64 fails to run a binary which runs OK on real hardware

Status in QEMU:
  Fix Released

Bug description:
  Note this is using the not-yet-upstream aarch64 patches from:

  https://github.com/susematz/qemu/tree/aarch64-1.6

  ---- ----

  This binary:

  http://oirase.annexia.org/tmp/test.gz

  runs OK on real aarch64 hardware.  It is a statically linked Linux
  binary which (if successful) will print "hello, world" and exit
  cleanly.

  On qemu-arm64 userspace emulator it doesn't print anything and loops
  forever using 100% CPU.

  ---- ----

  The following section is only if you wish to compile this binary from
  source, otherwise you can ignore it.

  First compile OCaml from:

  https://github.com/ocaml/ocaml

  (note you have to compile it on aarch64 or in qemu, it's not possible
  to cross-compile).  You will have to apply the one-line patch from:

  https://sympa.inria.fr/sympa/arc/caml-list/2013-12/msg00179.html

      ./configure
      make -j1 world.opt

  Then do:

      echo 'print_endline "hello, world"' > test.ml
      ./boot/ocamlrun ./ocamlopt -I stdlib stdlib.cmxa test.ml -o test
      ./test

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1263747/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-06-27 21:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-23 18:38 [Qemu-devel] [Bug 1263747] [NEW] Arm64 fails to run a binary which runs OK on real hardware Richard Jones
2013-12-23 20:13 ` Peter Maydell
2013-12-23 21:27 ` [Qemu-devel] [Bug 1263747] " Richard Jones
2013-12-23 22:19   ` Peter Maydell
2013-12-23 21:51 ` Richard Jones
2013-12-23 22:03 ` Richard Jones
2014-01-25  2:03 ` sumanth
2016-06-27 21:20 ` T. Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).