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: Thu, 1 May 2008 19:15:39 +0300

On 5/1/08, Paul Brook <address@hidden> wrote:
> > >                  T0 = gen_func();
>
> > >
>  > >  For 64bit target T0 is 64bits so "=a" does not work and "=A" is needed.
>  > >  The strange thing is that I need to throw away the upper 32bits because
>  > >  otherwise it won't work. gen_func is defined to return just long but T0
>  > >  is unsigned long long, this seems inconsistent. The 'and' does not
>  > >  appear in 32bit targets so it does not harm there.
>  >
>  > This is because in this special case, T0 is not used as target CPU
>  > temporary, but instead to return next TB address. On i386 this is 32
>  > bits, so only EAX is needed. TCG does not touch EDX, so it contains
>  > garbage. This also means that moving EDX to high word of T0 and then
>  > throwing the high word away may be slightly wasteful.
>
>
> Do we need to use T0 at all here? Can't we just use a normal local variable?

I suspect T0 was used to gain extra performance, but in case of 64-bit
target on 32-bit host there is this unnecessary work.

But does cpu-exec.c need to know about T0/T1/T2 at all? Can we replace
exec.h include with cpu.h one?




reply via email to

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