From owner-freebsd-sparc64@freebsd.org Sun Sep 6 09:56:26 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C57669CBA53 for ; Sun, 6 Sep 2015 09:56:26 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id B236B1A77 for ; Sun, 6 Sep 2015 09:56:26 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id B23769CBA52; Sun, 6 Sep 2015 09:56:26 +0000 (UTC) Delivered-To: sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1CE89CBA51 for ; Sun, 6 Sep 2015 09:56:26 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A5C0D1A76; Sun, 6 Sep 2015 09:56:26 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id A45431214; Sun, 6 Sep 2015 09:56:26 +0000 (UTC) Date: Sun, 6 Sep 2015 09:56:26 +0000 From: Alexey Dokuchaev To: Mark Cave-Ayland Cc: sparc64@freebsd.org Subject: Re: Trying to cross-build FreeBSD 10 release ISOs for sparc64 Message-ID: <20150906095626.GA50266@FreeBSD.org> References: <53F87DC9.9020800@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53F87DC9.9020800@ilande.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 09:56:26 -0000 On Sat, Aug 23, 2014 at 12:40:57PM +0100, Mark Cave-Ayland wrote: > While the output ISOs are generated, they appear to be invalid (or at > least OpenBIOS can't find a valid partition on them). Reviewing the > logs, the entire build process seems to work all the way up to the point > where the ISOs are generated which looks like this: > > [...] > gpart: scheme 'VTOC8': Invalid argument > gpart: No such geom: md0. > gpart: No such geom: md0. > > Superficially it looks as if gpart can't understand the partitioning > scheme used for sparc64 ISOs but does anyone else have any ideas as to > why this isn't working? I'm trying to test the patch in https://reviews.freebsd.org/D2791, and today had encountered exactly this problem with "scheme 'VTOC8': Invalid argument" of gpart(8). Quick googling had revealed [1] that it might happen due to endianess being different on i386 (host) and sparc64 (target). I'll need to have a closer look at gpart(8) sources to know better about it, but trying to make sparc64 iso-image on big-endian PowerPC allowed to create VTOC8 scheme and produce bootable images. ./danfe [1] https://lists.freebsd.org/pipermail/freebsd-questions/2013-February/249013.html From owner-freebsd-sparc64@freebsd.org Sun Sep 6 11:03:08 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6429F9CBA2E for ; Sun, 6 Sep 2015 11:03:08 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 546311C32; Sun, 6 Sep 2015 11:03:08 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 522881DAC; Sun, 6 Sep 2015 11:03:08 +0000 (UTC) Date: Sun, 6 Sep 2015 11:03:08 +0000 From: Alexey Dokuchaev To: Mark Cave-Ayland Cc: John Baldwin , "freebsd-sparc64@freebsd.org" Subject: Re: PCI range checking under qemu-system-sparc64 Message-ID: <20150906110308.GA68829@FreeBSD.org> References: <53F73E6F.9080805@ilande.co.uk> <2084808.1lxSgnvf69@ralph.baldwin.cx> <557ADCAB.9020409@FreeBSD.org> <557B6116.70900@ilande.co.uk> <557C1162.3000106@FreeBSD.org> <557D82F8.50908@ilande.co.uk> <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <557DF887.20508@ilande.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 11:03:08 -0000 On Sun, Jun 14, 2015 at 10:56:23PM +0100, Mark Cave-Ayland wrote: > Got it. The module name was geom_part_vtoc8 and that was enough to > enable me to generate a valid ISO, apply your patch and verify that the > build works. Thank you for your help so far! > > A quick test with QEMU debugging enabled shows the following on the > console just before the freeze: > > IN: > 0x00000000c0590188: st %g1, [ %l3 + 0x8c ] > 0x00000000c059018c: membar #MemIssue > 0x00000000c0590190: sll %l0, 2, %g2 > 0x00000000c0590194: ld [ %i3 + 0x88 ], %g1 > 0x00000000c0590198: cmp %g2, %g1 > 0x00000000c059019c: clr %o0 > 0x00000000c05901a0: movg %icc, 1, %o0 > 0x00000000c05901a4: call 0xc08aaee0 > > (hangs) > > Examining the kernel symbols show that 0xc08aaee0 is the address of the > cpu_idle() function which is being called from sched_idletd(). My next > job will be to step through cpu_idle() and see if we're getting stuck in > a loop or disappearing somewhere else. Applying the patch (extended version in D2791) fixed the panic for me as well (on qemu v2.4.0 built from emulators/qemu-devel port). Kernel keeps booting and hangs after printing "IPsec: Initialized Security Association Processing." line, however last assembly lines in the log are different: IN: 0x00000000c06183b8: ldsh [ %l3 + 0x9a ], %g1 0x00000000c06183bc: ldsh [ %l3 + 0x98 ], %g2 0x00000000c06183c0: add %g1, %g2, %l0 0x00000000c06183c4: ld [ %l3 + 0x88 ], %g1 0x00000000c06183c8: cmp %g1, 0 0x00000000c06183cc: bne %icc, 0xc061812c 0x00000000c06183d0: cmp %l0, %l1 Mark did you have any success with getting the boot process further? ./danfe From owner-freebsd-sparc64@freebsd.org Sun Sep 6 12:16:26 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF0E69CC470 for ; Sun, 6 Sep 2015 12:16:26 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from s16892447.onlinehome-server.info (s16892447.onlinehome-server.info [82.165.15.123]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC8DE1DD4; Sun, 6 Sep 2015 12:16:26 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from cpc2-slam8-2-0-cust642.2-4.cable.virginm.net ([82.24.206.131] helo=[192.168.0.5]) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZYYrr-00035C-Sp; Sun, 06 Sep 2015 13:16:23 +0100 Message-ID: <55EC2E8D.4020803@ilande.co.uk> Date: Sun, 06 Sep 2015 13:16:13 +0100 From: Mark Cave-Ayland User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Alexey Dokuchaev CC: John Baldwin , "freebsd-sparc64@freebsd.org" References: <53F73E6F.9080805@ilande.co.uk> <2084808.1lxSgnvf69@ralph.baldwin.cx> <557ADCAB.9020409@FreeBSD.org> <557B6116.70900@ilande.co.uk> <557C1162.3000106@FreeBSD.org> <557D82F8.50908@ilande.co.uk> <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> <20150906110308.GA68829@FreeBSD.org> In-Reply-To: <20150906110308.GA68829@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 82.24.206.131 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: Re: PCI range checking under qemu-system-sparc64 X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: No (on s16892447.onlinehome-server.info); Unknown failure X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 12:16:27 -0000 On 06/09/15 12:03, Alexey Dokuchaev wrote: > On Sun, Jun 14, 2015 at 10:56:23PM +0100, Mark Cave-Ayland wrote: >> Got it. The module name was geom_part_vtoc8 and that was enough to >> enable me to generate a valid ISO, apply your patch and verify that the >> build works. Thank you for your help so far! >> >> A quick test with QEMU debugging enabled shows the following on the >> console just before the freeze: >> >> IN: >> 0x00000000c0590188: st %g1, [ %l3 + 0x8c ] >> 0x00000000c059018c: membar #MemIssue >> 0x00000000c0590190: sll %l0, 2, %g2 >> 0x00000000c0590194: ld [ %i3 + 0x88 ], %g1 >> 0x00000000c0590198: cmp %g2, %g1 >> 0x00000000c059019c: clr %o0 >> 0x00000000c05901a0: movg %icc, 1, %o0 >> 0x00000000c05901a4: call 0xc08aaee0 >> >> (hangs) >> >> Examining the kernel symbols show that 0xc08aaee0 is the address of the >> cpu_idle() function which is being called from sched_idletd(). My next >> job will be to step through cpu_idle() and see if we're getting stuck in >> a loop or disappearing somewhere else. > > Applying the patch (extended version in D2791) fixed the panic for me as > well (on qemu v2.4.0 built from emulators/qemu-devel port). Kernel keeps > booting and hangs after printing "IPsec: Initialized Security Association > Processing." line, however last assembly lines in the log are different: > > IN: > 0x00000000c06183b8: ldsh [ %l3 + 0x9a ], %g1 > 0x00000000c06183bc: ldsh [ %l3 + 0x98 ], %g2 > 0x00000000c06183c0: add %g1, %g2, %l0 > 0x00000000c06183c4: ld [ %l3 + 0x88 ], %g1 > 0x00000000c06183c8: cmp %g1, 0 > 0x00000000c06183cc: bne %icc, 0xc061812c > 0x00000000c06183d0: cmp %l0, %l1 > > Mark did you have any success with getting the boot process further? Not really - due to changes with my job and involvment in GSoC this year then my QEMU SPARC64 work hasn't really progressed much :( I don't have my FreeBSD environment setup right now (due to OS upgrade) but can you post the console output for the boot as far as it gets with the current version of the patch applied? ATB, Mark. From owner-freebsd-sparc64@freebsd.org Sun Sep 6 12:19:46 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E8F89CC62E for ; Sun, 6 Sep 2015 12:19:46 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 44BF01E6F for ; Sun, 6 Sep 2015 12:19:46 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: by mailman.ysv.freebsd.org (Postfix) id 4180A9CC62D; Sun, 6 Sep 2015 12:19:46 +0000 (UTC) Delivered-To: sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 410239CC62C for ; Sun, 6 Sep 2015 12:19:46 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from s16892447.onlinehome-server.info (s16892447.onlinehome-server.info [82.165.15.123]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 035A21E6E; Sun, 6 Sep 2015 12:19:45 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from cpc2-slam8-2-0-cust642.2-4.cable.virginm.net ([82.24.206.131] helo=[192.168.0.5]) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZYYbY-00032J-HU; Sun, 06 Sep 2015 12:59:31 +0100 Message-ID: <55EC2A9A.9000501@ilande.co.uk> Date: Sun, 06 Sep 2015 12:59:22 +0100 From: Mark Cave-Ayland User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Alexey Dokuchaev CC: sparc64@freebsd.org References: <53F87DC9.9020800@ilande.co.uk> <20150906095626.GA50266@FreeBSD.org> In-Reply-To: <20150906095626.GA50266@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 82.24.206.131 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: Re: Trying to cross-build FreeBSD 10 release ISOs for sparc64 X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: No (on s16892447.onlinehome-server.info); Unknown failure X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 12:19:46 -0000 On 06/09/15 10:56, Alexey Dokuchaev wrote: > On Sat, Aug 23, 2014 at 12:40:57PM +0100, Mark Cave-Ayland wrote: >> While the output ISOs are generated, they appear to be invalid (or at >> least OpenBIOS can't find a valid partition on them). Reviewing the >> logs, the entire build process seems to work all the way up to the point >> where the ISOs are generated which looks like this: >> >> [...] >> gpart: scheme 'VTOC8': Invalid argument >> gpart: No such geom: md0. >> gpart: No such geom: md0. >> >> Superficially it looks as if gpart can't understand the partitioning >> scheme used for sparc64 ISOs but does anyone else have any ideas as to >> why this isn't working? > > I'm trying to test the patch in https://reviews.freebsd.org/D2791, and > today had encountered exactly this problem with "scheme 'VTOC8': Invalid > argument" of gpart(8). > > Quick googling had revealed [1] that it might happen due to endianess > being different on i386 (host) and sparc64 (target). I'll need to have > a closer look at gpart(8) sources to know better about it, but trying > to make sparc64 iso-image on big-endian PowerPC allowed to create VTOC8 > scheme and produce bootable images. I had exactly the same problem, and eventually John pointed me in the right direction: https://lists.freebsd.org/pipermail/freebsd-sparc64/2015-June/009606.html If I kldload the geom_part_vtoc8 module then I can build from a cross-compile environment setup on x86 and all is well. HTH, Mark. From owner-freebsd-sparc64@freebsd.org Sun Sep 6 12:30:32 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0FFD9CCAE8 for ; Sun, 6 Sep 2015 12:30:32 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id CE39031B for ; Sun, 6 Sep 2015 12:30:32 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id CCECC9CCAE7; Sun, 6 Sep 2015 12:30:32 +0000 (UTC) Delivered-To: sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC7A59CCAE6 for ; Sun, 6 Sep 2015 12:30:32 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id C102031A; Sun, 6 Sep 2015 12:30:32 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id BF1BE1805; Sun, 6 Sep 2015 12:30:32 +0000 (UTC) Date: Sun, 6 Sep 2015 12:30:32 +0000 From: Alexey Dokuchaev To: Mark Cave-Ayland Cc: sparc64@freebsd.org Subject: Re: Trying to cross-build FreeBSD 10 release ISOs for sparc64 Message-ID: <20150906123032.GA3711@FreeBSD.org> References: <53F87DC9.9020800@ilande.co.uk> <20150906095626.GA50266@FreeBSD.org> <55EC2A9A.9000501@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55EC2A9A.9000501@ilande.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 12:30:33 -0000 On Sun, Sep 06, 2015 at 12:59:22PM +0100, Mark Cave-Ayland wrote: > I had exactly the same problem, and eventually John pointed me in the > right direction: > > https://lists.freebsd.org/pipermail/freebsd-sparc64/2015-June/009606.html > > If I kldload the geom_part_vtoc8 module then I can build from a > cross-compile environment setup on x86 and all is well. Yeah, I've found your reply few moments after I've hit 'send' button. Now I see what went wrong: I've tried kldload'ing it of course, but it told me $ kldload /boot/kernel/geom_part_vtoc8.ko kldload: can't load /boot/kernel/geom_part_vtoc8.ko: module already loaded or in kernel So I thought, hm, perhaps it's in GENERIC. And of course I didn't look in dmesg buffer: KLD geom_part_vtoc8.ko: depends on kernel - not available or version mismatch Being lazy to type `geom_part_vtoc8.ko' by hand, I've relied on shell tab completion and totally forgot that I've booted `kernel.old', not `kernel'. Sorry for the noise. ./danfe From owner-freebsd-sparc64@freebsd.org Sun Sep 6 12:48:59 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 243739C543E for ; Sun, 6 Sep 2015 12:48:59 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 15D0DCF9; Sun, 6 Sep 2015 12:48:59 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 13D4E1C10; Sun, 6 Sep 2015 12:48:59 +0000 (UTC) Date: Sun, 6 Sep 2015 12:48:59 +0000 From: Alexey Dokuchaev To: Mark Cave-Ayland Cc: John Baldwin , "freebsd-sparc64@freebsd.org" Subject: Re: PCI range checking under qemu-system-sparc64 Message-ID: <20150906124859.GA14919@FreeBSD.org> References: <557ADCAB.9020409@FreeBSD.org> <557B6116.70900@ilande.co.uk> <557C1162.3000106@FreeBSD.org> <557D82F8.50908@ilande.co.uk> <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> <20150906110308.GA68829@FreeBSD.org> <55EC2E8D.4020803@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55EC2E8D.4020803@ilande.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 12:48:59 -0000 On Sun, Sep 06, 2015 at 01:16:13PM +0100, Mark Cave-Ayland wrote: > On 06/09/15 12:03, Alexey Dokuchaev wrote: > > Mark did you have any success with getting the boot process further? > > Not really - due to changes with my job and involvment in GSoC this year > then my QEMU SPARC64 work hasn't really progressed much :( > > I don't have my FreeBSD environment setup right now (due to OS upgrade) > but can you post the console output for the boot as far as it gets with > the current version of the patch applied? Last few lines: [...] eeprom0: addr 0x1400002000-0x1400003fff on ebus0 eeprom0: cannot allocate resources device_attach: eeprom0 attach returned 6 ebus0: addr 0 (no driver attached) ebus0: addr 0x14000003f8-0x14000003ff irq 43 (no driver attached) ebus0: addr 0x1400000060-0x1400000067 (no driver attached) pci0: at device 4.0 (no driver attached) atapci0: port 0x8100-0x8107,0x8180-0x8183,0x8200-0x8207,0x8280-0x8283,0x8300-0x830f at device 5.0 on pci0 ata2: at channel 0 on atapci0 ata3: at channel 1 on atapci0 cryptosoft0: on nexus0 nexus0: type unknown (no driver attached) Timecounter "tick" frequency 100000000 Hz quality 1000 Event timer "tick" frequency 100000000 Hz quality 1000 Timecounters tick every 1.000 msec IPsec: Initialized Security Association Processing. Full log available here: http://193.124.210.26/head-r287497-sparc64-qemu.log ./danfe From owner-freebsd-sparc64@freebsd.org Sun Sep 6 13:02:13 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57E099C5D42 for ; Sun, 6 Sep 2015 13:02:13 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from s16892447.onlinehome-server.info (s16892447.onlinehome-server.info [82.165.15.123]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 165031511; Sun, 6 Sep 2015 13:02:12 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from cpc2-slam8-2-0-cust642.2-4.cable.virginm.net ([82.24.206.131] helo=[192.168.0.5]) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZYZaB-0003DH-MS; Sun, 06 Sep 2015 14:02:10 +0100 Message-ID: <55EC3949.1020508@ilande.co.uk> Date: Sun, 06 Sep 2015 14:02:01 +0100 From: Mark Cave-Ayland User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Alexey Dokuchaev CC: John Baldwin , "freebsd-sparc64@freebsd.org" References: <557ADCAB.9020409@FreeBSD.org> <557B6116.70900@ilande.co.uk> <557C1162.3000106@FreeBSD.org> <557D82F8.50908@ilande.co.uk> <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> <20150906110308.GA68829@FreeBSD.org> <55EC2E8D.4020803@ilande.co.uk> <20150906124859.GA14919@FreeBSD.org> In-Reply-To: <20150906124859.GA14919@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 82.24.206.131 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: Re: PCI range checking under qemu-system-sparc64 X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: No (on s16892447.onlinehome-server.info); Unknown failure X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 13:02:13 -0000 On 06/09/15 13:48, Alexey Dokuchaev wrote: > On Sun, Sep 06, 2015 at 01:16:13PM +0100, Mark Cave-Ayland wrote: >> On 06/09/15 12:03, Alexey Dokuchaev wrote: >>> Mark did you have any success with getting the boot process further? >> >> Not really - due to changes with my job and involvment in GSoC this year >> then my QEMU SPARC64 work hasn't really progressed much :( >> >> I don't have my FreeBSD environment setup right now (due to OS upgrade) >> but can you post the console output for the boot as far as it gets with >> the current version of the patch applied? > > Last few lines: > > [...] > eeprom0: addr 0x1400002000-0x1400003fff on ebus0 > eeprom0: cannot allocate resources > device_attach: eeprom0 attach returned 6 > ebus0: addr 0 (no driver attached) > ebus0: addr 0x14000003f8-0x14000003ff irq 43 (no driver attached) > ebus0: addr 0x1400000060-0x1400000067 (no driver attached) > pci0: at device 4.0 (no driver attached) > atapci0: port 0x8100-0x8107,0x8180-0x8183,0x8200-0x8207,0x8280-0x8283,0x8300-0x830f at device 5.0 on pci0 > ata2: at channel 0 on atapci0 > ata3: at channel 1 on atapci0 > cryptosoft0: on nexus0 > nexus0: type unknown (no driver attached) > Timecounter "tick" frequency 100000000 Hz quality 1000 > Event timer "tick" frequency 100000000 Hz quality 1000 > Timecounters tick every 1.000 msec > IPsec: Initialized Security Association Processing. > > Full log available here: > > http://193.124.210.26/head-r287497-sparc64-qemu.log > > ./danfe Thanks a lot. I wonder if the problem is just that suitable console drivers can't be found? > ebus0: addr 0x14000003f8-0x14000003ff irq 43 (no driver attached) > ebus0: addr 0x1400000060-0x1400000067 (no driver attached) The QEMU hardware model is still a WIP and the serial port currently uses a 16550A UART (su) device rather than ESCC found in real hardware, while the keyboard is a simple PS2 keyboard. If you alter your kernel configuration to include building of the su and ps2 driver modules, does this help with detection of the serial and keyboard devices and if so, does boot progress any further at all? ATB, Mark. From owner-freebsd-sparc64@freebsd.org Sun Sep 6 13:42:45 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED5AE9CC17F for ; Sun, 6 Sep 2015 13:42:45 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id DCA3B8E9; Sun, 6 Sep 2015 13:42:45 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id DB0F915C6; Sun, 6 Sep 2015 13:42:45 +0000 (UTC) Date: Sun, 6 Sep 2015 13:42:45 +0000 From: Alexey Dokuchaev To: Mark Cave-Ayland Cc: John Baldwin , "freebsd-sparc64@freebsd.org" Subject: Re: PCI range checking under qemu-system-sparc64 Message-ID: <20150906134245.GA21410@FreeBSD.org> References: <557C1162.3000106@FreeBSD.org> <557D82F8.50908@ilande.co.uk> <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> <20150906110308.GA68829@FreeBSD.org> <55EC2E8D.4020803@ilande.co.uk> <20150906124859.GA14919@FreeBSD.org> <55EC3949.1020508@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55EC3949.1020508@ilande.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 13:42:46 -0000 On Sun, Sep 06, 2015 at 02:02:01PM +0100, Mark Cave-Ayland wrote: > I wonder if the problem is just that suitable console drivers can't > be found? > > > ebus0: addr 0x14000003f8-0x14000003ff irq 43 (no driver attached) > > ebus0: addr 0x1400000060-0x1400000067 (no driver attached) > > The QEMU hardware model is still a WIP and the serial port currently > uses a 16550A UART (su) device rather than ESCC found in real hardware, > while the keyboard is a simple PS2 keyboard. > > If you alter your kernel configuration to include building of the su and > ps2 driver modules, does this help with detection of the serial and > keyboard devices and if so, does boot progress any further at all? Hmm, I'm running GENERIC, so it looks like everything should be already there, no? At least by looking at ./conf/files.sparc64 I don't see what else ("device ???") should I add to it to get su/kb_ps2 support... ./danfe From owner-freebsd-sparc64@freebsd.org Sun Sep 6 14:23:12 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46A259C562A for ; Sun, 6 Sep 2015 14:23:12 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from s16892447.onlinehome-server.info (s16892447.onlinehome-server.info [82.165.15.123]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04B071B9A; Sun, 6 Sep 2015 14:23:10 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from cpc2-slam8-2-0-cust642.2-4.cable.virginm.net ([82.24.206.131] helo=[192.168.0.5]) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZYaqX-0003QL-8n; Sun, 06 Sep 2015 15:23:08 +0100 Message-ID: <55EC4C43.9050700@ilande.co.uk> Date: Sun, 06 Sep 2015 15:22:59 +0100 From: Mark Cave-Ayland User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Alexey Dokuchaev CC: John Baldwin , "freebsd-sparc64@freebsd.org" References: <557C1162.3000106@FreeBSD.org> <557D82F8.50908@ilande.co.uk> <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> <20150906110308.GA68829@FreeBSD.org> <55EC2E8D.4020803@ilande.co.uk> <20150906124859.GA14919@FreeBSD.org> <55EC3949.1020508@ilande.co.uk> <20150906134245.GA21410@FreeBSD.org> In-Reply-To: <20150906134245.GA21410@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 82.24.206.131 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: Re: PCI range checking under qemu-system-sparc64 X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: No (on s16892447.onlinehome-server.info); Unknown failure X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2015 14:23:12 -0000 On 06/09/15 14:42, Alexey Dokuchaev wrote: > On Sun, Sep 06, 2015 at 02:02:01PM +0100, Mark Cave-Ayland wrote: >> I wonder if the problem is just that suitable console drivers can't >> be found? >> >>> ebus0: addr 0x14000003f8-0x14000003ff irq 43 (no driver attached) >>> ebus0: addr 0x1400000060-0x1400000067 (no driver attached) >> >> The QEMU hardware model is still a WIP and the serial port currently >> uses a 16550A UART (su) device rather than ESCC found in real hardware, >> while the keyboard is a simple PS2 keyboard. >> >> If you alter your kernel configuration to include building of the su and >> ps2 driver modules, does this help with detection of the serial and >> keyboard devices and if so, does boot progress any further at all? > > Hmm, I'm running GENERIC, so it looks like everything should be already > there, no? At least by looking at ./conf/files.sparc64 I don't see what > else ("device ???") should I add to it to get su/kb_ps2 support... I'm afraid I'm not really a BSD person, but a quick browse at the source on github suggests you need these drivers: https://github.com/freebsd/freebsd/blob/master/sys/dev/uart/uart_bus_ebus.c https://github.com/freebsd/freebsd/blob/master/sys/dev/atkbdc/atkbdc_ebus.c It also looks like you'd need to hack atkbdc_ebus.c to allow "kb_ps2" as a device name rather than just trying to match on "8042", although this could potentially be fixed by renaming the device in OpenBIOS moving forwards as long as it doesn't cause any regressions. HTH, Mark. From owner-freebsd-sparc64@freebsd.org Mon Sep 7 09:23:10 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 683819CBBBC for ; Mon, 7 Sep 2015 09:23:10 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 55FB41075; Mon, 7 Sep 2015 09:23:10 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 54A96138D; Mon, 7 Sep 2015 09:23:10 +0000 (UTC) Date: Mon, 7 Sep 2015 09:23:10 +0000 From: Alexey Dokuchaev To: Mark Cave-Ayland Cc: John Baldwin , "freebsd-sparc64@freebsd.org" Subject: Re: PCI range checking under qemu-system-sparc64 Message-ID: <20150907092310.GA67083@FreeBSD.org> References: <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> <20150906110308.GA68829@FreeBSD.org> <55EC2E8D.4020803@ilande.co.uk> <20150906124859.GA14919@FreeBSD.org> <55EC3949.1020508@ilande.co.uk> <20150906134245.GA21410@FreeBSD.org> <55EC4C43.9050700@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55EC4C43.9050700@ilande.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2015 09:23:10 -0000 On Sun, Sep 06, 2015 at 03:22:59PM +0100, Mark Cave-Ayland wrote: > On 06/09/15 14:42, Alexey Dokuchaev wrote: > > Hmm, I'm running GENERIC, so it looks like everything should be already > > there, no? At least by looking at ./conf/files.sparc64 I don't see what > > else ("device ???") should I add to it to get su/kb_ps2 support... > > I'm afraid I'm not really a BSD person, but a quick browse at the source > on github suggests you need these drivers: > > https://github.com/freebsd/freebsd/blob/master/sys/dev/uart/uart_bus_ebus.c > https://github.com/freebsd/freebsd/blob/master/sys/dev/atkbdc/atkbdc_ebus.c Right, both of them are compiled-in by default. > It also looks like you'd need to hack atkbdc_ebus.c to allow "kb_ps2" as > a device name rather than just trying to match on "8042", although this > could potentially be fixed by renaming the device in OpenBIOS moving > forwards as long as it doesn't cause any regressions. I've patched it to allow "kb_ps2", and removed some stuff like INVARIANTS, WITNESS, IPSEC, etc. in faint hope to eliminate problematic code path, but it did not help: it still hangs, apparently in the same place. I'll try to trim kernel config a bit more, and of course would welcome any other ideas/patches to try, thanks! ./danfe From owner-freebsd-sparc64@freebsd.org Mon Sep 7 20:32:02 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DAB99CCF00 for ; Mon, 7 Sep 2015 20:32:02 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DA98418F8; Mon, 7 Sep 2015 20:32:01 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id t87KVqv2070598 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 7 Sep 2015 22:31:52 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id t87KVq4Z070597; Mon, 7 Sep 2015 22:31:52 +0200 (CEST) (envelope-from marius) Date: Mon, 7 Sep 2015 22:31:52 +0200 From: Marius Strobl To: Alexey Dokuchaev Cc: Mark Cave-Ayland , "freebsd-sparc64@freebsd.org" Subject: Re: PCI range checking under qemu-system-sparc64 Message-ID: <20150907203152.GA70457@alchemy.franken.de> References: <557B6116.70900@ilande.co.uk> <557C1162.3000106@FreeBSD.org> <557D82F8.50908@ilande.co.uk> <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> <20150906110308.GA68829@FreeBSD.org> <55EC2E8D.4020803@ilande.co.uk> <20150906124859.GA14919@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150906124859.GA14919@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (alchemy.franken.de [0.0.0.0]); Mon, 07 Sep 2015 22:31:52 +0200 (CEST) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2015 20:32:02 -0000 On Sun, Sep 06, 2015 at 12:48:59PM +0000, Alexey Dokuchaev wrote: > On Sun, Sep 06, 2015 at 01:16:13PM +0100, Mark Cave-Ayland wrote: > > On 06/09/15 12:03, Alexey Dokuchaev wrote: > > > Mark did you have any success with getting the boot process further? > > > > Not really - due to changes with my job and involvment in GSoC this year > > then my QEMU SPARC64 work hasn't really progressed much :( > > > > I don't have my FreeBSD environment setup right now (due to OS upgrade) > > but can you post the console output for the boot as far as it gets with > > the current version of the patch applied? > > Last few lines: > > [...] > eeprom0: addr 0x1400002000-0x1400003fff on ebus0 > eeprom0: cannot allocate resources > device_attach: eeprom0 attach returned 6 > ebus0: addr 0 (no driver attached) > ebus0: addr 0x14000003f8-0x14000003ff irq 43 (no driver attached) This suggests that there's something wrong with the emulation of the PCI-EBus-bridge (child space maps to a region not covered by the BARs, child space not covered by the mapping, wrong resource type in the ranges table or something like that), causing the allocation of child resources to fail as in the eeprom(4) case above. Such a problem would also explain why uart(4) doesn't try to attach to 'su' albeit it should: uart_bus_probe() already allocates the resource, failing silently if that doesn't work and, thus, causing uart_bus_attach() never to be called. > Full log available here: > > http://193.124.210.26/head-r287497-sparc64-qemu.log > > ebus0: port 0x4000-0x7fff mem 0x3000000-0x3ffffff at device 3.0 on pci0 That's already unusual; real PCI-EBus-bridges have two memory BARs (although children may use I/O ports which are translated to memory resources upstream) rather than an I/O port and a memory one. However, the above actually should also work code- wise, iff the resource types are encoded correctly in the ranges table. Marius From owner-freebsd-sparc64@freebsd.org Mon Sep 7 21:13:56 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0074F9CC45C for ; Mon, 7 Sep 2015 21:13:56 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from s16892447.onlinehome-server.info (s16892447.onlinehome-server.info [82.165.15.123]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B244D1CF6; Mon, 7 Sep 2015 21:13:54 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from [90.198.121.172] (helo=[192.168.1.86]) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZZ3jT-0000zP-2k; Mon, 07 Sep 2015 22:13:46 +0100 Message-ID: <55EDFE00.9090109@ilande.co.uk> Date: Mon, 07 Sep 2015 22:13:36 +0100 From: Mark Cave-Ayland User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Marius Strobl , Alexey Dokuchaev CC: "freebsd-sparc64@freebsd.org" References: <557B6116.70900@ilande.co.uk> <557C1162.3000106@FreeBSD.org> <557D82F8.50908@ilande.co.uk> <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> <20150906110308.GA68829@FreeBSD.org> <55EC2E8D.4020803@ilande.co.uk> <20150906124859.GA14919@FreeBSD.org> <20150907203152.GA70457@alchemy.franken.de> In-Reply-To: <20150907203152.GA70457@alchemy.franken.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 90.198.121.172 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: Re: PCI range checking under qemu-system-sparc64 X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: No (on s16892447.onlinehome-server.info); Unknown failure X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2015 21:13:56 -0000 On 07/09/15 21:31, Marius Strobl wrote: > On Sun, Sep 06, 2015 at 12:48:59PM +0000, Alexey Dokuchaev wrote: >> On Sun, Sep 06, 2015 at 01:16:13PM +0100, Mark Cave-Ayland wrote: >>> On 06/09/15 12:03, Alexey Dokuchaev wrote: >>>> Mark did you have any success with getting the boot process further? >>> >>> Not really - due to changes with my job and involvment in GSoC this year >>> then my QEMU SPARC64 work hasn't really progressed much :( >>> >>> I don't have my FreeBSD environment setup right now (due to OS upgrade) >>> but can you post the console output for the boot as far as it gets with >>> the current version of the patch applied? >> >> Last few lines: >> >> [...] >> eeprom0: addr 0x1400002000-0x1400003fff on ebus0 >> eeprom0: cannot allocate resources >> device_attach: eeprom0 attach returned 6 >> ebus0: addr 0 (no driver attached) >> ebus0: addr 0x14000003f8-0x14000003ff irq 43 (no driver attached) > > This suggests that there's something wrong with the emulation of > the PCI-EBus-bridge (child space maps to a region not covered by > the BARs, child space not covered by the mapping, wrong resource > type in the ranges table or something like that), causing the > allocation of child resources to fail as in the eeprom(4) case > above. Such a problem would also explain why uart(4) doesn't try > to attach to 'su' albeit it should: uart_bus_probe() already > allocates the resource, failing silently if that doesn't work > and, thus, causing uart_bus_attach() never to be called. > >> Full log available here: >> >> http://193.124.210.26/head-r287497-sparc64-qemu.log >> >> ebus0: port 0x4000-0x7fff mem 0x3000000-0x3ffffff at device 3.0 on pci0 > > That's already unusual; real PCI-EBus-bridges have two memory > BARs (although children may use I/O ports which are translated > to memory resources upstream) rather than an I/O port and a > memory one. However, the above actually should also work code- > wise, iff the resource types are encoded correctly in the ranges > table. While the QEMU PCI-ebus properties don't necessarily reflect a real ultra2, they should be consistent in terms of ranges as several patches along those lines were required to enable NetBSD and OpenBSD to boot under qemu-system-sparc64. For reference I've included the properties from OpenBIOS below: 0 > cd /pci/ ok 0 > .properties name "pci" reg 000001fe 00000000 00000000 02000000 vendor-id 108e device-id a000 revision-id 0 class-code 60000 min-grant 0 max-latency 0 devsel-speed 0 fast-back-to-back 66mhz-capable subsystem-vendor-id 1af4 subsystem-id 1100 cache-line-size 0 device_type "pci" model "SUNW,sabre" compatible {"pci108e,a000", "pciclass,0"} #address-cells 3 #size-cells 2 #interrupt-cells 1 ranges -- 54 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 fe 01 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 fe 02 00 00 00 00 00 00 00 00 01 00 00 02 00 00 00 00 00 00 00 00 10 00 00 00 00 01 ff 00 10 00 00 00 00 00 00 10 00 00 00 virtual-dma -- 8 : c0 00 00 00 20 00 00 00 #virtual-dma-size-cells 1 #virtual-dma-addr-cells 1 no-streaming-cache interrupts -- 10 : 00 00 07 f0 00 00 07 ee 00 00 07 ef 00 00 07 e5 upa-portid 1f bus-range -- 8 : 00 00 00 00 00 00 00 02 available -- 28 : 02 00 00 00 00 00 00 00 04 04 00 00 00 00 00 00 0b fc 00 00 01 00 00 00 00 00 00 00 00 00 83 80 00 00 00 00 00 00 7c 80 interrupt-map -- 30 : 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 01 ff e2 b7 40 00 00 00 10 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 01 ff e2 b7 40 00 00 00 14 interrupt-map-mask -- 10 : 00 00 f8 00 00 00 00 00 00 00 00 00 00 00 00 07 ok 0 > cd ebus ok 0 > .properties name "ebus" vendor-id 108e device-id 1000 revision-id 1 class-code 68000 min-grant 0 max-latency 0 devsel-speed 0 fast-back-to-back 66mhz-capable subsystem-vendor-id 1af4 subsystem-id 1100 cache-line-size a00 model "ebus" compatible {"pci108e,1000", "pciclass,068000"} #address-cells 2 #size-cells 1 #interrupt-cells 1 assigned-addresses -- 28 : 02 00 18 10 00 00 00 00 03 00 00 00 00 00 00 00 01 00 00 00 01 00 18 14 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 reg 00001800 00000000 00000000 00000000 00000000 02001810 00000000 00000000 00000000 01000000 01001814 00000000 00000000 00000000 00004000 interrupt-map -- 14 : 00 00 00 14 00 00 03 f8 00 00 00 01 ff e1 b9 48 00 00 00 2b interrupt-map-mask -- c : 00 00 01 ff ff ff ff ff 00 00 00 03 ranges -- 30 : 00 00 00 10 00 00 00 00 02 00 18 10 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 14 00 00 00 00 01 00 18 14 00 00 00 00 00 00 00 00 00 00 40 00 ok 0 > cd su ok 0 > .properties name "su" device_type "serial" reg 00000014 000003f8 00000008 interrupts 1 ok I wonder if the problem is the same as that in https://reviews.freebsd.org/D2791 which is that some assumptions about the device tree are hard-coded rather than being read and/or calculated from the PROM properties? ATB, Mark. From owner-freebsd-sparc64@freebsd.org Wed Sep 9 20:19:17 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77128A00BF3 for ; Wed, 9 Sep 2015 20:19:17 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from s16892447.onlinehome-server.info (s16892447.onlinehome-server.info [82.165.15.123]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35095185E; Wed, 9 Sep 2015 20:19:15 +0000 (UTC) (envelope-from mark.cave-ayland@ilande.co.uk) Received: from [90.202.114.174] (helo=[192.168.1.86]) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZZlpf-0001PC-B2; Wed, 09 Sep 2015 21:19:06 +0100 Message-ID: <55F09431.4080807@ilande.co.uk> Date: Wed, 09 Sep 2015 21:18:57 +0100 From: Mark Cave-Ayland User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Alexey Dokuchaev CC: John Baldwin , "freebsd-sparc64@freebsd.org" References: <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> <20150906110308.GA68829@FreeBSD.org> <55EC2E8D.4020803@ilande.co.uk> <20150906124859.GA14919@FreeBSD.org> <55EC3949.1020508@ilande.co.uk> <20150906134245.GA21410@FreeBSD.org> <55EC4C43.9050700@ilande.co.uk> <20150907092310.GA67083@FreeBSD.org> In-Reply-To: <20150907092310.GA67083@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 90.202.114.174 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: Re: PCI range checking under qemu-system-sparc64 X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: No (on s16892447.onlinehome-server.info); Unknown failure X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2015 20:19:17 -0000 On 07/09/15 10:23, Alexey Dokuchaev wrote: > On Sun, Sep 06, 2015 at 03:22:59PM +0100, Mark Cave-Ayland wrote: >> On 06/09/15 14:42, Alexey Dokuchaev wrote: >>> Hmm, I'm running GENERIC, so it looks like everything should be already >>> there, no? At least by looking at ./conf/files.sparc64 I don't see what >>> else ("device ???") should I add to it to get su/kb_ps2 support... >> >> I'm afraid I'm not really a BSD person, but a quick browse at the source >> on github suggests you need these drivers: >> >> https://github.com/freebsd/freebsd/blob/master/sys/dev/uart/uart_bus_ebus.c >> https://github.com/freebsd/freebsd/blob/master/sys/dev/atkbdc/atkbdc_ebus.c > > Right, both of them are compiled-in by default. > >> It also looks like you'd need to hack atkbdc_ebus.c to allow "kb_ps2" as >> a device name rather than just trying to match on "8042", although this >> could potentially be fixed by renaming the device in OpenBIOS moving >> forwards as long as it doesn't cause any regressions. > > I've patched it to allow "kb_ps2", and removed some stuff like INVARIANTS, > WITNESS, IPSEC, etc. in faint hope to eliminate problematic code path, but > it did not help: it still hangs, apparently in the same place. > > I'll try to trim kernel config a bit more, and of course would welcome any > other ideas/patches to try, thanks! I should add that if you can sprinkle some debug statements or similar around to find out exactly where the attach is failing and post the results here, that would be extremely helpful until I can get my FreeBSD environment back up and running again. ATB, Mark.