From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KlUNd-0001vS-08 for qemu-devel@nongnu.org; Thu, 02 Oct 2008 16:02:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KlUNb-0001v9-Da for qemu-devel@nongnu.org; Thu, 02 Oct 2008 16:02:32 -0400 Received: from [199.232.76.173] (port=46438 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KlUNb-0001v4-7j for qemu-devel@nongnu.org; Thu, 02 Oct 2008 16:02:31 -0400 Received: from savannah.gnu.org ([199.232.41.3]:40015 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KlUNa-0005GI-P7 for qemu-devel@nongnu.org; Thu, 02 Oct 2008 16:02:30 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KlUNZ-0003X7-2s for qemu-devel@nongnu.org; Thu, 02 Oct 2008 20:02:29 +0000 Received: from malc by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KlUNY-0003Wm-DI for qemu-devel@nongnu.org; Thu, 02 Oct 2008 20:02:28 +0000 MIME-Version: 1.0 Errors-To: malc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: malc Message-Id: Date: Thu, 02 Oct 2008 20:02:28 +0000 Subject: [Qemu-devel] [5403] Do not use load_seg_vm to load CS in real mode iret handling 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 Revision: 5403 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5403 Author: malc Date: 2008-10-02 20:02:27 +0000 (Thu, 02 Oct 2008) Log Message: ----------- Do not use load_seg_vm to load CS in real mode iret handling load_seg_vm calls cpu_x86_load_seg_cache which updates hflags of current env, real hardware doesn't do this, nor the code that handles real mode lret/lcall/ljmp. This unbreaks "unreal mode" and makes QEMU the first emulator being able to run Project Angel demo by IMPACT Studios. (Not that there are many physical machines out there capable of doing the same) Modified Paths: -------------- trunk/target-i386/op_helper.c Modified: trunk/target-i386/op_helper.c =================================================================== --- trunk/target-i386/op_helper.c 2008-10-02 19:55:50 UTC (rev 5402) +++ trunk/target-i386/op_helper.c 2008-10-02 20:02:27 UTC (rev 5403) @@ -2651,7 +2651,8 @@ POPW(ssp, sp, sp_mask, new_eflags); } ESP = (ESP & ~sp_mask) | (sp & sp_mask); - load_seg_vm(R_CS, new_cs); + env->segs[R_CS].selector = new_cs; + env->segs[R_CS].base = (new_cs << 4); env->eip = new_eip; if (env->eflags & VM_MASK) eflags_mask = TF_MASK | AC_MASK | ID_MASK | IF_MASK | RF_MASK | NT_MASK;