qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] TCG/GCC breakage


From: Aurelien Jarno
Subject: Re: [Qemu-devel] TCG/GCC breakage
Date: Mon, 16 Mar 2009 09:26:31 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Wed, Mar 11, 2009 at 12:40:20AM -0300, Glauber Costa wrote:
> I'm seeing a strange behaviour here using qemu-system-x86_64
> (kvm not even compiled in) on an i386 host
> 
> I'm suspecting gcc is doing something nasty in here, but I'll open it
> up here to see if any
> of you have any suggestion.
> 
> I get segfaults very early in execution, and after some investigation,
> I figured out that
> ebp register is corrupted. I can't determine where the corruption starts.
> 
> I then did rm x86-64-softmmu/op_helper.o; make CC=gcc34, so only this
> file get compiled
> by an older gcc, and it worked again.
> 
> So it seems to me gcc may be generating gibberish somewhere in
> helpers, but since
> this code is a bit fragile, it might well be some mistake on our part.
> 
> Ideas on how to attack it ?
> 

I have been able to find time to look a bit more closer at this issue. I
confirm that I am able to reproduce it with GCC 4.4, and that the %ebp
register is corrupted after a call to some helpers.

However, contrary to what I expected, it doesn't crash on call to
helpers from TCG code, but rather on call of helper from cpu-exec.c. One
of them is helper_cc_compute_all(). A diff on the assembly code between
GCC 4.3 and 4.4 shows that %ebp is now used to access values in static
tables, but is then never restored.

It looks like that GCC is being mistaken by the fact that %ebp is used
as the env register and consider that this register does not have to be
saved and restored. That's why I really think it is a GCC 4.4 issue, and
not a QEMU one.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
address@hidden                 http://www.aurel32.net




reply via email to

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