qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/7] target-i386: x87 exception pointers using TCG.
@ 2014-08-06 20:46 Jaume Martí
  2014-08-06 21:38 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Jaume Martí @ 2014-08-06 20:46 UTC (permalink / raw)
  To: qemu-devel, riku.voipio, mtosatti, pbonzini, afaerber, mst, gleb,
	alex.bennee, anthony, quintela, vrozenfe, Peter Maydell,
	Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 2146 bytes --]

Hello,

I submit a patch to fix bugs 661696 and 1248376.
I already submitted a previous version of this patch, this version requires
less TCG operations to execute.
As mentioned in a previous email, the patch implements, for TCG, the
specifications provided in Intel and AMD programmer's manuals regarding the
x87 exception pointers. That is, when executing instructions
fstenv/fnstenv, fsave and fxsave the values for the instruction pointer,
data pointer and opcode of the last non-control x87 instruction executed,
are correctly saved to the specified memory address. When executing
instructions fldenv, frstor and fxrstor the values that are going to be
considered the instruction pointer, data pointer and opcode of the last
non-control x87 instruction are obtained from the specified memory address.

I divided this patch in 8 parts, this first part involves changes in the
CPUX86State struct to store the exception pointers.

Best regards,
Jaume

Signed-off-by: Jaume Marti Farriol (jaume.martif@gmail.com)
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index e634d83..4274ce3 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -819,10 +819,11 @@ typedef struct CPUX86State {
     uint16_t fpuc;
     uint8_t fptags[8];   /* 0 = valid, 1 = empty */
     FPReg fpregs[8];
-    /* KVM-only so far */
-    uint16_t fpop;
+    uint32_t fpop;
     uint64_t fpip;
     uint64_t fpdp;
+    uint32_t fpcs;
+    uint32_t fpds;

     /* emulator internal variables */
     float_status fp_status;
@@ -1067,8 +1068,8 @@ floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper);
 /* the following helpers are only usable in user mode simulation as
    they can trigger unexpected exceptions */
 void cpu_x86_load_seg(CPUX86State *s, int seg_reg, int selector);
-void cpu_x86_fsave(CPUX86State *s, target_ulong ptr, int data32);
-void cpu_x86_frstor(CPUX86State *s, target_ulong ptr, int data32);
+void cpu_x86_fsave(CPUX86State *s, target_ulong ptr);
+void cpu_x86_frstor(CPUX86State *s, target_ulong ptr);

 /* you can call this signal handler from your SIGBUS and SIGSEGV
    signal handlers to inform the virtual CPU of exceptions. non zero

[-- Attachment #2: Type: text/html, Size: 2444 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-06 21:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-06 20:46 [Qemu-devel] [PATCH 0/7] target-i386: x87 exception pointers using TCG Jaume Martí
2014-08-06 21:38 ` Eric Blake

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).