qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Patch: fix FSTENV (and FSAVE) instructions in target-i386.


From: ChALkeR
Subject: [Qemu-devel] Patch: fix FSTENV (and FSAVE) instructions in target-i386.
Date: Fri, 26 Nov 2010 14:23:48 +0300

Patch for the bug https://bugs.launchpad.net/qemu/+bug/661696

Testcase:

#include <stdio.h>
extern void *x;
int main() {
   int a;
   asm volatile ("x: fldz\n\
   push %%edx\n\
   fnstenv -0xc(%%esp)\n\
   pop %%edx\n" : "=d" (a) : : "memory");
   printf ("%x %x\n", a, &x);
   return 0;
}

$ gcc -m32 test.c -o test
$ ./test
80483ae 80483ae
$ ./qemu/i386-linux-user/qemu-i386 ./test
0 80483ae
$ ./qemu-patched/i386-linux-user/qemu-i386 ./test
80483ae 80483ae

Attachment: qemu-0.13.0-fix_fstenv.diff
Description: Binary data


reply via email to

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