* [Qemu-devel] Alpha linux-user support
@ 2008-11-05 18:01 Vince Weaver
2008-11-05 19:33 ` Laurent Desnogues
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Vince Weaver @ 2008-11-05 18:01 UTC (permalink / raw)
To: qemu-devel
Hello
I forget who is working on the Alpha architecture support.
I've managed to scrounge together a working Alpha machine from that parts
of 3 broken machines, and it is running debian and has been stable so far.
I tried compiling some simple binaries (on the Alpha) and running them
with qemu alpha-linux-user (on an x86_64 machine) with no luck. The gdb
interface seems to be broken as well, making it hard to track down what
the issues are.
Is there anything I can do to help out the architecture, or should I wait
until some more TCG work has been done?
Vince
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Qemu-devel] Alpha linux-user support 2008-11-05 18:01 [Qemu-devel] Alpha linux-user support Vince Weaver @ 2008-11-05 19:33 ` Laurent Desnogues 2008-11-05 22:03 ` Vince Weaver 2008-11-06 9:05 ` Tristan Gingold 2008-11-06 9:12 ` Aurelien Jarno 2 siblings, 1 reply; 6+ messages in thread From: Laurent Desnogues @ 2008-11-05 19:33 UTC (permalink / raw) To: qemu-devel On Wed, Nov 5, 2008 at 7:01 PM, Vince Weaver <vince@csl.cornell.edu> wrote: > > I tried compiling some simple binaries (on the Alpha) and running them with > qemu alpha-linux-user (on an x86_64 machine) with no luck. How is it failing? All I was able to run was some simple hand written assembly programs. For C programs I got: - Illegal instruction, no matter what CPU setting I am giving to gcc; to get around this try to add ctx->amask |= AMASK_BWX to cpu_alpha_init - once the amask is set I get "kernel too old". Basically my Alpha cross toolchain does not look right or there's a bug in the translator. Laurent ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Alpha linux-user support 2008-11-05 19:33 ` Laurent Desnogues @ 2008-11-05 22:03 ` Vince Weaver 2008-11-05 23:08 ` Laurent Desnogues 0 siblings, 1 reply; 6+ messages in thread From: Vince Weaver @ 2008-11-05 22:03 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: TEXT/PLAIN, Size: 715 bytes --] Hello First, I found a bug in the alpha emulation of the "ret" instruction, see a separate e-mail to the list. > How is it failing? All I was able to run was some simple hand written > assembly programs. For C programs I got: For C programs I get infinite "Unsupported Syscall 394" errors. This is the futex() syscall. Maybe my toolchain (gcc 4.2.4) is trying to make NPTL binaries. Hmmm. I've attached my simple assembly program I am working with. It should print hello world, but doesn't because the address passed to the write syscall is wrong. I can't easily track down where things are going wrong though because the gdbstub doesn't work for alpha. Does anyone know the status of that? Vince [-- Attachment #2: Type: TEXT/PLAIN, Size: 1520 bytes --] # as -o hello.o hello.s ; ld -o hello hello.o .equ SYSCALL_EXIT,1 .equ SYSCALL_WRITE,4 .equ STDIN,0 .equ STDOUT,1 .equ STDERR,2 .globl _start _start: br $27,0 # fake branch, to grab the location # of our entry point ldgp $gp,0($27) # load the GP proper for our entry point # this does automagic stuff... # gp is used for 64-bit jumps and constants # so if you use "la" and the like it will # load from gp for you. lda $17,hello_string br $26,write_stdout #================================ # Exit #================================ exit: clr $16 # 0 exit value mov SYSCALL_EXIT,$0 # put the exit syscall number in v0 callsys # and exit #================================ # WRITE_STDOUT #================================ # $17 has string # $1 is trashed write_stdout: ldil $0,SYSCALL_WRITE # Write syscall in $0 ldil $16,STDOUT # 1 in $16 (stdout) clr $18 # 0 (count) in $18 str_loop1: addq $17,$18,$1 # offset in $1 ldbu $1,0($1) # load byte addq $18,1,$18 # increment pointer bne $1,str_loop1 # if not nul, repeat subq $18,1,$18 # correct count callsys # Make syscall ret $26 # return #=========================================================================== .data #=========================================================================== hello_string: .ascii "Hello World\n\0" [-- Attachment #3: Type: APPLICATION/octet-stream, Size: 1304 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Alpha linux-user support 2008-11-05 22:03 ` Vince Weaver @ 2008-11-05 23:08 ` Laurent Desnogues 0 siblings, 0 replies; 6+ messages in thread From: Laurent Desnogues @ 2008-11-05 23:08 UTC (permalink / raw) To: qemu-devel On Wed, Nov 5, 2008 at 11:03 PM, Vince Weaver <vince@csl.cornell.edu> wrote: > > First, I found a bug in the alpha emulation of the "ret" instruction, see a > separate e-mail to the list. [...] > I've attached my simple assembly program I am working with. It should print > hello world, but doesn't because the address passed to the write syscall is > wrong. I can't easily track down where things are going wrong though > because the gdbstub doesn't work for alpha. Does anyone know the status of > that? After applying your ret patch, it works for me on an x86_64 platform. However the first callsys instruction fails on ia32 and returns EFAULT (bad address). In fact what happens looks like a problem of 64 -> 32 bit mapping: page_check_range fails (called by access_ok which is called by lock_user in do_syscall). It doesn't like the 0x120010100 address. Laurent ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Alpha linux-user support 2008-11-05 18:01 [Qemu-devel] Alpha linux-user support Vince Weaver 2008-11-05 19:33 ` Laurent Desnogues @ 2008-11-06 9:05 ` Tristan Gingold 2008-11-06 9:12 ` Aurelien Jarno 2 siblings, 0 replies; 6+ messages in thread From: Tristan Gingold @ 2008-11-06 9:05 UTC (permalink / raw) To: qemu-devel Vince, I did some work on the alpha side. There is at least a compilable example in test/ dir. Using a slightly older version of glibc and -static, I was also able to run some native programs (ie an hello-world using printf is ok). Use a 64 bits host. Tristan. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Alpha linux-user support 2008-11-05 18:01 [Qemu-devel] Alpha linux-user support Vince Weaver 2008-11-05 19:33 ` Laurent Desnogues 2008-11-06 9:05 ` Tristan Gingold @ 2008-11-06 9:12 ` Aurelien Jarno 2 siblings, 0 replies; 6+ messages in thread From: Aurelien Jarno @ 2008-11-06 9:12 UTC (permalink / raw) To: qemu-devel On Wed, Nov 05, 2008 at 01:01:22PM -0500, Vince Weaver wrote: > Hello > > I forget who is working on the Alpha architecture support. There is no maintainer, only a few people sending patches > I've managed to scrounge together a working Alpha machine from that parts > of 3 broken machines, and it is running debian and has been stable so > far. > > I tried compiling some simple binaries (on the Alpha) and running them > with qemu alpha-linux-user (on an x86_64 machine) with no luck. The gdb > interface seems to be broken as well, making it hard to track down what > the issues are. I am personally able to run statically compiled C program if they are built with a non-NPTL toolchain. > Is there anything I can do to help out the architecture, or should I wait > until some more TCG work has been done? > Patches are welcome. Aurelien -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-11-06 9:12 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-11-05 18:01 [Qemu-devel] Alpha linux-user support Vince Weaver 2008-11-05 19:33 ` Laurent Desnogues 2008-11-05 22:03 ` Vince Weaver 2008-11-05 23:08 ` Laurent Desnogues 2008-11-06 9:05 ` Tristan Gingold 2008-11-06 9:12 ` Aurelien Jarno
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.