SPARC user mode multithread
Hi,
I found the Linux/Sparc clone operations in copy_thread() from process32.c (attached)
I tried modifying cpu_clone_regs with the following code per the Sparc/linux routines, but qemu still stalls on signal suspend.
It seems like it should only need to set the stack pointer and the return addresses for the child and parent processes, but it's clearly missing something.
Is there more to this fix than these two assignments?
static inline void cpu_clone_regs(CPUState *PARENT_env, CPUState *child_env, target_ulong newsp)
{
if (newsp)
{
child_env->regwptr[14] = newsp; //changed to 14 per process32.c DM
//env->regwptr[22] = newsp;
printf("setting stack pointer\n");
}
child_env->regwptr[0] = 0;
child_env->regwptr[1] = 1; //added per process32.c in kernel for sparc
parent_env->regwptr[1] = 0; //make parent return value = 0 per process32.c in kernel for sparc}
}Thanks,
David
----- Original Message -----
From: "Blue Swirl" <[email protected]>
To: "David Munday" <[email protected]>
Cc: [email protected]
Sent: Tuesday, November 3, 2009 12:41:04 PM GMT -08:00 US/Canada Pacific
Subject: Re: [Qemu-devel] SPARC user mode multithread
Quoted 6 lines · David Munday
Hello,
I am trying to run the blackscholes program from the PARSEC2.1 benchmark suite in QEMU SPARC user mode.
In this case I am trying to run with just 2 threads. Unfortunately, when I try to run the program it hangs with the following prints:HELPME: /mada/users/cromom/ESESC_PROJECT/esesc/emul/qemu1/target-sparc/cpu.h:516
HELPME: /mada/users/cromom/ESESC_PROJECT/esesc/emul/qemu1/target-sparc/cpu.h:516
It means that someone should figure out what Linux/Sparc does to registers, register windows and processor flags when doing "clone". The fix should be trivial.
Quoted 2 lines · David Munday
Hi,
I found the Linux/Sparc clone operations incopy_thread()fromprocess32.c(attached)
Forgot to attach?
Quoted 4 lines
I tried modifying
cpu_clone_regswith the following code per the Sparc/linux routines, but qemu still stalls on signal suspend.It seems like it should only need to set the stack pointer and the return addresses for the child and parent processes, but it's clearly missing something.
Quoted 8 lines
Is there more to this fix than these two assignments?
static inline void
cpu_clone_regs(CPUState *PARENT_env, CPUState *child_env, target_ulong newsp){
if (newsp)
{
child_env->regwptr[14] = newsp; //changed to 14 perprocess32.cDM //env->regwptr[22] = newsp;
But 14 would be l6, not i6.
Quoted 3 lines
printf("setting stack pointer\n");
}
child_env->regwptr[0] = 0;
This should be the pid.