qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Crash due to invalid env->current_tb


From: Blue Swirl
Subject: Re: [Qemu-devel] Crash due to invalid env->current_tb
Date: Wed, 30 Apr 2008 20:09:23 +0300

On 4/30/08, Adam Lackorzynski <address@hidden> wrote:
>
>  On Wed Apr 30, 2008 at 17:11:32 +0200, Adam Lackorzynski wrote:
>  > On Wed Apr 30, 2008 at 11:08:46 +0200, Alexander Graf wrote:
>
> > > There was a comment from Fabrice on how to do prologues in TCG to save /
>  > > restore the clobbered values. Btw, ebx gets clobbered as well.
>  >
>  > tcg/README says that some registers are clobbered. So something like
>  > this should be safe:
>  >
>  > Index: cpu-exec.c
>  > ===================================================================
>  > --- cpu-exec.c        (revision 4276)
>  > +++ cpu-exec.c        (working copy)
>  > @@ -690,6 +691,15 @@
>  >               fp.ip = tc_ptr;
>  >               fp.gp = code_gen_buffer + 2 * (1 << 20);
>  >               (*(void (*)(void)) &fp)();
>  > +#elif defined(__i386)
>  > +             asm volatile ("push %%ebp\n"
>  > +                           "push %%ebx\n"
>  > +                           "call *%1\n"
>  > +                           "pop %%ebx\n"
>  > +                           "pop %%ebp\n"
>  > +                           : "=a" (T0)
>  > +                           : "r" (gen_func)
>  > +                           : "esi", "edi", "ecx", "edx");
>  >  #else
>  >                  T0 = gen_func();
>  >  #endif
>
>
> I just realised that the push and pop of ebx is not needed as T0 is ebx
>  which gets overwritten in the output anyway.

Sparc32 compiles, but for sparc64-softmmu target, I get compiler errors:
/src/qemu/cpu-exec.c: In function `cpu_sparc_exec':
/src/qemu/cpu-exec.c:694: error: impossible register constraint in `asm'
/src/qemu/cpu-exec.c:694: error: can't find a register in class
`ALL_REGS' while reloading `asm'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]