Skip to contentSkip to conversation

Status of sun4u emulation?

Qemu-devel Markus Dahms 3 participants 5 messages May 26, 2008 – May 27, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

I'm curious about the status of the Sparc64/Sun4U emulation. I tried to execute a little hello world program without success (output below). The program runs fine on real hardware, the same little thing built for sparc32 does what expected with qemu-sparc.
I'm also wondering why sparc64-softmmu is not build by default (not in TARGET_DIRS).

Another sparc-related question: is there a way to press Stop-A in system emulation mode? I even have a Stop key using a Sun Type 6 USB keyboard on my PC, but that doesn't seem to be enough...

Thanks & Greetings,

Markus

(host: i386, SVN r4586, gcc 3.4.6)

------------------------------------------------------------------------------

$ file hello-sparc64 
hello-sparc64: ELF 64-bit MSB executable, SPARC V9, version 1 (SYSV), for GNU/Linux 2.6.0, statically linked, not stripped
$ qemu-sparc64 hello-sparc64
Unhandled trap: 0x37
pc: 000000000010ccb4  npc: 000000000010ccb8
General Registers:
%g0: 0000000000000000	%g1: 0000000000000001	%g2: 0000000000000000	%g3: 000000000027a000	
%g4: 000000000027a298	%g5: 0000000000278400	%g6: 0000000000000010	%g7: 000000000027c850	
Current Register Window:
%o0: 000000000027ac50	%o1: 0000000000000001	%o2: 000000004007f498	%o3: 0000000000100bc0	
%o4: 0000000000100b60	%o5: 000000000027a800	%o6: 000000004007e1d1	%o7: 000000000010022c	
%l0: 000000000027ac00	%l1: 0000000000000000	%l2: 0000000000000000	%l3: 0000000000000000	
%l4: 0000000000000000	%l5: 0000000000000000	%l6: 0000000000000000	%l7: 0000000000000000	
%i0: 00000000001076a0	%i1: 00000000001036a0	%i2: 0000000000103440	%i3: 0000000000000000	
%i4: 0000000000000000	%i5: 0000000000000000	%i6: 000000004007e291	%i7: 0000000000104174	

Floating Point Registers:
%f00: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f04: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f08: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f12: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f16: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f20: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f24: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f28: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
pstate: 0x00000092 ccr: 0x88 asi: 0x82 tl: 0 fprs: 0
cansave: 0 canrestore: 6 otherwin: 0 wstate 0 cleanwin 6 cwp 7
fsr: 0x00000000

Signature · 2 lines
ubuntu is an ancient african word meaning "i can't install debian."
                                                         -- unknown
#1 lore raw
Quoted 6 lines · Markus Dahms

Hi,

I'm curious about the status of the Sparc64/Sun4U emulation. I tried to execute a little hello world program without success (output below). The program runs fine on real hardware, the same little thing built for sparc32 does what expected with qemu-sparc.

The error (0x37) is privileged action, this should not happen with normal executables. I'd be happy to debug the binary if you sent it to me.

Quoted 2 lines

I'm also wondering why sparc64-softmmu is not build by default (not in TARGET_DIRS).

Well, there are bugs in the emulation as you have noticed. Moreover a full 64-bit user environment is not very common on Sparc so nobody has been very interested in it except me.

Quoted 3 lines

Another sparc-related question: is there a way to press Stop-A in system emulation mode? I even have a Stop key using a Sun Type 6 USB keyboard on my PC, but that doesn't seem to be enough...

No, though that's in TODO. The problem IIRC is that the X11 keys are translated to PC values before getting translated to Type 4 codes.

#2 lore raw

Hello again,

[qemu-sparc64 failure on i386]

Quoted 3 lines

The error (0x37) is privileged action, this should not happen with normal executables. I'd be happy to debug the binary if you sent it to me.

with r4588:

$ qemu-sparc64 hello-sparc64
/home/mad/src/svn/qemu/tcg/tcg.c:1700: tcg fatal error
qemu: uncaught target signal 6 (Aborted) - exiting

bye,

Markus

Signature · 2 lines
ubuntu is an ancient african word meaning "i can't install debian."
                                                         -- unknown
#3 lore raw
Quoted 9 lines · Markus Dahms

Hello again,

[qemu-sparc64 failure on i386]

Quoted 3 lines

The error (0x37) is privileged action, this should not happen with normal executables. I'd be happy to debug the binary if you sent it to me.

Quoted 5 lines

with r4588:

 $ qemu-sparc64 hello-sparc64
 /home/mad/src/svn/qemu/tcg/tcg.c:1700: tcg fatal error
 qemu: uncaught target signal 6 (Aborted) - exiting

That happened also without today's commits, it didn't show up because of the earlier bug with cas. Some earlier commit must have broken TCG.

These error messages could be more descriptive, like what is the problem and how to fix it.

#4 lore raw
Quoted 5 lines
Quoted 2 lines

 /home/mad/src/svn/qemu/tcg/tcg.c:1700: tcg fatal error
 qemu: uncaught target signal 6 (Aborted) - exiting

These error messages could be more descriptive, like what is the problem and how to fix it.

FWIW The general theory with aborts is that that should never occur so there's no point being verbose.

From a user perspective "tcg.g:1700 fatal error" is IMHO no worse than "Bad voodoo when trying to frobnicate the weezle". The user has no control over weasel frobnication, so it just adds confusion.

For someone fixing the bug you're likely to need additional instrumentation, a debugger and/or a core dump anyway so the file and line number is sufficient context.

Of course there are exceptions to this rule, but if it were easy to report the problem and how to fix it we'd have done so already :-)

Paul