From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FsOZL-00087j-V1 for qemu-devel@nongnu.org; Mon, 19 Jun 2006 14:33:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FsOZL-000869-62 for qemu-devel@nongnu.org; Mon, 19 Jun 2006 14:33:51 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsOZL-00085z-34 for qemu-devel@nongnu.org; Mon, 19 Jun 2006 14:33:51 -0400 Received: from [217.10.32.16] (helo=comtv.ru) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FsOjg-0005gM-NU for qemu-devel@nongnu.org; Mon, 19 Jun 2006 14:44:33 -0400 Received: from av1474.oops ([10.0.66.9] verified) by comtv.ru (CommuniGate Pro SMTP 4.1.8) with ESMTP id 157110529 for qemu-devel@nongnu.org; Mon, 19 Jun 2006 22:33:49 +0400 Date: Mon, 19 Jun 2006 22:34:05 +0400 (MSD) From: malc Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; FORMAT=flowed Content-ID: Subject: [Qemu-devel] [RFC] [PATCH] TSS ljmp issues (fwd) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Sorry about previous e-mail, my mail client decided to ambush me. 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 mov al, [edi] ; <-- exception jb short loc_158 mov eax, 1 When using default DJGPPs DPMI provider (CWSDPMI) the following code takes the wrong route in `jb' due to interrupt handler exiting via jump to TSS (and QEMU not setting cc_op) properly. Attached patch cures this, however i'm not sure that it's the best way of doing that nor that it is comprehensive. Sincerely, malc -- mailto:malc@pulsesoft.com