aboutsummaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-02-04 17:40:20 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-02-04 17:40:20 +0000
commit0fd14b72ac91516a0415f626d632ffa86f1e1a05 (patch)
tree6f6ec9baf245e08f1b624675481b3e85cc9e334d /target-i386
parent7fb843f8cc67805d66db9e2ec3d482c8a928bdab (diff)
fxsave/fxrstor fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1738 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/translate.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/target-i386/translate.c b/target-i386/translate.c
index dab0378079..0db0d4a4b1 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -5803,14 +5803,24 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
op = (modrm >> 3) & 7;
switch(op) {
case 0: /* fxsave */
- if (mod == 3 || !(s->cpuid_features & CPUID_FXSR))
+ if (mod == 3 || !(s->cpuid_features & CPUID_FXSR) ||
+ (s->flags & HF_EM_MASK))
goto illegal_op;
+ if (s->flags & HF_TS_MASK) {
+ gen_exception(s, EXCP07_PREX, pc_start - s->cs_base);
+ break;
+ }
gen_lea_modrm(s, modrm, &reg_addr, &offset_addr);
gen_op_fxsave_A0((s->dflag == 2));
break;
case 1: /* fxrstor */
- if (mod == 3 || !(s->cpuid_features & CPUID_FXSR))
+ if (mod == 3 || !(s->cpuid_features & CPUID_FXSR) ||
+ (s->flags & HF_EM_MASK))
goto illegal_op;
+ if (s->flags & HF_TS_MASK) {
+ gen_exception(s, EXCP07_PREX, pc_start - s->cs_base);
+ break;
+ }
gen_lea_modrm(s, modrm, &reg_addr, &offset_addr);
gen_op_fxrstor_A0((s->dflag == 2));
break;