From owner-svn-src-all@FreeBSD.ORG Tue Sep 10 15:10:04 2013 Return-Path: Delivered-To: svn-src-all@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 CD8BFE6A; Tue, 10 Sep 2013 15:10:04 +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 2B779223A; Tue, 10 Sep 2013 15:10:03 +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 r8AF9sbq029307; Tue, 10 Sep 2013 18:09:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r8AF9sbq029307 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r8AF9sYC029306; Tue, 10 Sep 2013 18:09:54 +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:09:54 +0300 From: Konstantin Belousov To: Matthew Fleming Subject: Re: svn commit: r255439 - head/sys/dev/cpuctl Message-ID: <20130910150954.GW41229@kib.kiev.ua> References: <201309100517.r8A5HrHY020358@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ben6AifVmj+t9BPa" Content-Disposition: inline In-Reply-To: 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2013 15:10:04 -0000 --ben6AifVmj+t9BPa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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? The comment about 4-byte alignment is for VIA. For Intel, citing the IA-32 SDM rev. 47, Vol.3, 9.11.6 Microcode Update Loa= der: "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. --ben6AifVmj+t9BPa Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iQIcBAEBAgAGBQJSLzZCAAoJEJDCuSvBvK1ByxcP/RZscqNhXWdzAITJdE9T/6k2 T4nsl05pp29JLRFxOadu/q6aLLLM6ICKvmL4NdFGREw/tuZM63+Fnon2TAQkzZqw JZBF8vRaF2ohtUIL+lXCj6rxCyHMrmwopvTT6NrBTiMeacHd1t6OotERyuDMDjNS mND1QxoDfK/WpHPaf+KMjFz6a7MvXQvz0UF3d3eSqtXBOtDN+35mKdStB2814lJt oOkIgLf9Vy2UYtJ/wUVGyoXs8sVVHtEwjPwGioJ/xruAwzY5w6dkdN3wWSN3WcVe r+DcnHjPpAf7ee7AGcfjSubiU9+rk7Jj1Ft8MXVFlFEVLU0BsQgylHdyxKQrXPe1 S1S4/hEdnJUP23X8Sf+R0KpcKcFRVxRMBUFdTrK3Fkz+s/afSyCYL7OJ+X403S+d 2wFCa5YxzY4hfjffgcE3YCDHvHlYa/LNeTpoV3+oZ6Re55sdMOMW3l6x9URf0qwX 5XtC7+2WtcnSA7t/V+VkbYmEYK6r+zBc61DwzuL31I2GvVyt6/+5jL75nS25zgzR n9jY3ztHMIZEBItwbNn6zqskg9lb8qxAwC8wlPDPYnuPmzSXrc5WqE6Q+AGZEQ6d 2TE+GDNwJHw0SxpFfBq6cbYAakLPKDD1hIOjtvqreLWabr8p9bClvoc7OKO7Gp06 c7TO0taxvkmRr7R6uHkV =8wqz -----END PGP SIGNATURE----- --ben6AifVmj+t9BPa--