qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Configuring QEMU to translate x86 instructions to native ARM instructions
@ 2012-03-06  5:11 Roger Tagged
  2012-03-06 15:54 ` Peter Maydell
  0 siblings, 1 reply; 5+ messages in thread
From: Roger Tagged @ 2012-03-06  5:11 UTC (permalink / raw)
  To: qemu-devel

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

Hello dear developers,

I want to use the CPU emulation component of QEMU (user mode) and I'm
running into a bit of a problem that I hope you can help me with or point
me to the right list.

On my x86 Linux VM, I have configured QEMU with:

'--target-list=i386-linux-user' '--cc=/bin/arm-none-linux-gnueabi-gcc

I then issue the make command which cross-compiles the source code to run
on an ARM CPU to emulate an x86 CPU.  When I debug the resulting ARM code,
I can see that QEMU successfully turns an x86 instruction into the
intermediate micro operations.  When the first call is reach, the
translation ends and it then attempts to executed the micro operations as
host (should be ARM) code which crashes with an illegal instruction

Program received signal SIGILL, Illegal instruction.
0x402a4360 in code_gen_prologue

When I disassemble code_gen_prologue, I expected to see ARM instructions,
but I am not.

(gdb) disassem code_gen_prologue
Dump of assembler code for function code_gen_prologue:
=> 0x402a4360 <+0>:   ; <UNDEFINED> instruction: 0x57565355
   0x402a4364 <+4>: ldc2l 4, cr12, [r4, #-516]! ; 0xfffffdfc
   0x402a4368 <+8>: stm r11, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10,
r11, r12, sp, lr, pc}
   0x402a436c <+12>: strgt lr, [r1], #767 ; 0x2ff
Why don't I see ARM instructions here?  Is the prologue being generated for
x86 instead of ARM?  One thing that I know for certain is that the code
that initializes the TCGContext tcg_target_qemu_prologue() is from the file
tcg/i386/tcg-target.c and not from tcg/arm/tcg-target.c.  Is this the right?

Thanks in advance,
Roger

[-- Attachment #2: Type: text/html, Size: 1916 bytes --]

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

end of thread, other threads:[~2012-03-07 14:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-06  5:11 [Qemu-devel] Configuring QEMU to translate x86 instructions to native ARM instructions Roger Tagged
2012-03-06 15:54 ` Peter Maydell
2012-03-06 16:09   ` Roger
2012-03-06 16:14     ` Peter Maydell
2012-03-07 14:26       ` Roger

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).