From owner-freebsd-arch@FreeBSD.ORG Sun Feb 22 19:22:38 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5E4A106566B for ; Sun, 22 Feb 2009 19:22:38 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 7A9A78FC0A for ; Sun, 22 Feb 2009 19:22:38 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 26B3B9CB078; Sun, 22 Feb 2009 20:00:17 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ENiGtSXASJPQ; Sun, 22 Feb 2009 20:00:05 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4DF3A9CB125; Sun, 22 Feb 2009 20:00:05 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n1MJ05ww021174; Sun, 22 Feb 2009 20:00:05 +0100 (CET) (envelope-from rdivacky) Date: Sun, 22 Feb 2009 20:00:05 +0100 From: Roman Divacky To: arch@freebsd.org Message-ID: <20090222190005.GA20129@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: kib@freebsd.org Subject: switching world to gnu99 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 19:22:39 -0000 --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline hi I'd like to switch world to gnu99 (it's gnu89 now) compilation with the following patch: http://www.vlakno.cz/~rdivacky/c99.patch It sets CSTD to gnu99 and fixes a few abuses of CFLAGS+=-std=something in the tree. The patch was tested with make universe and ports exp build. The main benefits for this are mainly bugs fixing (I've fixed some things by compiling the world in gnu99 mode) and better support for other compilers beside gcc. Please review this (it was already looked at by ruslan) and unless someone strongly objects I'd like to commit this in a week or so. thank you roman --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkmhoLQACgkQLVEj6D3CBEwFfQCaA+/qv6v4yMw1KmBNiGuJBnZ0 toQAn3IbQVHseqNqZFmM/51KPqIk9xt1 =NY/B -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn-- From owner-freebsd-arch@FreeBSD.ORG Mon Feb 23 11:06:49 2009 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FEEA106566B for ; Mon, 23 Feb 2009 11:06:49 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E712A8FC20 for ; Mon, 23 Feb 2009 11:06:48 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n1NB6m38055441 for ; Mon, 23 Feb 2009 11:06:48 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n1NB6m3R055437 for freebsd-arch@FreeBSD.org; Mon, 23 Feb 2009 11:06:48 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 23 Feb 2009 11:06:48 GMT Message-Id: <200902231106.n1NB6m3R055437@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-arch@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 11:06:49 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/120749 arch [request] Suggest upping the default kern.ps_arg_cache 1 problem total. From owner-freebsd-arch@FreeBSD.ORG Tue Feb 24 19:30:00 2009 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7443106566C; Tue, 24 Feb 2009 19:30:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BF4EE8FC24; Tue, 24 Feb 2009 19:30:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 40BAF46B17; Tue, 24 Feb 2009 14:30:00 -0500 (EST) Date: Tue, 24 Feb 2009 19:30:00 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: current@FreeBSD.org, net@FreeBSD.org In-Reply-To: Message-ID: References: <20080526110543.J26343@fledge.watson.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Tue, 24 Feb 2009 20:10:40 +0000 Cc: Subject: Re: HEADS UP: IFF_NEEDSGIANT consumers to be disabled, removed (was: Re: Wiki page for non-MPSAFE network stack de-orbit scheduling) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 19:30:02 -0000 On Mon, 16 Feb 2009, Robert Watson wrote: > The following schedule is proposed, assuming nothing goes horribly wrong > with the new USB code in the next few weeks, and remaining nits relating to > USB network and 802.11 drivers are handled: > > 16 February 2009 HEADS UP to lists (this e-mail) > 01 March 2009 Disable build of all IFF_NEEDSGIANT drivers in 8.x > 01 April 2009 Remove all IFF_NEEDSGIANT drivers from 8.x > > In the next couple of weeks, I'd like to resolve the status of (and > eliminate) the if_ndis conditional use of IFF_NEEDSGIANT. There's also a > chance that if_sl will get updated by Ed and myself to work with the new > locking and TTY world orders -- the lock is easy, but the TTY update takes a > bit of work. Perhaps someone will feel moved to do this for if_ppp and > possibly if_cx as well. Just a reminder that 1 March is gradually approaching. It looks like the new USB stack is settling nicely, so I currently have no plans to defer the above schedule. Robert N M Watson Computer Laboratory University of Cambridge From owner-freebsd-arch@FreeBSD.ORG Wed Feb 25 10:10:22 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60BBD10656C4 for ; Wed, 25 Feb 2009 10:10:22 +0000 (UTC) (envelope-from mindactive@ecastnews.com) Received: from attivonet.net (attivonet.net [72.3.236.78]) by mx1.freebsd.org (Postfix) with ESMTP id 13E038FC19 for ; Wed, 25 Feb 2009 10:10:21 +0000 (UTC) (envelope-from mindactive@ecastnews.com) Received: (qmail 10390 invoked by uid 48); 25 Feb 2009 04:10:20 -0600 To: arch@freebsd.org From: Shapvine News Date: Wed, 25 Feb 2009 04:10:09 -0600 X-LibVersion: 3.3.1_4 MIME-Version: 1.0 X-Mailer: AC Mailer Message-ID: <20090225101009.302.1220427499.swift@www.ecastnews.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Shapevine: News from the Vine - OPT-OUT Confirmation X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Feb 2009 10:10:22 -0000 Your unsubscription to our mailing list, Shapevine: News from the Vine, has been initiated. To verify your unsubscription, please visit: http://www.ecastnews.com/listServer/box.php?ai=&mi=29&p=0&e=YXJjaEBmcmVlYnNkLm9yZw==&funcml=cunsub&nl=15 Any questions may be sent to our mailing list admin at news@shapevine.com From owner-freebsd-arch@FreeBSD.ORG Fri Feb 27 13:11:56 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0144106564A for ; Fri, 27 Feb 2009 13:11:56 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 8FD1A8FC22 for ; Fri, 27 Feb 2009 13:11:56 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 5860D1CE29; Fri, 27 Feb 2009 14:11:55 +0100 (CET) Date: Fri, 27 Feb 2009 14:11:55 +0100 From: Ed Schouten To: FreeBSD Arch Message-ID: <20090227131155.GE19161@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2mUf73N0HmzM2Naa" Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Subject: Making LLVM happy: memmove() in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2009 13:11:57 -0000 --2mUf73N0HmzM2Naa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, The FreeBSD+LLVM folks* noticed Clang generates calls to memmove() by itself. I have yet to confirm this, but I assume this is done when performing copies of structs greater than a certain size. In our kernel, we don't have a memmove() function, but we do have a bcopy(). Because memmove() must be a function in this case (not a simple macro), Roman and I agreed that adding a memmove() to libkern would be the best thing to do for now, simply by calling bcopy(). ARM already has a memmove() in support.S, so we don't need it there. So my question is: what is your folks opinion on this patch? http://80386.nl/pub/memmove.diff It would be lovely if we could integrate this patch (or a similar one), because this will allow us to build kernels with Clang out of the box. --=20 Ed Schouten WWW: http://80386.nl/ * http://wiki.freebsd.org/BuildingFreeBSDWithClang --2mUf73N0HmzM2Naa Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmn5psACgkQ52SDGA2eCwVRLACdFdrXwy3q6mToUszQW6/mixoA /UgAn1tHChVlTcNiGke141s0CnNzMS5z =FjIf -----END PGP SIGNATURE----- --2mUf73N0HmzM2Naa-- From owner-freebsd-arch@FreeBSD.ORG Fri Feb 27 13:33:47 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB8F91065688 for ; Fri, 27 Feb 2009 13:33:47 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id A2EF28FC0A for ; Fri, 27 Feb 2009 13:33:47 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id B16789CB0BC; Fri, 27 Feb 2009 14:12:27 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z0t0QmHpW9dA; Fri, 27 Feb 2009 14:12:21 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 438D19CB121; Fri, 27 Feb 2009 14:12:21 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n1RDCL2C061295; Fri, 27 Feb 2009 14:12:21 +0100 (CET) (envelope-from rdivacky) Date: Fri, 27 Feb 2009 14:12:21 +0100 From: Roman Divacky To: Ed Schouten Message-ID: <20090227131221.GA60215@freebsd.org> References: <20090227131155.GE19161@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: <20090227131155.GE19161@hoeg.nl> User-Agent: Mutt/1.4.2.3i Cc: FreeBSD Arch Subject: Re: Making LLVM happy: memmove() in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2009 13:33:48 -0000 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 27, 2009 at 02:11:55PM +0100, Ed Schouten wrote: > Hi all, >=20 > The FreeBSD+LLVM folks* noticed Clang generates calls to memmove() by > itself. I have yet to confirm this, but I assume this is done when > performing copies of structs greater than a certain size. In our kernel, > we don't have a memmove() function, but we do have a bcopy(). also.. quoting from (http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Standards.html):=20 Most of the compiler support routines used by GCC are present in libgcc, but there are a few exceptions. GCC requires the freestanding environment provide memcpy, memmove, memset and memcmp. we were just lucky to not run into this --opJtzjQTFsWo+cga Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkmn5rQACgkQLVEj6D3CBEztSwCfVjrriHHKEHgaKppLUzdU7uiB LxMAnipEEOvoxdZvhJsOFiSlCg8jg0UW =HfWo -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga-- From owner-freebsd-arch@FreeBSD.ORG Fri Feb 27 16:05:42 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C9401065670; Fri, 27 Feb 2009 16:05:42 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 093718FC0A; Fri, 27 Feb 2009 16:05:37 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA17962; Fri, 27 Feb 2009 18:05:34 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <49A80F4D.8000406@icyb.net.ua> Date: Fri, 27 Feb 2009 18:05:33 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090110) MIME-Version: 1.0 To: Roman Divacky References: <20090227131155.GE19161@hoeg.nl> <20090227131221.GA60215@freebsd.org> In-Reply-To: <20090227131221.GA60215@freebsd.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: Ed Schouten , FreeBSD Arch Subject: Re: Making LLVM happy: memmove() in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2009 16:05:42 -0000 on 27/02/2009 15:12 Roman Divacky said the following: > On Fri, Feb 27, 2009 at 02:11:55PM +0100, Ed Schouten wrote: >> Hi all, >> >> The FreeBSD+LLVM folks* noticed Clang generates calls to memmove() by >> itself. I have yet to confirm this, but I assume this is done when >> performing copies of structs greater than a certain size. In our kernel, >> we don't have a memmove() function, but we do have a bcopy(). > > also.. quoting from > (http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Standards.html): > > Most of the compiler support routines used by GCC are present in libgcc, > but there are a few exceptions. GCC requires the freestanding environment > provide memcpy, memmove, memset and memcmp. > > we were just lucky to not run into this Some people actually were not that lucky and had to use similar workarounds. -- Andriy Gapon From owner-freebsd-arch@FreeBSD.ORG Fri Feb 27 16:40:52 2009 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FC52106566B for ; Fri, 27 Feb 2009 16:40:52 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id D715E8FC14 for ; Fri, 27 Feb 2009 16:40:51 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id n1RGegbV069404; Fri, 27 Feb 2009 10:40:42 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Fri, 27 Feb 2009 10:40:30 -0600 (CST) From: "Sean C. Farley" To: Ed Schouten In-Reply-To: <20090227131155.GE19161@hoeg.nl> Message-ID: References: <20090227131155.GE19161@hoeg.nl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: FreeBSD Arch Subject: Re: Making LLVM happy: memmove() in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2009 16:40:52 -0000 On Fri, 27 Feb 2009, Ed Schouten wrote: > Hi all, > > The FreeBSD+LLVM folks* noticed Clang generates calls to memmove() by > itself. I have yet to confirm this, but I assume this is done when > performing copies of structs greater than a certain size. In our > kernel, we don't have a memmove() function, but we do have a bcopy(). > > Because memmove() must be a function in this case (not a simple > macro), Roman and I agreed that adding a memmove() to libkern would be > the best thing to do for now, simply by calling bcopy(). ARM already > has a memmove() in support.S, so we don't need it there. > > So my question is: what is your folks opinion on this patch? > > http://80386.nl/pub/memmove.diff > > It would be lovely if we could integrate this patch (or a similar > one), because this will allow us to build kernels with Clang out of > the box. Does bcopy() in the kernel allow for overlapping strings? Sean -- scf@FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Fri Feb 27 16:45:25 2009 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F538106564A for ; Fri, 27 Feb 2009 16:45:25 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id E96548FC18 for ; Fri, 27 Feb 2009 16:45:24 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id n1RGjKPP069555; Fri, 27 Feb 2009 10:45:20 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Fri, 27 Feb 2009 10:45:07 -0600 (CST) From: "Sean C. Farley" To: Ed Schouten In-Reply-To: Message-ID: References: <20090227131155.GE19161@hoeg.nl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: FreeBSD Arch Subject: Re: Making LLVM happy: memmove() in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2009 16:45:25 -0000 On Fri, 27 Feb 2009, Sean C. Farley wrote: *snip* > Does bcopy() in the kernel allow for overlapping strings? *sigh* Never mind the sleepy programmer. When will the coffee kick in? :) Sean -- scf@FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Fri Feb 27 18:51:58 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F98F106567A for ; Fri, 27 Feb 2009 18:51:58 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mx1.freebsd.org (Postfix) with ESMTP id F19E48FC32 for ; Fri, 27 Feb 2009 18:51:53 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qw-out-2122.google.com with SMTP id 3so1195615qwe.7 for ; Fri, 27 Feb 2009 10:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=Du+8E+hXiAQ809nC6MhC7jWASA98R4MAsua/B5UXAYc=; b=o4Qk9suLmz0Aq4mjKOhez2ppMzAo3MCOrUTHtpl48FGxtNnN+BZaMDW35u8e0D+aUR eXEzdw+6uUH+bIqFc76Mpqng4FH/bla1orrfXfIIWmH20b11wBAWA7RwlTICpa7faG8Y PUEwlfaJUDH55HeuhV7OtG1XVVSdRGIW83/tk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=t7ZTPyJl2heW12nNlWdKEvPgF1WyOEBt8ttZdv8SqWyWFNh/v6UpPqKadF3wjx03ni 3f8Dzg48zUZsMDE7kZVCEa3WiWnMgSD+lvR2E7NGfM+RfeA9rcmd7qbZA3iSsCP6Gkov WxjddJ50aLjeMN7fFl1W1ejFvE5U5SwG/f7Oc= Received: by 10.224.28.78 with SMTP id l14mr4532349qac.307.1235758972062; Fri, 27 Feb 2009 10:22:52 -0800 (PST) Received: from kan.dnsalias.net (c-98-217-224-113.hsd1.ma.comcast.net [98.217.224.113]) by mx.google.com with ESMTPS id 6sm120564qwk.37.2009.02.27.10.22.50 (version=SSLv3 cipher=RC4-MD5); Fri, 27 Feb 2009 10:22:50 -0800 (PST) Date: Fri, 27 Feb 2009 13:22:42 -0500 From: Alexander Kabaev To: Andriy Gapon Message-ID: <20090227132242.4ef6a633@kan.dnsalias.net> In-Reply-To: <49A80F4D.8000406@icyb.net.ua> References: <20090227131155.GE19161@hoeg.nl> <20090227131221.GA60215@freebsd.org> <49A80F4D.8000406@icyb.net.ua> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/cg0fB=pr8bTeWCjOr/j3cSz"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: Ed Schouten , Roman Divacky , FreeBSD, Arch Subject: Re: Making LLVM happy: memmove() in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2009 18:52:13 -0000 --Sig_/cg0fB=pr8bTeWCjOr/j3cSz Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 27 Feb 2009 18:05:33 +0200 Andriy Gapon wrote: > on 27/02/2009 15:12 Roman Divacky said the following: > > On Fri, Feb 27, 2009 at 02:11:55PM +0100, Ed Schouten wrote: > >> Hi all, > >> > >> The FreeBSD+LLVM folks* noticed Clang generates calls to memmove() > >> by itself. I have yet to confirm this, but I assume this is done > >> when performing copies of structs greater than a certain size. In > >> our kernel, we don't have a memmove() function, but we do have a > >> bcopy(). > >=20 > > also.. quoting from > > (http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Standards.html):=20 > >=20 > > Most of the compiler support routines used by GCC are present in > > libgcc, but there are a few exceptions. GCC requires the > > freestanding environment provide memcpy, memmove, memset and memcmp. > >=20 > > we were just lucky to not run into this >=20 > Some people actually were not that lucky and had to use similar > workarounds. >=20 I think we should use this opportunity and make sure we have external symbols for all of the above mem* functions, not just memmove. Please :) --=20 Alexander Kabaev --Sig_/cg0fB=pr8bTeWCjOr/j3cSz Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFJqC9yQ6z1jMm+XZYRAiIXAJsH8W+cvnwb9Y+ZUo9NI3IbbWmy3ACfUwyS WHMH10V/OpAGTnP0Z453nuM= =se/P -----END PGP SIGNATURE----- --Sig_/cg0fB=pr8bTeWCjOr/j3cSz-- From owner-freebsd-arch@FreeBSD.ORG Sat Feb 28 09:58:31 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 914CB106566C for ; Sat, 28 Feb 2009 09:58:31 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 431398FC15 for ; Sat, 28 Feb 2009 09:58:31 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 68B3F9CB084; Sat, 28 Feb 2009 10:55:15 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SqB+PDxk3fbM; Sat, 28 Feb 2009 10:55:03 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4EF619CB121; Sat, 28 Feb 2009 10:55:03 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n1S9t2Rt062614; Sat, 28 Feb 2009 10:55:02 +0100 (CET) (envelope-from rdivacky) Date: Sat, 28 Feb 2009 10:55:02 +0100 From: Roman Divacky To: Bruce Evans Message-ID: <20090228095502.GA62459@freebsd.org> References: <20090227131155.GE19161@hoeg.nl> <20090227131221.GA60215@freebsd.org> <49A80F4D.8000406@icyb.net.ua> <20090227132242.4ef6a633@kan.dnsalias.net> <20090228175724.D14305@delplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090228175724.D14305@delplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: Ed Schouten , Arch , FreeBSD@freebsd.org, Andriy Gapon Subject: Re: Making LLVM happy: memmove() in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2009 09:58:31 -0000 On Sat, Feb 28, 2009 at 06:43:54PM +1100, Bruce Evans wrote: > On Fri, 27 Feb 2009, Alexander Kabaev wrote: > > >On Fri, 27 Feb 2009 18:05:33 +0200 > >Andriy Gapon wrote: > > > >>on 27/02/2009 15:12 Roman Divacky said the following: > >>>On Fri, Feb 27, 2009 at 02:11:55PM +0100, Ed Schouten wrote: > >>>>Hi all, > >>>> > >>>>The FreeBSD+LLVM folks* noticed Clang generates calls to memmove() > >>>>by itself. I have yet to confirm this, but I assume this is done > >>>>when performing copies of structs greater than a certain size. In > > Why would Clang be that broken? Structs cannot overlap, so they can structs can overlap: struct foo { double x[100]; }; void T(struct foo *F, struct foo* G) { *F = *G; } when F equals to G From owner-freebsd-arch@FreeBSD.ORG Sat Feb 28 12:32:26 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91856106567A for ; Sat, 28 Feb 2009 12:32:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx06.syd.optusnet.com.au (fallbackmx06.syd.optusnet.com.au [211.29.132.8]) by mx1.freebsd.org (Postfix) with ESMTP id 706E78FC1A for ; Sat, 28 Feb 2009 12:32:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by fallbackmx06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n1S7iLYf021623 for ; Sat, 28 Feb 2009 18:44:21 +1100 Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n1S7hs0t026076 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Feb 2009 18:43:55 +1100 Date: Sat, 28 Feb 2009 18:43:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Alexander Kabaev In-Reply-To: <20090227132242.4ef6a633@kan.dnsalias.net> Message-ID: <20090228175724.D14305@delplex.bde.org> References: <20090227131155.GE19161@hoeg.nl> <20090227131221.GA60215@freebsd.org> <49A80F4D.8000406@icyb.net.ua> <20090227132242.4ef6a633@kan.dnsalias.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Ed Schouten , Roman Divacky , FreeBSD@freebsd.org, Andriy Gapon , Arch Subject: Re: Making LLVM happy: memmove() in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2009 12:32:27 -0000 On Fri, 27 Feb 2009, Alexander Kabaev wrote: > On Fri, 27 Feb 2009 18:05:33 +0200 > Andriy Gapon wrote: > >> on 27/02/2009 15:12 Roman Divacky said the following: >>> On Fri, Feb 27, 2009 at 02:11:55PM +0100, Ed Schouten wrote: >>>> Hi all, >>>> >>>> The FreeBSD+LLVM folks* noticed Clang generates calls to memmove() >>>> by itself. I have yet to confirm this, but I assume this is done >>>> when performing copies of structs greater than a certain size. In Why would Clang be that broken? Structs cannot overlap, so they can be copied by memcpy() which should be faster. (However, in the FreeBSD kernel, use of memcpy() is only approved for fixed-sized copies small enough to be inlined, so memcpy() is only a placeholder for the non-inlined case and for abuse, and extensive optimizations are only applied to bcopy() and bcopy() might be faster; however2, the optimizations don't work for any current hardware so memcpy() should be faster than bcopy() because it is simpler. The inlining also fails in all cases since _all_ gcc builtins were turned off many years as a side effect of using -ffreestanding (see below for more details). The loss was so insignficant that no one noticed it. Even now, with the placeholders for memcpy() and memset() abused a lot, fixing their inlining makes no significant difference.) >>>> our kernel, we don't have a memmove() function, but we do have a >>>> bcopy(). >>> >>> also.. quoting from >>> (http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Standards.html): >>> >>> Most of the compiler support routines used by GCC are present in >>> libgcc, but there are a few exceptions. GCC requires the >>> freestanding environment provide memcpy, memmove, memset and memcmp. >>> >>> we were just lucky to not run into this Since this is a bug in gcc, we were unlucky to run into it. These functions are in the application namespace in freestanding environments. Compiler support functions must be named something like __memmove(). FreeBSD started using -ffreestanding mainly to avoid related bugs. The gcc builtin for printf() sometimes translates printf() to use puts() and perhaps any function in stdio. FreeBSD has printf() but not puts() in the kernel so linkage started failing when gcc implemented builtin printf (similarly for a couple of other standard library functions). The problem was fixed by compiling all FreeBSD kernels with -ffreestanding, which was implemented in gcc at about the same time that builtin printf was implemented. -ffreestanding must kill all standard library functions. But them it necessarily kills all builtins for such functions and thus prevents automatic inlining of everything in . >> Some people actually were not that lucky and had to use similar >> workarounds. > > I think we should use this opportunity and make sure we have external > symbols for all of the above mem* functions, not just memmove. Please :) How do you make them fully external so that they are only used by broken external software? Bruce