From owner-svn-src-head@FreeBSD.ORG Tue Sep 10 15:12:18 2013 Return-Path: Delivered-To: svn-src-head@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 ESMTP id 99E94348; Tue, 10 Sep 2013 15:12:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F8BC2285; Tue, 10 Sep 2013 15:12:17 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r8AFCDj2030355; Tue, 10 Sep 2013 18:12:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r8AFCDj2030355 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r8AFCDfB030354; Tue, 10 Sep 2013 18:12:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Sep 2013 18:12:13 +0300 From: Konstantin Belousov To: Matthew Fleming Subject: Re: svn commit: r255439 - head/sys/dev/cpuctl Message-ID: <20130910151213.GX41229@kib.kiev.ua> References: <201309100517.r8A5HrHY020358@svn.freebsd.org> <20130910150954.GW41229@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="e/XVYMvPYdBe01jS" Content-Disposition: inline In-Reply-To: <20130910150954.GW41229@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2013 15:12:18 -0000 --e/XVYMvPYdBe01jS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 10, 2013 at 06:09:54PM +0300, Konstantin Belousov wrote: > On Tue, Sep 10, 2013 at 07:29:51AM -0700, Matthew Fleming wrote: > > I don't know exactly what the stock malloc(9) will return, but memguard= (9), > > under its default mode with vm.memguard.options having MG_GUARD_AROUND = set > > will align the returned pointer to only 16 bytes. When I added that > > feature I almost made it 8 bytes, but I think I saw that uma(9) had a > > 16-byte alignment so I preserved that. I.e., this code does still work > > with malloc(9) and memguard(9). > >=20 > > But why does this need 16 byte alignment? Especially when one of the > > comments says 4-byte alignment? >=20 > The comment about 4-byte alignment is for VIA. >=20 > For Intel, citing the IA-32 SDM rev. 47, Vol.3, 9.11.6 Microcode Update L= oader: > "The microcode update data requires a 16-byte boundary alignment". > I.e. CPU takes the linear address of the buffer, which must be aligned > on 16 bytes. Sent too fast. There is at least one more instance of the same use, see bus_dmamem_alloc() in sys/x86/x86/busdma_machdep.c. --e/XVYMvPYdBe01jS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iQIcBAEBAgAGBQJSLzbMAAoJEJDCuSvBvK1BmmEP/j1wqPDvwOPdhFnRlmsZttCs qBf2lDvodZ86Yr5vfpiaS8DYMI0eRruRiAKctfE5QK02+7E0Eo1Bpwr0SoeJP7pt 8eYJB7LRbM+UDgHncaYRO0WyZ1mhc1HdDHbUbqCO1oQSpvcfFzqTmk3EjawCBPk7 lqLWiKsbcsrnqsA8gHzPA/s2ekWn2ffkbxWJiNxyEAPJmgJr8/wFxa7NZl5QkdSb WhQa3AvIerT3vrrNDBRd8dOmZU5LEp7xkbzU8X8c9XUxrednMD9ozzkvpnxyMCKr HST9Ulhv3RtIErFLKHe+t1jeJkb24l8B0Us+8nRSm+2+cYKs3l/aBmYxRZIpr2hT mpmMcyp/201s924S40SBVI5O94IHMralKwZqG0t6pFX2WlHfrvQH4lGDCM57kAgR +l06z9OffS9j72Lu0tjd9IzgcBP8JjQtcXQ52zC1DW1ix6tKalMzJK1vCwlzvdQd eaV4DuPzRrK1kzbweH0jwW2lnSEtTGYeQGm0SNJz4sDYDTbX5QToqSYFhUmsgva7 Vocde215hdLVYKw0nII2O30Whi1eQz7VNcdvsoJYpDMlPu2sQHIKQg6/W6RzAxII 5FcuAMK5ZJrYpQOPs8CF7mjd1BRbQF6Tk8tcSxOfB3jXtV1GjlL0WYxbbtW+LrIV 63CgwmHijWbyeDFhMYLw =jUQ9 -----END PGP SIGNATURE----- --e/XVYMvPYdBe01jS--