From owner-freebsd-arch@FreeBSD.ORG Wed Feb 5 20:52:18 2014 Return-Path: Delivered-To: freebsd-arch@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 623EAAA6 for ; Wed, 5 Feb 2014 20:52:18 +0000 (UTC) Received: from mail-ig0-f175.google.com (mail-ig0-f175.google.com [209.85.213.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B2A5184D for ; Wed, 5 Feb 2014 20:52:17 +0000 (UTC) Received: by mail-ig0-f175.google.com with SMTP id uq10so14259240igb.2 for ; Wed, 05 Feb 2014 12:52:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=h9wYSb2mVSkbhe6vT3iWgYgRGuzOciUjQI9c/0+ROBk=; b=MN+3ErKKkg6uDCrd5YAi2DDnKjCHS3EFXEF/NdRgVnRdy3N5sI50hymoqYGG3+AnPj l4Uc4+YFHpkW5Hb/XpSaroOS4BIk2IegHgIjWg4FhvDI9I2RZdShOl70ifQvAZ+7GBKE ssJnVkJE0cIjPcFHOvTLg0GVXQME0mps279on1od24PcG3rREc1XNx/z4ZeGiMBR2S+K QLnl7IoSDyqr/NaJRe+EP/jmT0lU1LDHnPei9r7a0jMF8jABJo8miubiOEUGJJhPwl0p ZRa56Zf1pjURR1EUIeGWoPrDMfJsjIBR50DS4dAgHwSE7aRcBQoVCpAWbPTbIxdY/0S1 DkMw== X-Gm-Message-State: ALoCoQmVSdZQ6lI9xgLsyFCVZW56fO6ombEqbIIe5UmwPcmhreRC3Gr8A1NoZTXss5VqvRcB/Xp/ X-Received: by 10.43.16.2 with SMTP id pw2mr3329836icb.56.1391633526322; Wed, 05 Feb 2014 12:52:06 -0800 (PST) Received: from fusionlt2834a.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id ml2sm51832255igb.10.2014.02.05.12.52.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 12:52:05 -0800 (PST) Sender: Warner Losh Subject: Re: Malloc alignment in libstand / loader(8) Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <2882663.sRzekugaiD@ralph.baldwin.cx> Date: Wed, 5 Feb 2014 13:51:56 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <0AB67017-D232-40CF-A8F2-382F5A5A92B1@bsdimp.com> References: <1391576134.1196.21.camel@revolution.hippie.lan> <2882663.sRzekugaiD@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.1085) Cc: Ian Lepore , freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 20:52:18 -0000 On Feb 5, 2014, at 6:29 AM, John Baldwin wrote: > On Tuesday, February 04, 2014 09:55:34 PM Ian Lepore wrote: >> On newer ARM chips, the device drivers used by loader(8) require that >> I/O buffers be aligned on cache line sized boundaries. The drivers = are >> part of u-boot which serves as a sort of load-time bios. >>=20 >> Attached is a patch that sets the malloc alignment in libstand to 64 >> bytes when compiled on ARM, and leaves it at 16 bytes for all other >> platforms. If there are no objections I'd like to commit this soon. >>=20 >> I've tested this on ARM, but have no way to test it on other = platforms. >> The changes should be a no-op on other platforms. >=20 > I think this looks fine, but perhaps use CTASSERT() instead of rolling = your=20 > own? (I would say to use _Static_assert(), but I don't think that = works with=20 > our old GCC) I'd enable it for mips and powerpc, the other two platforms that have = uboot callback support. Other than that, the change looks good to me. Warner