* [Qemu-devel] qemu-fast on Debian
@ 2004-08-19 11:56 Piotr Krysik
2004-08-19 21:45 ` Piotr Krysik
0 siblings, 1 reply; 2+ messages in thread
From: Piotr Krysik @ 2004-08-19 11:56 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1601 bytes --]
Hi!
While testing qemu-fast on Debian/unstable host
I noticed two problems:
* for some combination gcc and flags used to
compile qemu I get "Illegal instruction" fault;
* when using -d xxxx option, I always get
"Segmentation fault".
I get "Illegal instruction" fault when code
generated by gcc uses different policy for storing
outgoing parameters then assumed in qemu. For example
op_jz_ecxw_im may be compiled as:
5db0: sub $0x4,%esp
5db3: cmpw $0x0,0x4(%ebp)
5db8: jne 5de3 <op_jz_ecxw_im+0x33>
5dba: testb $0x1,0x25(%ebp)
5dbe: movl $0x0,0x20(%ebp)
5dc5: je 5de0 <op_jz_ecxw_im+0x30>
5dc7: movl $0x1,(%esp)
5dce: call 5dcf <op_jz_ecxw_im+0x1f>
5dd3: lea 0x0(%esi),%esi
5dd9: lea 0x0(%edi),%edi
5de0: xor %ebx,%ebx
5de2: ret
5de3: pop %ecx
5de4: ret
When block is exited by ret at 5de2, the stack
pointer is not correctly restored. The ret comes
from EXIT_TB().
To fix the problem I propose to store stack pointer
in a variable (new CPUState field?) before entering
translated code and restore it on exit. Does anyone
have better idea?
The second problem is probably caused by memory
layout inconsistent with glibc assumption. I'm
attaching a patch to work-around the problem (tested
with libc6-dev 2.3.2.ds1-16).
Regards,
Piotrek
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[-- Attachment #2: fast-glibc-0.patch.gz --]
[-- Type: application/x-tar, Size: 402 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] qemu-fast on Debian
2004-08-19 11:56 [Qemu-devel] qemu-fast on Debian Piotr Krysik
@ 2004-08-19 21:45 ` Piotr Krysik
0 siblings, 0 replies; 2+ messages in thread
From: Piotr Krysik @ 2004-08-19 21:45 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 215 bytes --]
I'm attaching fix for "Illegal instruction" fault.
Piotrek
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[-- Attachment #2: fast-stack-2.patch.gz --]
[-- Type: application/x-tar, Size: 1352 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-08-19 21:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-19 11:56 [Qemu-devel] qemu-fast on Debian Piotr Krysik
2004-08-19 21:45 ` Piotr Krysik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).