From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1In3o0-00011G-GM for qemu-devel@nongnu.org; Tue, 30 Oct 2007 22:59:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1In3nz-000107-TM for qemu-devel@nongnu.org; Tue, 30 Oct 2007 22:59:44 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1In3nz-0000zp-Lt for qemu-devel@nongnu.org; Tue, 30 Oct 2007 22:59:43 -0400 Received: from kuber.nabble.com ([216.139.236.158]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1In3nz-0001Db-8y for qemu-devel@nongnu.org; Tue, 30 Oct 2007 22:59:43 -0400 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1In3nx-0007N8-P2 for qemu-devel@nongnu.org; Tue, 30 Oct 2007 19:59:41 -0700 Message-ID: <13502111.post@talk.nabble.com> Date: Tue, 30 Oct 2007 19:59:41 -0700 (PDT) From: TeLeMan Subject: Re: [Qemu-devel] [PATCH]bug fix for softmmu slow_st unaligned access In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <13449885.post@talk.nabble.com> 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 andrzej zaborowski wrote: > > Hi, > > On 28/10/2007, TeLeMan wrote: >> For example, the memory address 0x10008000 is on an unwritable page.When >> the >> instruction "add dword ptr [0x10007FFF],0x12345678" is executed,the OS >> will >> set 0x10008000 page be a writable page and re-execute this instruction. >> But >> softmmu has modifed the value of 0x10007FFF,so after re-executing this >> instruction, the final result is wrong(double-added on 0x10007FFF). >> Reversing the stored byte order can fix this bug. > > I'm not sure I understand, but what happens if now the 10008000 page > is writable and 10007fff isn't, thus the OS needs to make it writable > and re-execute? I guess reversing the accesses order is not a > solution? > > Regards, > Andrew > > If the 0x10008000 page is writable and 0x10007FFF isn't, softmmu can raise this exception before modifing 0x10007FFF-0x10008002 because softmmu checks 0x10007FFF at first. I don't know if reversing the order is an exact solution,but its simple and working. btw, I found this bug because I found the some windows dll reloc offset are calculated incorrectly by the guest OS. If you need a sample, I can give it to you. -- View this message in context: http://www.nabble.com/-PATCH-bug-fix-for-softmmu-slow_st-unaligned-access-tf4705397.html#a13502111 Sent from the QEMU - Dev mailing list archive at Nabble.com.