Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754651AbaLDUc3 (ORCPT ); Thu, 4 Dec 2014 15:32:29 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:59122 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbaLDUc2 (ORCPT ); Thu, 4 Dec 2014 15:32:28 -0500 Date: Thu, 4 Dec 2014 20:32:24 +0000 (GMT) From: "Maciej W. Rozycki" To: David Daney cc: Leonid Yegoshin , David Daney , linux-mips@linux-mips.org, Ralf Baechle , Zubair.Kakakhel@imgtec.com, geert+renesas@glider.be, peterz@infradead.org, paul.gortmaker@windriver.com, chenhc@lemote.com, cl@linux.com, Ingo Molnar , richard@nod.at, zajec5@gmail.com, james.hogan@imgtec.com, keescook@chromium.org, tj@kernel.org, alex@alex-smith.me.uk, pbonzini@redhat.com, blogic@openwrt.org, paul.burton@imgtec.com, qais.yousef@imgtec.com, linux-kernel@vger.kernel.org, markos.chandras@imgtec.com, dengcheng.zhu@imgtec.com, manuel.lauss@gmail.com, lars.persson@axis.com, David Daney Subject: Re: [PATCH 2/3] MIPS: Add full ISA emulator. In-Reply-To: <54809C88.8060601@caviumnetworks.com> Message-ID: References: <1417650258-2811-1-git-send-email-ddaney.cavm@gmail.com> <1417650258-2811-3-git-send-email-ddaney.cavm@gmail.com> <547FA2E5.1040105@imgtec.com> <547FA8D2.2030703@caviumnetworks.com> <54809C88.8060601@caviumnetworks.com> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 4 Dec 2014, David Daney wrote: > > GAS will happily schedule any instruction into a branch delay slot as > > long as the instruction is not architecturally forbidden there (e.g. > > ERET), there is no data dependency with the branch that would affect the > > result produced and the instruction is not an explicit exception trap > > operation (BREAK, SYSCALL, TEQ, etc.). For some reason, unknown to me all > > MT ASE instructions are disallowed too. Anything else -- free to go in! > > > > Of course instructions can be scheduled into branch delay slots manually > > too, in handcoded assembly, and that has to continue working. > > > > It is not difficult to also emulate the trapping instructions. In order to > move forward, I will implement the trapping instructions in my emulator for > the next patch. I'd be more concerned about getting the more exotic instructions or cases right (did you get MADDU right for SmartMIPS processors and set the ACX register on them?) -- how do you propose to validate and regression-test the emulator in a reproducible manner? The combination of the rare case of an instruction being placed in an FP branch delay slot and the rarity of some instructions themselves makes me scared of bugs lurking there forever and occasionally biting people -- who may not be aware that software emulation is involved let alone be capable to track them down -- in the most frustrating way. To say nothing of the infinite amount of effort to maintain the emulator associated with adding architectural and vendor-specific instructions. See how much effort has been put into QEMU and still it does not get all the MIPS instruction set bits right. Maciej -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/