From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HTj4t-0003gQ-1w for qemu-devel@nongnu.org; Tue, 20 Mar 2007 14:28:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HTj4r-0003gE-K8 for qemu-devel@nongnu.org; Tue, 20 Mar 2007 14:28:58 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HTj4r-0003gB-Dp for qemu-devel@nongnu.org; Tue, 20 Mar 2007 13:28:57 -0500 Received: from moutng.kundenserver.de ([212.227.126.179]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HTj3G-0006TL-5D for qemu-devel@nongnu.org; Tue, 20 Mar 2007 14:27:18 -0400 Message-ID: <4600277F.6070804@mail.berlios.de> Date: Tue, 20 Mar 2007 19:27:11 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [Bug] [Patch] MIPS code fails at branch instruction References: <45FB245C.2010900@mail.berlios.de> <20070317143106.GF25863@networkno.de> <45FC3A07.3070302@weilnetz.de> <200703172032.52010.paul@codesourcery.com> <45FEFAC0.4060901@mail.berlios.de> <20070319213445.GJ28895@networkno.de> <20070319223449.GK28895@networkno.de> In-Reply-To: <20070319223449.GK28895@networkno.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thiemo Seufer , QEMU Developers Hi, here is the patch which adds a "4KEcR1" CPU (a 4KEc, processor revision 2.2, with MIPS32 Release 1 (!) instruction set is the heart of the AR7 SoC). See also include/asm-mips/cpu.h in the Linux kernel sources: ./include/asm-mips/cpu.h:#define PRID_IMP_4KEC 0x8400 ./include/asm-mips/cpu.h:#define PRID_IMP_4KECR2 0x9000 Stefan PS. Did anybody run my branch test code on other MIPS CPUs? What was the result? Sorry, because of trouble with the Savannah CVS server, the patch is not against CVS. --- ../branches/head/target-mips/translate_init.c 2007-03-18 01:30:29.000000000 +0100 +++ target-mips/translate_init.c 2007-03-20 18:47:59.000000000 +0100 @@ -44,6 +44,12 @@ .CP0_Config1 = MIPS_CONFIG1, }, { + .name = "4KEcR1", + .CP0_PRid = 0x00018448, + .CP0_Config0 = MIPS_CONFIG0, + .CP0_Config1 = MIPS_CONFIG1, + }, + { .name = "24Kf", .CP0_PRid = 0x00019300, .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR), Thiemo Seufer schrieb: > Thiemo Seufer wrote: > [snip] > I committed something which cover the rest of your patch, and throws > now a RI exception for branch-in-branch-delay-slot. > > For the AR7 case, could you > - add AR7 as a CPU type > - handle the interesting cases for AR7 only, after verifying the > cornercase behaviour of qemu and real hardware is consistent. > > The cornercases which come to mind: > - conditional vs. unconditional branches > - the various condition types > - taken vs. non-taken branches > - linked vs. non-linked branches > - likely vs. non-likely branches > - the side effects of j / jal in the delayslot > - the value of PC/ra (if it changes) > > I don't ask for an exhaustive analysis, I just want to see the cases of > interest covered, so we can be reasonably sure the qemu results will be > useful for other AR7 users as well. > > > Thiemo