qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: malc <malc@pulsesoft.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [RFC] [PATCH] TSS ljmp issues
Date: Mon, 19 Jun 2006 22:29:18 +0400 (MSD)	[thread overview]
Message-ID: <Pine.LNX.4.64.0606192225460.6802@home.oyster.ru> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 353 bytes --]


QEMU does not correctly handle jumps to TSS segments, the code in
switch_tss loads new eflags, but cc_op is never set to CC_OP_EFLAGS.
The problem manifests itself when trying to run DJGPP binaries
compressed with UPX. It goes something like this:

 		sub	esi, 0FFFFFFFCh
 		adc	ebx, ebx

loc_169:				; CODE XREF: start+1B

--
mailto:malc@pulsesoft.com

[-- Attachment #2: Type: TEXT/PLAIN, Size: 658 bytes --]

Index: target-i386/helper.c
===================================================================
RCS file: /cvsroot/qemu/qemu/target-i386/helper.c,v
retrieving revision 1.65
diff -u -r1.65 helper.c
--- target-i386/helper.c	3 May 2006 19:17:26 -0000	1.65
+++ target-i386/helper.c	19 Jun 2006 18:19:12 -0000
@@ -1674,6 +1674,7 @@
                 raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
             next_eip = env->eip + next_eip_addend;
             switch_tss(new_cs, e1, e2, SWITCH_TSS_JMP, next_eip);
+            CC_OP = CC_OP_EFLAGS;
             break;
         case 4: /* 286 call gate */
         case 12: /* 386 call gate */

                 reply	other threads:[~2006-06-19 18:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0606192225460.6802@home.oyster.ru \
    --to=malc@pulsesoft.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).