From owner-freebsd-mips@FreeBSD.ORG Sun Oct 19 02:18:46 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB9E13C2 for ; Sun, 19 Oct 2014 02:18:45 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BB1A8A2 for ; Sun, 19 Oct 2014 02:18:45 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id l18so3209250wgh.5 for ; Sat, 18 Oct 2014 19:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=zDTecsS1csn4uAMU+NzNglJ9AVlcdGcK464Wc0qyH/4=; b=R2MB9NoZczcJGT5HKab3rXG9QPZtdlSKG4kBFfg2Z+XgIuPNXX3mwrv7f4NJVW633q 1tmhA0beLf8EaXOvYl+N1gmBM9uDmEFKBbMKwPjz4Vr9Cv6D1WrEvdQGSkHjn9TmQJrS hS04+glx9zRHIZSk4TQ2DW87aLc72PDIqJDkWNVW/a3R68OTGB1ynFU6D59Kja7fChmm xU7okIYK8HOt6aLDju7dTPx/ZsgKltiUl3cRuEDCYRfI3jHEGS5Km1hxWNsaZAhw5ULS 08ZbKJoi4pr1//PmTFQrud3NeSG1hsXs17zIJoFg5jeDewJbxoJbAyMv6KN5clWHIdY+ 0Rsg== MIME-Version: 1.0 X-Received: by 10.194.2.8 with SMTP id 8mr22176587wjq.85.1413685123782; Sat, 18 Oct 2014 19:18:43 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 18 Oct 2014 19:18:43 -0700 (PDT) In-Reply-To: <20141018225950.GA12023@anubis.morrow.me.uk> References: <20141018225950.GA12023@anubis.morrow.me.uk> Date: Sat, 18 Oct 2014 19:18:43 -0700 X-Google-Sender-Auth: ViKwf-no-ZeLyqy4_UryQm56cCQ Message-ID: Subject: Re: Trying to get MALTA64 running under qemu From: Adrian Chadd To: Ben Morrow Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2014 02:18:46 -0000 Hi, can you try qemu-devel? -a On 18 October 2014 15:59, Ben Morrow wrote: > I'm considering buying an ERL to use as a local router, but before I did > I thought I'd make sure the ports I want to run work properly with MIPS, > so I'm trying to bring up a qemu-system-mips64 instance. I've built > world and kernel (using MALTA64) for mips.mips64, and built a disk image > following the instructions on the MipsEmulation page on the wiki. The > source I am using is a slightly patched 10-STABLE from 2014-09-09; the > patches have nothing to do with MIPS. > > However, when I try to bring qemu up, the system appears to hang after > probing the ata devices. Over the course of about 30 seconds the qemu > process goes up to 100% of one CPU, and no more output appears on the > console. This appears to happen regardless of the disk images I pass to > qemu; I've tried passing a UFS image, a file full of zeros, no disks at > all, and (just in case) both -hda and -hdc. I've included the boot log > below; I'd appreciate any advice. > > Ben > > % uname -m > amd64 > % pkg info -E qemu > qemu-0.11.1_16 > % qemu-system-mips64 -M malta -kernel yarrow.kernel -hda yarrow.ufs -nographic > entry: platform_start() > cmd line: yarrow.kernel > envp: > memsize = 134217728 > modetty0 = 38400n8r > memsize = 08000000 > Cache info: > picache_stride = 4096 > picache_loopcount = 8 > pdcache_stride = 4096 > pdcache_loopcount = 8 > cpu0: MIPS Technologies processor v160.130 > MMU: Standard TLB, 48 entries > L1 i-cache: 4 ways of 256 sets, 32 bytes per line > L1 d-cache: 4 ways of 256 sets, 32 bytes per line > Config1=0xdea3519b > Physical memory chunk(s): > 0x622000 - 0x7ffffff, 127787008 bytes (31198 pages) > Maxmem is 0x8000000 > KDB: debugger backends: ddb > KDB: current backend: ddb > Copyright (c) 1992-2014 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 10.1-PRERELEASE #0 3c1e5d7(mauzo/10-S): Sat Oct 18 02:43:24 BST 2014 > root@anubis:/usr/obj/mips.mips64/usr/src/sys/MALTA64 mips > gcc version 4.2.1 20070831 patched [FreeBSD] > Preloaded elf kernel "kernel" at 0xffffffff8061b2c0. > real memory = 134217728 (131072K bytes) > Physical memory chunk(s): > 0x0073f000 - 0x07cadfff, 123138048 bytes (30063 pages) > avail memory = 121868288 (116MB) > random device not loaded; using insecure entropy > mem: > null: > nfslock: pseudo-device > nexus0: > gt0: on nexus0 > pcib0: on gt0 > pci0: on pcib0 > pci0: domain=0, physical bus=0 > found-> vendor=0x11ab, dev=0x4620, revid=0x10 > domain=0, bus=0, slot=0, func=0 > class=06-00-00, hdrtype=0x00, mfdev=0 > cmdreg=0x0000, statreg=0x0280, cachelnsz=0 (dwords) > lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) > intpin=a, irq=0 > map[14]: type Prefetchable Memory, range 32, base 0x1000000, size 24, memory disabled > map[18]: type Memory, range 32, base 0x1c000000, size 26, memory disabled > map[1c]: type Memory, range 32, base 0x1f000000, size 24, memory disabled > map[20]: type Memory, range 32, base 0x14000000, size 26, memory disabled > map[24]: type I/O Port, range 32, base 0x14000000, size 26, port disabled > pcib0: no IRQ mapping for 0/0/0/1 > found-> vendor=0x8086, dev=0x7110, revid=0x00 > domain=0, bus=0, slot=10, func=0 > class=06-01-00, hdrtype=0x00, mfdev=1 > cmdreg=0x0007, statreg=0x0200, cachelnsz=0 (dwords) > lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) > found-> vendor=0x8086, dev=0x7111, revid=0x00 > domain=0, bus=0, slot=10, func=1 > class=01-01-80, hdrtype=0x00, mfdev=0 > cmdreg=0x0000, statreg=0x0280, cachelnsz=0 (dwords) > lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) > map[20]: type I/O Port, range 32, base 0, size 4, port disabled > found-> vendor=0x8086, dev=0x7112, revid=0x01 > domain=0, bus=0, slot=10, func=2 > class=0c-03-00, hdrtype=0x00, mfdev=0 > cmdreg=0x0000, statreg=0x0000, cachelnsz=0 (dwords) > lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) > intpin=d, irq=0 > map[20]: type I/O Port, range 32, base 0, size 5, port disabled > pcib0: no IRQ mapping for 0/10/2/4 > found-> vendor=0x8086, dev=0x7113, revid=0x03 > domain=0, bus=0, slot=10, func=3 > class=06-80-00, hdrtype=0x00, mfdev=0 > cmdreg=0x0000, statreg=0x0280, cachelnsz=0 (dwords) > lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) > intpin=a, irq=0 > pcib0: no IRQ mapping for 0/10/3/1 > found-> vendor=0x1022, dev=0x2000, revid=0x10 > domain=0, bus=0, slot=11, func=0 > class=02-00-00, hdrtype=0x00, mfdev=0 > cmdreg=0x0007, statreg=0x0280, cachelnsz=0 (dwords) > lattimer=0x00 (0 ns), mingnt=0x06 (1500 ns), maxlat=0xff (63750 ns) > intpin=a, irq=0 > map[10]: type I/O Port, range 32, base 0, size 5, enabled > map[14]: type Memory, range 32, base 0, size 5, enabled > found-> vendor=0x1013, dev=0x00b8, revid=0x00 > domain=0, bus=0, slot=18, func=0 > class=03-00-00, hdrtype=0x00, mfdev=0 > cmdreg=0x0003, statreg=0x0000, cachelnsz=0 (dwords) > lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) > map[10]: type Prefetchable Memory, range 32, base 0, size 25, enabled > map[14]: type Memory, range 32, base 0, size 12, enabled > uart0: on obio0 > uart0: console (9600,n,8,1) > uart0: fast interrupt > pci0: at device 10.0 (no driver attached) > atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376 at device 10.1 on pci0 > atapci0: Lazy allocation of 0x10 bytes rid 0x20 type 4 at 0x100 > ata0: at channel 0 on atapci0 > ata1: at channel 1 on atapci0 > pci0: at device 10.2 (no driver attached) > pci0: at device 10.3 (no driver attached) > le0: irq 10 at device 11.0 on pci0 > le0: Lazy allocation of 0x20 bytes rid 0x10 type 4 at 0x120 > le0: 16 receive buffers, 4 transmit buffers > le0: bpf attached > le0: Ethernet address: 52:54:00:12:34:56 > vgapci0: at device 18.0 on pci0 > vgapci0: Boot video device > clock0: on nexus0 > Timecounter "MIPS32" frequency 100000000 Hz quality 800 > Event timer "MIPS32" frequency 100000000 Hz quality 800 > Device configuration finished. > Timecounters tick every 10.000 msec > tcp_init: net.inet.tcp.tcbhashsize auto tuned to 2048 > lo0: bpf attached > ata0: reset tp1 mask=03 ostat0=50 ostat1=00 > ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00 > ata0: stat1=0x00 err=0x00 lsb=0xff msb=0xff > ata0: reset tp2 stat0=50 stat1=00 devices=0x1 > ata1: reset tp1 mask=03 ostat0=50 ostat1=00 > ata1: stat0=0x00 err=0x01 lsb=0x14 msb=0xeb > ata1: stat1=0x00 err=0x00 lsb=0xff msb=0xff > ata1: reset tp2 stat0=00 stat1=00 devices=0x10000 > > (The emulator hangs at this point. I've left it for over an hour and it > just sits there at 100% CPU, making no further progress.) > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" From owner-freebsd-mips@FreeBSD.ORG Sun Oct 19 22:34:56 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 132E61BD; Sun, 19 Oct 2014 22:34:56 +0000 (UTC) Received: from isis.morrow.me.uk (isis.morrow.me.uk [204.109.63.142]) by mx1.freebsd.org (Postfix) with ESMTP id DA6E8105; Sun, 19 Oct 2014 22:34:55 +0000 (UTC) Received: from anubis.morrow.me.uk (unknown [93.89.81.46]) (Authenticated sender: mauzo) by isis.morrow.me.uk (Postfix) with ESMTPSA id D028445089; Sun, 19 Oct 2014 22:34:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 isis.morrow.me.uk D028445089 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=morrow.me.uk; s=dkim201101; t=1413758093; bh=QzsSMVJXybb14qJRxQpL17C5lKnWzDUkYWq7336Bo9s=; h=Date:From:To:Subject:References:In-Reply-To; b=Dzaqt/ibdKtGBF+6+hU8Fio0nGfQ48IgigVuGmiQ0r4tdXjV/AcjRfmV2L9XFR9Vn apn1vOJcgZlsLIE8ZArNZbbywbFEqqh1kumS8ZX636zGpFA1/WxLC2w1UfqIiD+TTB zADnLfr78H+epoY8k8ZlePdeY9+mHUXTWm6Ey1GI= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.98.4 at isis.morrow.me.uk Received: by anubis.morrow.me.uk (Postfix, from userid 5001) id BBFB115EC7; Sun, 19 Oct 2014 23:34:47 +0100 (BST) Date: Sun, 19 Oct 2014 23:34:47 +0100 From: Ben Morrow To: Adrian Chadd , freebsd-mips@freebsd.org Subject: Re: Trying to get MALTA64 running under qemu Message-ID: <20141019223447.GB12023@anubis.morrow.me.uk> References: <20141018225950.GA12023@anubis.morrow.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2014 22:34:56 -0000 Adrian Chadd wrote: > On 18 October 2014 15:59, Ben Morrow wrote: > > I'm considering buying an ERL to use as a local router, but before I did > > I thought I'd make sure the ports I want to run work properly with MIPS, > > so I'm trying to bring up a qemu-system-mips64 instance. I've built > > world and kernel (using MALTA64) for mips.mips64, and built a disk image > > following the instructions on the MipsEmulation page on the wiki. The > > source I am using is a slightly patched 10-STABLE from 2014-09-09; the > > patches have nothing to do with MIPS. > > > > However, when I try to bring qemu up, the system appears to hang after > > probing the ata devices. Over the course of about 30 seconds the qemu > > process goes up to 100% of one CPU, and no more output appears on the > > console. This appears to happen regardless of the disk images I pass to > > qemu; I've tried passing a UFS image, a file full of zeros, no disks at > > all, and (just in case) both -hda and -hdc. I've included the boot log > > below; I'd appreciate any advice. > > can you try qemu-devel? Thank you, that works. (Good God, it's slow... I wonder how hard it would be to replace cc with something that runs a cross-compiler on the host? Maybe I can do something with distcc...) Ben From owner-freebsd-mips@FreeBSD.ORG Sun Oct 19 22:50:19 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7961F474 for ; Sun, 19 Oct 2014 22:50:19 +0000 (UTC) Received: from mail-lb0-x22c.google.com (mail-lb0-x22c.google.com [IPv6:2a00:1450:4010:c04::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB390206 for ; Sun, 19 Oct 2014 22:50:18 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id b6so2970470lbj.31 for ; Sun, 19 Oct 2014 15:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clockworksquid.com; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=yjpNqjMeyEokBuY9bYiNbBNDmH4gw5JmPUCtefAWPQk=; b=f6QbDoMzrehXIMfmp/MrDM34WKmhX2MSkve5ZULToKkIZRsmVNqnG7bgyBexUxkMJ6 TUXzC8TFmbwF1gfXarqwKlZUWD9mTPQbMJocB2mv0K7a3kp0oy+3JJ0zfogNRYBI0Rm9 UFkYkMyO3qjprpINIVxVAxnEWU3idGZOAuTF4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=yjpNqjMeyEokBuY9bYiNbBNDmH4gw5JmPUCtefAWPQk=; b=UrOGvBQXdVFKnaQq2PR1kdUdSEGHt0aq4attzqy4DrUKz1O/Ic2/Uni7VUj9ufRBAp xrZmASPlKlKxx+cat3/G2f+ZhS+OUWnlHWeSsO7YFo9GGxK/SHwfnpuQMo/NPsv/Nqiu m4TZjtKbWnvmeFZZBoj7SsNvXUTL7MOoOM2ErSxHtZJHeCLMXJ+UnFJOuk0hUYCyK9dV lBEERqpjhZb71SABAsWHr4IETMZFOEd67pHDOEsf1w6Ak12hWUa7yURjDYDEmgSP6UU0 v/z7243npPpwV3gnnYLnrrW1AluLdHE4Dy2LKPtDeVuZxl/JhZHgor1vetRVG6S2sPo/ qREw== X-Gm-Message-State: ALoCoQl/B+aP4/nolq6M1p3Vwi/yO9kYDcCNVwMXiXM3sBW2ca1XKwFj8dzRhzghalQPHxl22ktc X-Received: by 10.112.140.135 with SMTP id rg7mr23660036lbb.24.1413759016684; Sun, 19 Oct 2014 15:50:16 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.113.226 with HTTP; Sun, 19 Oct 2014 15:49:56 -0700 (PDT) In-Reply-To: <20141019223447.GB12023@anubis.morrow.me.uk> References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> From: Juli Mallett Date: Sun, 19 Oct 2014 15:49:56 -0700 X-Google-Sender-Auth: DO4Rwtq9xofU8Xjnd0ENCj7VGSo Message-ID: Subject: Re: Trying to get MALTA64 running under qemu To: Ben Morrow Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-mips@FreeBSD.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2014 22:50:19 -0000 On Sun, Oct 19, 2014 at 3:34 PM, Ben Morrow wrote: > Adrian Chadd wrote: > > On 18 October 2014 15:59, Ben Morrow wrote: > > > I'm considering buying an ERL to use as a local router, but before I > did > > > I thought I'd make sure the ports I want to run work properly with > MIPS, > > > so I'm trying to bring up a qemu-system-mips64 instance. I've built > > > world and kernel (using MALTA64) for mips.mips64, and built a disk > image > > > following the instructions on the MipsEmulation page on the wiki. The > > > source I am using is a slightly patched 10-STABLE from 2014-09-09; th= e > > > patches have nothing to do with MIPS. > > > > > > However, when I try to bring qemu up, the system appears to hang afte= r > > > probing the ata devices. Over the course of about 30 seconds the qemu > > > process goes up to 100% of one CPU, and no more output appears on the > > > console. This appears to happen regardless of the disk images I pass = to > > > qemu; I've tried passing a UFS image, a file full of zeros, no disks = at > > > all, and (just in case) both -hda and -hdc. I've included the boot lo= g > > > below; I'd appreciate any advice. > > > > can you try qemu-devel? > > Thank you, that works. (Good God, it's slow... I wonder how hard it > would be to replace cc with something that runs a cross-compiler on the > host? Maybe I can do something with distcc...) > The optimal thing here is to use a user-mode emulator, whereby you can effectively run a MIPS userland through qemu on a FreeBSD host, so all of the kernel stuff is being done natively =E2=80=94 which is a lot for things= like package building; others have done this for ARM, and I believe that one of the groups using FreeBSD/MIPS was looking at doing so for MIPS as well for the sake of package builds, etc. You might create a new thread for user-mode MIPS emulation to see if any of the right people notice and respond, or perhaps dig into what the ARM folks have done. Thanks, Juli. From owner-freebsd-mips@FreeBSD.ORG Mon Oct 20 01:31:24 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6250564F; Mon, 20 Oct 2014 01:31:24 +0000 (UTC) Received: from mail-qg0-x230.google.com (mail-qg0-x230.google.com [IPv6:2607:f8b0:400d:c04::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0E3D28A; Mon, 20 Oct 2014 01:31:23 +0000 (UTC) Received: by mail-qg0-f48.google.com with SMTP id i50so2785187qgf.7 for ; Sun, 19 Oct 2014 18:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=7NFMj5JuyhemqAEBCozhcw6ygYq+EtDQpNxsKkUxl2I=; b=JNPixWKo0gpIVGhy/uLI/j9R0d+w1BAgwWPFATLqWvYSmsu5q8yCanKO/Dhei3C7Wo CfX5quTKcEOrRQH5iJny5dTijpDXExi5sK/X49kxFjyK6bNOw/k5mWSYreZOO6gS+z5V EIpyfemqHctItFXQpF3koNJ+PBSQQa9mmPzVOcBgRtlhCamVWtiDUHuh27SqmYneJ+E2 K7ygYzwsg8VoE3AAOrkQlmrkFytdOuqKt0Xun8d/H+LPxv4CIbNHNylPW6CZyaojnxbv mWWFoqOJMFcpw1BZHgZLX20PGWZXl/M2mWjEyWHfQluvjsrk6dRGW4d3I9iObSdke5xD YF5w== X-Received: by 10.229.40.71 with SMTP id j7mr31529745qce.21.1413768683136; Sun, 19 Oct 2014 18:31:23 -0700 (PDT) Received: from kan ([2601:6:6780:7d0:226:18ff:fe00:232e]) by mx.google.com with ESMTPSA id m9sm6732714qac.18.2014.10.19.18.31.22 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 19 Oct 2014 18:31:22 -0700 (PDT) Date: Sun, 19 Oct 2014 21:31:15 -0400 From: Alexander Kabaev To: Juli Mallett Subject: Re: Trying to get MALTA64 running under qemu Message-ID: <20141019213115.336c997f@kan> In-Reply-To: References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/9LdL6l8iLSBHKJbl6ezXTP0"; protocol="application/pgp-signature" Cc: Ben Morrow , "freebsd-mips@FreeBSD.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2014 01:31:24 -0000 --Sig_/9LdL6l8iLSBHKJbl6ezXTP0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Sun, 19 Oct 2014 15:49:56 -0700 Juli Mallett wrote: > On Sun, Oct 19, 2014 at 3:34 PM, Ben Morrow wrote: >=20 > > Adrian Chadd wrote: > > > On 18 October 2014 15:59, Ben Morrow wrote: > > > > I'm considering buying an ERL to use as a local router, but > > > > before I > > did > > > > I thought I'd make sure the ports I want to run work properly > > > > with > > MIPS, > > > > so I'm trying to bring up a qemu-system-mips64 instance. I've > > > > built world and kernel (using MALTA64) for mips.mips64, and > > > > built a disk > > image > > > > following the instructions on the MipsEmulation page on the > > > > wiki. The source I am using is a slightly patched 10-STABLE > > > > from 2014-09-09; the patches have nothing to do with MIPS. > > > > > > > > However, when I try to bring qemu up, the system appears to > > > > hang after probing the ata devices. Over the course of about 30 > > > > seconds the qemu process goes up to 100% of one CPU, and no > > > > more output appears on the console. This appears to happen > > > > regardless of the disk images I pass to qemu; I've tried > > > > passing a UFS image, a file full of zeros, no disks at all, and > > > > (just in case) both -hda and -hdc. I've included the boot log > > > > below; I'd appreciate any advice. > > > > > > can you try qemu-devel? > > > > Thank you, that works. (Good God, it's slow... I wonder how hard it > > would be to replace cc with something that runs a cross-compiler on > > the host? Maybe I can do something with distcc...) > > >=20 > The optimal thing here is to use a user-mode emulator, whereby you can > effectively run a MIPS userland through qemu on a FreeBSD host, so > all of the kernel stuff is being done natively - which is a lot for > things like package building; others have done this for ARM, and I > believe that one of the groups using FreeBSD/MIPS was looking at > doing so for MIPS as well for the sake of package builds, etc. You > might create a new thread for user-mode MIPS emulation to see if any > of the right people notice and respond, or perhaps dig into what the > ARM folks have done. >=20 > Thanks, > Juli. There is not much to it, usermode emulation for mips64 just works for the purpose of the package building, that is how I have been doing it for a while now. I did not get the cross-toolchain going on, but even just running package builds under qemu-bsd-user on my amd64 machine lets me take advantage of multiple CPUs and much less restrictive amounts of memory and is a big win. Five lines recipe: 1. build and install emulators/qemu-user-static port or use package 2. build and install mips64 world info some location, say, make it /scratch/mips for the purpose of this recipe. 3. mount devfs info that image: sudo mount -t devfs devfs /scratch/mips/dev 4. copy /usr/local/bin/qemu-mips64-static info some place within the mips64 tree you have created above. /scratch/mips/usr/local/bin/qemu-mips64-static will do nicely. 5. start the mips64 shell:=20 sudo chroot /scratch/mips /usr/local/bin/qemu-mips64-static /bin/sh Voila, you are running in environment that is good enough to build many of the ports. Now, you can start playing with installing cross-tools into that image so that compilers/linkers are native and you do not pay the price of emulation to run them and start writing five line recipes for others :) --=20 Alexander Kabaev --Sig_/9LdL6l8iLSBHKJbl6ezXTP0 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iD8DBQFURGXpQ6z1jMm+XZYRAlH0AJ91s1Z8x+5nI8QZuFU2JLUrvaLAAQCdFk4Q yYNLQws1mv5hmqYo99m6X/k= =BTex -----END PGP SIGNATURE----- --Sig_/9LdL6l8iLSBHKJbl6ezXTP0-- From owner-freebsd-mips@FreeBSD.ORG Mon Oct 20 14:06:02 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42505267 for ; Mon, 20 Oct 2014 14:06:02 +0000 (UTC) Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07E0FD06 for ; Mon, 20 Oct 2014 14:06:01 +0000 (UTC) Received: by mail-ig0-f169.google.com with SMTP id uq10so6421595igb.4 for ; Mon, 20 Oct 2014 07:05:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=TFh+G1NVDBXMTT4u7YwKB8CnRucjtfpJZqhrCTQdrkQ=; b=L6JzJgXzkmOg1OFKTzQiKXmVBdyJo7w5aKneNxIzKpB1tTrfcOfIrlhLAwSJIgOyCa fHjV04d530el7cZLV/B81D4aIvzEmHZtp4q1fsnVrcHhZ26m+g3J1tjAiBA+sFtUtTdV R0skLhuIWlRk4GcCdiko8ArA7nq/M9Ge23+Joymsl2ncNpk4BQa9uTYTDsGuH43zA8ah gHNorR0GeEuUnqpFj1udEvHUL8UMHyGsE1Uct/GIUxPvxZqS4hsFdZZ869yw0FNxUn+o jEI6VRyqR9nSGlBkpmf1I4tOaN9CB81eioqdZhh94RkvLrhwXcT6ME5lileer2nyhjHv eCfQ== X-Gm-Message-State: ALoCoQmT7szS1NZSS7Ea4AZrzzqeyI1dhO4Ub1sA/kKbtj618rPr1QH82jtVaaQxmVlC7W40mQgh X-Received: by 10.50.128.163 with SMTP id np3mr18449352igb.28.1413813954931; Mon, 20 Oct 2014 07:05:54 -0700 (PDT) Received: from bsdimp.bsdimp.com ([50.253.99.174]) by mx.google.com with ESMTPSA id j4sm3831974igx.20.2014.10.20.07.05.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Oct 2014 07:05:54 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_377B3501-0062-4844-9C4D-BF767E5C7A62"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Trying to get MALTA64 running under qemu From: Warner Losh In-Reply-To: <20141019223447.GB12023@anubis.morrow.me.uk> Date: Mon, 20 Oct 2014 08:05:52 -0600 Message-Id: <3A1572B8-1CCE-49FD-BA08-476D0B9D8AB2@bsdimp.com> References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> To: Ben Morrow X-Mailer: Apple Mail (2.1878.6) Cc: freebsd-mips@freebsd.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2014 14:06:02 -0000 --Apple-Mail=_377B3501-0062-4844-9C4D-BF767E5C7A62 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Oct 19, 2014, at 4:34 PM, Ben Morrow wrote: > Adrian Chadd wrote: >> On 18 October 2014 15:59, Ben Morrow wrote: >>> I'm considering buying an ERL to use as a local router, but before I = did >>> I thought I'd make sure the ports I want to run work properly with = MIPS, >>> so I'm trying to bring up a qemu-system-mips64 instance. I've built >>> world and kernel (using MALTA64) for mips.mips64, and built a disk = image >>> following the instructions on the MipsEmulation page on the wiki. = The >>> source I am using is a slightly patched 10-STABLE from 2014-09-09; = the >>> patches have nothing to do with MIPS. >>>=20 >>> However, when I try to bring qemu up, the system appears to hang = after >>> probing the ata devices. Over the course of about 30 seconds the = qemu >>> process goes up to 100% of one CPU, and no more output appears on = the >>> console. This appears to happen regardless of the disk images I pass = to >>> qemu; I've tried passing a UFS image, a file full of zeros, no disks = at >>> all, and (just in case) both -hda and -hdc. I've included the boot = log >>> below; I'd appreciate any advice. >>=20 >> can you try qemu-devel? >=20 > Thank you, that works. (Good God, it's slow... I wonder how hard it > would be to replace cc with something that runs a cross-compiler on = the > host? Maybe I can do something with distcc...) I=92ve been helping Sean Bruno do exactly this, but I think for mips32. = You build a chroot with the full world, then you build x86 binaries to produce = mips32/64 output and replace the cc, et al, in the chroot with those. Makes things = quite a bit faster. Still not quite as fast as a full native cross build, but = much faster than pure user mode and more reliable than the current state of the art = in cross building. Warner --Apple-Mail=_377B3501-0062-4844-9C4D-BF767E5C7A62 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJURRbAAAoJEGwc0Sh9sBEAwnoP/3Euqbp/5sMc9JAP/ygQh8NX ZxpZalataAzZodceCE7kpzWY3CQ/ggHUwq+uCYC0S/nipTBG+Odrwy3azdCvFZXq Jm4hmMfLhzGwzchBbMIDSK9Ak1ioUgl4/4EgD3FYOTaHHfUXha/hdCyE/puKEN5z jyAjeV7a9CWKJ+D91B6zfX5UXL6QK4be+ZGit4Y8gvBdJY0CH6EA3ZTQpo1fmAfn d5GGee8S+bobgZG3gYQ7nXelWlB4E3wcjYkq07cwv7/H0iqql+Il73lmxlb5KX4h WGIcphc+hlepAuhdOnEM+mJYgph8ApsU2aQ/RaTiydaLlAw75PcbEjLzTWQXZpFs g867bYMdCjajmnPMntrYWTksPGu9COOunWaR0rCAi+JxEF961A7Yafb7jzc66he5 vcgw7x8dgiwOnRMYW2U1pBEVo47u3uQVvZdIAYK6FkWatXCluCHzlI2zjTUEGNmx BkTeqtoB1r6kl1/PBJB1th/jEu4aB4QZXRtalLf90gzgN8TKLVqoImkoar0aJzjg 2GqVVMxEtGJPAPd7TCvpvvGbwaMRCI1Jud4Z14oq+Ynj8BSCTXWavNQt/Wd7MIG8 ND8IKYs5JrmmKfSXcAovZL2Itc4RyAPmwLISMPqbe1f7kOrvOtyL+hqMJwnLnzXn t9EGMO8LUZ/sOOta96FQ =aevB -----END PGP SIGNATURE----- --Apple-Mail=_377B3501-0062-4844-9C4D-BF767E5C7A62-- From owner-freebsd-mips@FreeBSD.ORG Mon Oct 20 17:01:58 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9B6D6BC for ; Mon, 20 Oct 2014 17:01:58 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42363B05 for ; Mon, 20 Oct 2014 17:01:58 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id h11so7619420wiw.17 for ; Mon, 20 Oct 2014 10:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=4PanF1v2Nhw2G7WScwPl6ADJYUTC1RwOLYeZDUWA4Kk=; b=xwHBcB+Y0HhqFNcAnfB/f4X1JzrpaFL7QYPWUHKZ9EDDA0E3WfihgPYS1q3aCIekgK +croeewxFHu1rWOIKpWS4ST2EqLiJBjLBBBNsn7q6vc3n6sElZZMadXntSC9FcaoY0+9 sgZh9sRuxraHuXJGq4cSxieeV2jUXzLtNMN0xkdAKj7jRqmO/G2AQwFRo2c9aSFTQzdy Jl8/1DSla4ZR7BPB8tbyrI4lHvvCeQ1+ydMFWJs9LYWHXVId1vy9RQYyl6RikDiPxqyo klcBYRxbHO2/R8nsKeHKWLCwxurrd96ev7ho2pP6J9VCx7klw/pAVbtjX1oo3Tthw4sx Z9lw== MIME-Version: 1.0 X-Received: by 10.180.74.4 with SMTP id p4mr21945401wiv.20.1413824516242; Mon, 20 Oct 2014 10:01:56 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Mon, 20 Oct 2014 10:01:56 -0700 (PDT) In-Reply-To: <20141019223447.GB12023@anubis.morrow.me.uk> References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> Date: Mon, 20 Oct 2014 10:01:56 -0700 X-Google-Sender-Auth: xzLMl6TZlrZpPqK8Bm4kIqjUEiM Message-ID: Subject: Re: Trying to get MALTA64 running under qemu From: Adrian Chadd To: Ben Morrow Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2014 17:01:58 -0000 Would you please post an updated recipe for what you've done to get freebsd-mips64 up on qemu-devel? I'm about to sit down and help Craig figure out how to integrate emulator testing of the base freebsd system, and I'd like that to include booting and testing on MIPS64. Thanks! -a On 19 October 2014 15:34, Ben Morrow wrote: > Adrian Chadd wrote: >> On 18 October 2014 15:59, Ben Morrow wrote: >> > I'm considering buying an ERL to use as a local router, but before I did >> > I thought I'd make sure the ports I want to run work properly with MIPS, >> > so I'm trying to bring up a qemu-system-mips64 instance. I've built >> > world and kernel (using MALTA64) for mips.mips64, and built a disk image >> > following the instructions on the MipsEmulation page on the wiki. The >> > source I am using is a slightly patched 10-STABLE from 2014-09-09; the >> > patches have nothing to do with MIPS. >> > >> > However, when I try to bring qemu up, the system appears to hang after >> > probing the ata devices. Over the course of about 30 seconds the qemu >> > process goes up to 100% of one CPU, and no more output appears on the >> > console. This appears to happen regardless of the disk images I pass to >> > qemu; I've tried passing a UFS image, a file full of zeros, no disks at >> > all, and (just in case) both -hda and -hdc. I've included the boot log >> > below; I'd appreciate any advice. >> >> can you try qemu-devel? > > Thank you, that works. (Good God, it's slow... I wonder how hard it > would be to replace cc with something that runs a cross-compiler on the > host? Maybe I can do something with distcc...) > > Ben > From owner-freebsd-mips@FreeBSD.ORG Tue Oct 21 00:01:57 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D54DAB4F; Tue, 21 Oct 2014 00:01:57 +0000 (UTC) Received: from isis.morrow.me.uk (isis.morrow.me.uk [204.109.63.142]) by mx1.freebsd.org (Postfix) with ESMTP id AD5A3E76; Tue, 21 Oct 2014 00:01:57 +0000 (UTC) Received: from anubis.morrow.me.uk (unknown [93.89.81.46]) (Authenticated sender: mauzo) by isis.morrow.me.uk (Postfix) with ESMTPSA id A9ECA4508A; Tue, 21 Oct 2014 00:01:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 isis.morrow.me.uk A9ECA4508A DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=morrow.me.uk; s=dkim201101; t=1413849709; bh=niTmIpSnYaFjCOm5Sc7u96z19natFyFwxHXfE332Pps=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=C8VWsfjepYEmOtj5SOj06jzspPHvvR038OZhbbNMomRwWNNtw0NWe5/tIo7YqvQR5 IsXtS80U27SAShlfVyCEMzc7dvErfw6DGfp3507xDfPk2RjsmovfAT7+p4x3gceU5z mhM5I4s4mS1GfDyEvQgsyTmetjrERsRfixg1U3GI= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.98.4 at isis.morrow.me.uk Received: by anubis.morrow.me.uk (Postfix, from userid 5001) id 0CDC915068; Tue, 21 Oct 2014 01:01:44 +0100 (BST) Date: Tue, 21 Oct 2014 01:01:43 +0100 From: Ben Morrow To: Adrian Chadd Subject: Re: Trying to get MALTA64 running under qemu Message-ID: <20141021000143.GC12023@anubis.morrow.me.uk> References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2014 00:01:57 -0000 Adrian Chadd wrote: > Would you please post an updated recipe for what you've done to get > freebsd-mips64 up on qemu-devel? The mkimg step is missing from the instructions on the wiki, as are the arguments to makefs to get it to include some spare inodes in the image. I haven't yet found any way to pass boot-time arguments to the kernel (qemu's -append option doesn't seem to work, or I'm passing the arguments wrong) so the root fs has to be on ada0s1a. This comes up successfully with qemu-devel-2.0.2_3. The 'malta' machine seems to be rather limited (one CPU, no more than 256M memory); I might see if I can get a kernel config that works with one of the other qemu machines. Ben #!/bin/sh set -ex export TARGET=mips export TARGET_ARCH=mips64 export KERNCONF=MALTA64 export DESTDIR=/tmp/mipsworld make -C /usr/src -j6 buildworld make -C /usr/src -j6 buildkernel make -C /usr/src installworld cp /usr/obj/mips.mips64/usr/src/sys/$KERNCONF/kernel mips64.kernel echo '/dev/ada0s1a / ufs rw 1 1' >$DESTDIR/etc/fstab echo '/dev/ada0s1b none swap sw 0 0' >>$DESTDIR/etc/fstab # don't build a be UFS2 image; there is a bug in makefs makefs -Z -B be -f 60% -b 60% -t ffs mips64.ufs $DESTDIR mkimg -s mbr -o mips64.img \ -p freebsd:-'mkimg -s bsd -p freebsd-ufs:=mips64.ufs -p freebsd-swap::1G' # not as root... #qemu-system-mips64 -M malta \ # -nographic -m 256M -kernel mips64.kernel -hda mips64.img From owner-freebsd-mips@FreeBSD.ORG Tue Oct 21 00:31:11 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6614284 for ; Tue, 21 Oct 2014 00:31:11 +0000 (UTC) Received: from isis.morrow.me.uk (isis.morrow.me.uk [204.109.63.142]) by mx1.freebsd.org (Postfix) with ESMTP id A05A4DE for ; Tue, 21 Oct 2014 00:31:11 +0000 (UTC) Received: from anubis.morrow.me.uk (unknown [93.89.81.46]) (Authenticated sender: mauzo) by isis.morrow.me.uk (Postfix) with ESMTPSA id AD5C94508A; Tue, 21 Oct 2014 00:31:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 isis.morrow.me.uk AD5C94508A DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=morrow.me.uk; s=dkim201101; t=1413851470; bh=rSEIYmDwLx4FH3Vn5Rz/ioVOICRpN3mrngzwb2qktnI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=VeZALGNKRLteXaQiZL5DI254OdDm3FUlA0HZZPJNZUGWLi28KyciFJCDKm3E72oTh uX6VYscSiG6AysDZtNCLOdyBPxQt4CEjACrKtHhH5DKHhlDEOH5HFb2ULiB89Udqij S83v2jq1L7wfJo48IHVmHxEuYcChEOcPK0MLnqtQ= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.98.4 at isis.morrow.me.uk Received: by anubis.morrow.me.uk (Postfix, from userid 5001) id 19F1215076; Tue, 21 Oct 2014 01:31:09 +0100 (BST) Date: Tue, 21 Oct 2014 01:31:09 +0100 From: Ben Morrow To: Warner Losh Subject: Cross-building mips binaries Message-ID: <20141021003108.GD12023@anubis.morrow.me.uk> References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> <3A1572B8-1CCE-49FD-BA08-476D0B9D8AB2@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3A1572B8-1CCE-49FD-BA08-476D0B9D8AB2@bsdimp.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-mips@freebsd.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2014 00:31:11 -0000 Warner Losh wrote: > On Oct 19, 2014, at 4:34 PM, Ben Morrow wrote: > > [ mips64 under qemu ] > > > > Thank you, that works. (Good God, it's slow... I wonder how hard it > > would be to replace cc with something that runs a cross-compiler on the > > host? Maybe I can do something with distcc...) > > I’ve been helping Sean Bruno do exactly this, but I think for mips32. > You build a chroot with the full world, then you build x86 binaries to > produce mips32/64 output and replace the cc, et al, in the chroot with > those. Makes things quite a bit faster. Still not quite as fast as a > full native cross build, but much faster than pure user mode and more > reliable than the current state of the art in cross building. This is a huge improvement (thank you to Juli and Alexander for pointing me in the direction of qemu-user-static). I've now got a poudriere jail with a mips64 world, amd64->mips64 cross-tools and imgact_binmisc to invoke the emulator, and after a bit of fuss setting up the jail it all appears to Just Work. The new time hog seems to be xz and bz2 untarring distfiles and building packages. Presumably a static amd64 tar binary would work without problems; does anyone know if there are endianness issues with sqlite which would upset an amd64 pkg-static binary? Ben From owner-freebsd-mips@FreeBSD.ORG Wed Oct 22 21:35:44 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F678583 for ; Wed, 22 Oct 2014 21:35:44 +0000 (UTC) Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F63C83D for ; Wed, 22 Oct 2014 21:35:44 +0000 (UTC) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Xh3ZH-00060D-Pc for freebsd-mips@freebsd.org; Wed, 22 Oct 2014 14:35:43 -0700 Date: Wed, 22 Oct 2014 14:35:43 -0700 (PDT) From: sson To: freebsd-mips@freebsd.org Message-ID: <1414013743787-5958768.post@n5.nabble.com> In-Reply-To: References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> Subject: Re: Trying to get MALTA64 running under qemu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2014 21:35:44 -0000 FYI, My recipe for qemu user-mode is at https://wiki.freebsd.org/QemuUserModeHowTo Of course, it could used to be updated a bit. Feel free. Regards, -stacey. -- View this message in context: http://freebsd.1045724.n5.nabble.com/Trying-to-get-MALTA64-running-under-qemu-tp5957841p5958768.html Sent from the freebsd-mips mailing list archive at Nabble.com. From owner-freebsd-mips@FreeBSD.ORG Wed Oct 22 21:46:57 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 219678DF for ; Wed, 22 Oct 2014 21:46:57 +0000 (UTC) Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02B9E934 for ; Wed, 22 Oct 2014 21:46:57 +0000 (UTC) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Xh3k8-0006UZ-D6 for freebsd-mips@freebsd.org; Wed, 22 Oct 2014 14:46:56 -0700 Date: Wed, 22 Oct 2014 14:46:56 -0700 (PDT) From: sson To: freebsd-mips@freebsd.org Message-ID: <1414014416398-5958771.post@n5.nabble.com> In-Reply-To: <20141018225950.GA12023@anubis.morrow.me.uk> References: <20141018225950.GA12023@anubis.morrow.me.uk> Subject: Re: Trying to get MALTA64 running under qemu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2014 21:46:57 -0000 FYI, If you do get an ERL then you will want to add this patches to the kernel and add "option KSTACK_LARGE_PAGE" to the kernel config file: https://people.freebsd.org/~sson/mips/kstack/kstack_large_page_1.diff https://people.freebsd.org/~sson/mips/kstack/kstack_large_page_2.diff https://people.freebsd.org/~sson/mips/kstack/kstack_large_page_3.diff These changes uses a larger (16K) page size for the kernel thread stack so things like NFS don't crash the kernel. (A better version of these changes are scheduled to be upstreamed in the near future, FYI.) Regards, -stacey. -- View this message in context: http://freebsd.1045724.n5.nabble.com/Trying-to-get-MALTA64-running-under-qemu-tp5957841p5958771.html Sent from the freebsd-mips mailing list archive at Nabble.com. From owner-freebsd-mips@FreeBSD.ORG Wed Oct 22 22:27:52 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E23CE23D for ; Wed, 22 Oct 2014 22:27:52 +0000 (UTC) Received: from st11p01mm-asmtp001.mac.com (st11p01mm-asmtp001.mac.com [17.172.204.239]) (using TLSv1 with cipher DES-CBC3-SHA (112/168 bits)) (Client CN "smtp.me.com", Issuer "VeriSign Class 3 Extended Validation SSL SGC CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1E98CCD for ; Wed, 22 Oct 2014 22:27:52 +0000 (UTC) Received: from [192.168.0.39] (cpe-76-187-139-93.tx.res.rr.com [76.187.139.93]) by st11p01mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPSA id <0NDV005VC7LRLEA0@st11p01mm-asmtp001.mac.com> for freebsd-mips@freebsd.org; Wed, 22 Oct 2014 21:27:28 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52,1.0.28,0.0.0000 definitions=2014-10-22_07:2014-10-22,2014-10-22,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1410220199 Subject: Re: Cross-building mips binaries MIME-version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-type: text/plain; charset=windows-1252 From: Stacey Son In-reply-to: <20141021003108.GD12023@anubis.morrow.me.uk> Date: Wed, 22 Oct 2014 16:27:26 -0500 Content-transfer-encoding: quoted-printable Message-id: <313C0AC8-309A-452C-9EA2-227746BD524B@me.com> References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> <3A1572B8-1CCE-49FD-BA08-476D0B9D8AB2@bsdimp.com> <20141021003108.GD12023@anubis.morrow.me.uk> To: Ben Morrow X-Mailer: Apple Mail (2.1878.6) Cc: freebsd-mips@freebsd.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2014 22:27:53 -0000 On Oct 20, 2014, at 7:31 PM, Ben Morrow wrote: > Warner Losh wrote: >> On Oct 19, 2014, at 4:34 PM, Ben Morrow wrote: >>>=20 > [ mips64 under qemu ] >>>=20 >>> Thank you, that works. (Good God, it's slow... I wonder how hard it >>> would be to replace cc with something that runs a cross-compiler on = the >>> host? Maybe I can do something with distcc...) >>=20 >> I=92ve been helping Sean Bruno do exactly this, but I think for = mips32. >> You build a chroot with the full world, then you build x86 binaries = to >> produce mips32/64 output and replace the cc, et al, in the chroot = with >> those. Makes things quite a bit faster. Still not quite as fast as a >> full native cross build, but much faster than pure user mode and more >> reliable than the current state of the art in cross building. >=20 > This is a huge improvement (thank you to Juli and Alexander for = pointing > me in the direction of qemu-user-static). I've now got a poudriere = jail > with a mips64 world, amd64->mips64 cross-tools and imgact_binmisc to > invoke the emulator, and after a bit of fuss setting up the jail it = all > appears to Just Work. >=20 > The new time hog seems to be xz and bz2 untarring distfiles and = building > packages. Presumably a static amd64 tar binary would work without > problems; does anyone know if there are endianness issues with sqlite > which would upset an amd64 pkg-static binary? Hi Ben, I have used an amd64 pkg-static to create indexes and such for = FreeBSD/mips64 packages. =20 With the impact_binmisc kernel module you can add statically linked = amd64 binaries and the kernel will run them natively. /rescue is a = good source for these (e.g. tar). Also, there are some of my (and others) notes at = https://wiki.freebsd.org/QemuUserModeHowTo for the simple chroot case = but also apply as well to a poudriere jail. Best Regards, -stacey.=