Date: Fri, 04 Apr 2014 15:40:26 -0700 From: Sean Bruno <sbruno@ignoranthack.me> To: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: qemu-mips illegal instruction Message-ID: <1396651226.1475.41.camel@powernoodle.corp.yahoo.com> In-Reply-To: <1396635066.1475.25.camel@powernoodle.corp.yahoo.com> References: <1395337352.7757.11.camel@powernoodle.corp.yahoo.com> <1395599440.67694.13.camel@powernoodle.corp.yahoo.com> <1396029630.1466.21.camel@powernoodle.corp.yahoo.com> <1396635066.1475.25.camel@powernoodle.corp.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-Di3akOeZV/gld1+wE4Nv Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2014-04-04 at 11:11 -0700, Sean Bruno wrote: > On Fri, 2014-03-28 at 11:00 -0700, Sean Bruno wrote: > > > This problem seems to be caused by a endian issue in qemu-mips. Ed > > > Maste found the culprit and I've applied it here: > > >=20 > > > https://github.com/seanbruno/qemu/commit/05ee8495804599b52a88eb36b13e= a9c06b3207cd > > >=20 > > > Which is my combined tracking branch for qemu and sson's bsd-user > > > branch. > > >=20 > > > I'm currently tracking an "illegal instruction" on exit issue that se= ems > > > to happen on application exit causing a crash. > > >=20 > > > sean > >=20 > >=20 > > I've been tracking qemu upstream with sson's patches and massaging > > things here and there with the bsd-user mode qemu. > >=20 > > https://github.com/seanbruno/qemu/tree/bsd-user > >=20 > > That in combination with sson's kernelmod/userland tool allows me to > > "chroot" into a mips environment suitable for building packages. > > http://people.freebsd.org/~sson/imgact_binmisc/imgact_binmisc.diff > >=20 > > Currently, if I explicitly pass a shell into the chroot command, I have > > no issues and all is well. e.g. chroot /mipsbuild /bin/sh > >=20 > > If I do not explicitly pass a shell, I get an illegal instruction core > > dump from qemu-mips on exit from any command I run in the chroot: > >=20 > > chroot /mipsbuild > > uname -a > > <uname output> > > (Illegal Instruction)[coredump] > >=20 > > This breaks poudriere right now. > >=20 > >=20 > > More or less this is my recipe: > > - built a mips32 world for "chroot" purposes: > > - use sson's binmisc ELF interceptor thing: > > - run binmiscctl: > > binmiscctl add mips32 --interpreter "/bin/qemu-mips" --magic "\x7f\x45 > > \x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00 > > \x08" --mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff > > \xff\xff\xff\xfe\xff\xff" --size 20 --set-enabled > >=20 > >=20 > > - chroot /mipsbuild > > - uname -a (Illegal Instruction and coredump ON EXIT) > >=20 > > - chroot /mipsbuild /bin/sh > > - uname -a (works everytime) > >=20 > >=20 > > sean >=20 > I've narrowed this down with some help from #bsdmips: >=20 > env SHELL=3D/bin/sh chroot /mipsbuild --> no issues running commands >=20 > env SHELL=3D/bin/csh chroot /mipsbuild > env SHELL=3D/bin/tcsh chroot /mipsbuild --> both of these cause illegal > instructions in qemu-mips >=20 > Juregen came up with a patch that makes the amd64 version of qemu-mips > work, so there's no need to xbuild the i386 version now, so thanks for > that! >=20 > sean >=20 > ref https://github.com/seanbruno/qemu/tree/bsd-user >=20 >=20 And finally, thanks to peter, we have a 1bit change for 32bit mips that seems to work. https://github.com/seanbruno/qemu/commit/d62553b108aa27c0c020dbb771d29f8673= 807a3b Doing a test run now. this might mean that 32bit mips packages might exist this weekend in some form. sean --=-Di3akOeZV/gld1+wE4Nv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJTPzTaAAoJEBkJRdwI6BaHs2oH/i0/aWrB/a1lDo1Gsq4Dr5Iu XopvIfXZqyT8PULkiRWRVYk2/0LR2u0nOAR0YE4NL4qj8YWCZ7xjeV3THels/1UR 9UMo2RJLBrZLAYhxD6U25qoqz2VoiLD9y+Mz8gX6L2R343hMfkYCriJxaR4qAPmi Yd2aX77MloG6WPLjPXfMn9DAIbL7iGLA1Rpbnh3c/4LlalxDnf7Uw5Y80byYXL9L JOlL3pEUixawxBlqCNvZLHapYg4Sf0eUkAMFWqH9a7hMc/9BUFyzo7L+mIn0MPQl NcOWyVtvtXkAlvDAO7hEN/sWMjLNNhH2LjMnkDK7LxbOB7Jyy76eZ8QGH98GWdM= =nB2+ -----END PGP SIGNATURE----- --=-Di3akOeZV/gld1+wE4Nv--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1396651226.1475.41.camel>