[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Crash due to invalid env->current_tb
From: |
Paul Brook |
Subject: |
Re: [Qemu-devel] Crash due to invalid env->current_tb |
Date: |
Thu, 1 May 2008 17:04:43 +0100 |
User-agent: |
KMail/1.9.9 |
> > 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?
Paul