Received: from eggs.gnu.org ([2001:4830:134:3::10]:52318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YamBJ-0007y3-Vv for qemu-devel@nongnu.org; Wed, 25 Mar 2015 10:21:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YamBF-00017B-TI for qemu-devel@nongnu.org; Wed, 25 Mar 2015 10:21:17 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:35755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YamBF-00016L-9F for qemu-devel@nongnu.org; Wed, 25 Mar 2015 10:21:13 -0400 Received: by wibbg6 with SMTP id bg6so26062115wib.0 for ; Wed, 25 Mar 2015 07:21:12 -0700 (PDT) From: Duarte Silva Date: Wed, 25 Mar 2015 14:20:59 +0000 Message-ID: <13996240.6S33Ckap3f@lczc1207b1zdcs> In-Reply-To: <5512B46A.4080208@imgtec.com> References: <8111192.6dZICC2BlA@lczc1207b1zdcs> <5512B46A.4080208@imgtec.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Subject: Re: [Qemu-devel] Support for NetLogic XLP Processors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: James Hogan Cc: qemu-devel@nongnu.org On Wednesday 25 March 2015 13:13:14 James Hogan wrote: > Hi Duarte, > > On 22/03/15 11:13, Duarte Silva wrote: > > Hi guys, > > > > I have been struggling to get some binaries compiled for NetLogic XLP > > processor to run under QEMU. I have tried a bunch of things (most going > > back and forth) and always get the following error message: > > > > qemu: uncaught target signal 4 (Illegal instruction) - core dumped > > Illegal instruction > > > > I tried to debug it using GDB but to no avail. Does anybody have ideas? > > I'm > > running QEMU 2.2.1. > > It sounds like the program had an instruction that QEMU doesn't > recognise, or doesn't think should be allowed on the current CPU which > you've set with -cpu. You might be able to find out what that > instruction is by putting this on your qemu command line: > > -singlestep -d in_asm Hi James, thanks for the help :) I have tried with all the CPU's available. None of them worked, so I just leave it as undefined. It seems the offending instruction is "udi4". (...) IN: 0x765d1fa4: udi4 a0,v0,zero,0x0 OUT: [size=84] 0x606026b0: mov -0x4(%r14),%ebp 0x606026b4: test %ebp,%ebp 0x606026b6: jne 0x606026f5 0x606026bc: mov $0x765d1fa4,%ebp 0x606026c1: mov %ebp,0x80(%r14) 0x606026c8: mov %r14,%rdi 0x606026cb: mov $0x14,%esi 0x606026d0: callq 0x600acaa0 0x606026d5: jmpq 0x606026da 0x606026da: mov $0x765d1fa8,%ebp 0x606026df: mov %ebp,0x80(%r14) 0x606026e6: mov $0x7fe1de9d3bc0,%rax 0x606026f0: jmpq 0x62561d26 0x606026f5: mov $0x7fe1de9d3bc3,%rax 0x606026ff: jmpq 0x62561d26 do_raise_exception_err: 20 0 qemu: uncaught target signal 4 (Illegal instruction) - core dumped Illegal instruction I have found on QEMU code the following definitions for udi4 (on file disas/mips.c): {"udi4", "s,t,d,+1", 0x70000014, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 }, {"udi4", "s,t,+2", 0x70000014, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 }, {"udi4", "s,+3", 0x70000014, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 }, {"udi4", "+4", 0x70000014, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 }, Does any of these match the above instruction? It seems so no? Cheers, Duarte > > that will cause it to only translate one instruction at a time, and to > dump each one as it is translated. The last one printed will very likely > to be the one that is causing the problem. > > Cheers > James