From owner-freebsd-sparc64@FreeBSD.ORG Sun Mar 2 08:41:53 2014 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5497A60E; Sun, 2 Mar 2014 08:41:52 +0000 (UTC) Received: from mx.bsdtec.net (mx.bsdtec.net [174.34.171.65]) by mx1.freebsd.org (Postfix) with ESMTP id BE4CB1A10; Sun, 2 Mar 2014 08:41:52 +0000 (UTC) Received: from localhost (mx.bsdtec.net [172.16.32.2]) by mx.bsdtec.net (Postfix) with ESMTP id 6BEDF489875; Sun, 2 Mar 2014 08:32:45 +0000 (UTC) Received: from mx.bsdtec.net ([172.16.32.2]) by localhost (mx.bsdtec.net [172.16.32.2]) (amavisd-new, port 10032) with ESMTP id VfQt_Ub0Ja_d; Sun, 2 Mar 2014 08:32:44 +0000 (UTC) Received: from localhost (mx.bsdtec.net [172.16.32.2]) by mx.bsdtec.net (Postfix) with ESMTP id D0148489898; Sun, 2 Mar 2014 08:32:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at bsdtec.net Received: from mx.bsdtec.net ([172.16.32.2]) by localhost (mx.bsdtec.net [172.16.32.2]) (amavisd-new, port 10026) with ESMTP id j3awyJTRq1yk; Sun, 2 Mar 2014 08:32:43 +0000 (UTC) Received: from mx.bsdtec.net (mx.bsdtec.net [172.16.32.2]) by mx.bsdtec.net (Postfix) with ESMTP id 82E04489875; Sun, 2 Mar 2014 08:32:43 +0000 (UTC) Date: Sun, 2 Mar 2014 08:32:43 +0000 (GMT) From: Craig Butler To: John-Mark Gurney Message-ID: <31991855.251.1393749169473.JavaMail.craig@w520> In-Reply-To: <20140301195158.GA47921@funkthat.com> References: <20140301011643.GV47921@funkthat.com> <5311FCB9.60406@smeets.im> <20140301195158.GA47921@funkthat.com> Subject: Re: HEADS UP: sparc64 backend for llvm/clang imported MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.32.3] X-Mailer: Zimbra 8.0.4_GA_5718 (Zimbra Desktop/7.2.2_11951_Windows) Thread-Topic: HEADS UP: sparc64 backend for llvm/clang imported Thread-Index: vkfWPe8bLDo0tp82AmT1i+fP32m+Jg== Cc: rdivacky@freebsd.org, freebsd-current@freebsd.org, Dimitry Andric , freebsd-sparc64@freebsd.org X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 08:41:53 -0000 ----- Original Message ----- > From: "John-Mark Gurney" > To: "Florian Smeets" > Cc: "Dimitry Andric" , "Craig Butler" , freebsd-current@freebsd.org, > freebsd-sparc64@freebsd.org, rdivacky@freebsd.org > Sent: Saturday, 1 March, 2014 7:51:58 PM > Subject: Re: HEADS UP: sparc64 backend for llvm/clang imported > > Florian Smeets wrote this message on Sat, Mar 01, 2014 at 16:28 > +0100: > > On 01/03/14 02:16, John-Mark Gurney wrote: > > > Dimitry Andric wrote this message on Fri, Feb 28, 2014 at 20:22 > > > +0100: > > >> > > >> For building the sparc64 kernel, there is one open issue left, > > >> which is > > >> that sys/sparc64/include/pcpu.h uses global register variables, > > >> and this > > >> is not supported by clang. A preliminary patch for this is > > >> attached, > > >> but it may or may not blow up your system, please beware! > > >> > > >> The patch changes the pcpu and curpcb global register variables > > >> into > > >> inline functions, similar to what is done on other > > >> architectures. > > >> However, the current approach is not optimal, and the emitted > > >> code is > > >> slightly different from what gcc outputs. Any improvements to > > >> this > > >> patch are greatly appreciated! > > >> > > >> Last but not least, thanks go out to Roman Divacky for his work > > >> with > > >> llvm/clang upstream in getting the sparc64 backend into shape. > > > > > > Ok, I have a new pcpu patch to try. I have only compile tested > > > it. > > > > > > It is available here: > > > https://www.funkthat.com/~jmg/sparc64.pcpu.patch > > > > > > I've also attached it. > > > > > > Craig, do you mind testing it? > > > > > > > My machine doesn't boot with this patch. > > > > OK boot -v > > Booting... > > jumping to kernel entry at 0xc0088000. > > OF_panic: sparc64_init: cannot find boot CPU node > > Program terminated > > {1} ok > > > > I'm now going to try the version that dim sent. > > Does it boot w/o the patch? Is this a clang built loader/kernel or > a gcc built loader/kernel that you tried the patch on? > > From a quick look at the code, it doesn't look like my patch would > have effected this part of the kernel... > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." > It's not working here either.. Native base gcc compiled 10-RELEASE + patch results in; FreeBSD/sparc64 bootstrap loader, Revision 1.0 (root@snap.freebsd.org, Fri Jan 17 11:27:27 UTC 2014) bootpath="/pci@1f,0/pci@1/scsi@8/disk@0,0:a" Loading /boot/defaults/loader.conf /boot/kernel/kernel text=0xafe440 data=0xcbf60+0xd82b0 syms=[0x8+0xc53a0+0x8+0xb7c06] /boot/kernel/zfs.ko text=0x223328 data=0xa4c0+0x17f60 syms=[0x8+0x19788+0x8+0x143eb] loading required module 'opensolaris' /boot/kernel/opensolaris.ko text=0x30d0 data=0x2a8+0x2030 syms=[0x8+0xd68+0x8+0x91c] /boot/kernel/geom_mirror.ko text=0x383f0 data=0x590+0x20 syms=[0x8+0x1680+0x8+0x1191] Hit [Enter] to boot immediately, or any other key for command prompt. Booting [/boot/kernel/kernel]... jumping to kernel entry at 0xc00a0000. 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.0-RELEASE #2: Sat Mar 1 21:40:27 GMT 2014 root@v120.lerwick.hopto.org:/usr/obj/usr/src/sys/GENERIC sparc64 gcc version 4.2.1 20070831 patched [FreeBSD] real memory = 1073741824 (1024 MB) avail memory = 1024622592 (977 MB) cpu0: Sun Microsystems UltraSparc-IIe Processor (648.00 MHz CPU) random device not loaded; using insecure entropy panic: trap: illegal instruction (kernel) cpuid = 0 KDB: stack backtrace: #0 0xc0884458 at trap+0x558 Uptime: 1s Automatic reboot in 15 seconds - press a key on the console to abort Rebooting... Resetti LOM event: +12h49m59s host reset Kind Regards Craig Butler