From owner-svn-src-head@freebsd.org Wed Mar 15 19:21:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDCD4D0EB61; Wed, 15 Mar 2017 19:21:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEF108B7; Wed, 15 Mar 2017 19:21:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id B881810A7B9; Wed, 15 Mar 2017 15:21:57 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r315323 - head/sys/kern Date: Wed, 15 Mar 2017 12:21 -0700 Message-ID: <3167768.s4jIG6eyGp@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201703151823.v2FINWN9083379@repo.freebsd.org> References: <201703151823.v2FINWN9083379@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 15 Mar 2017 15:21:57 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 15 Mar 2017 19:21:58 -0000 On Wednesday, March 15, 2017 06:23:32 PM John Baldwin wrote: > Author: jhb > Date: Wed Mar 15 18:23:32 2017 > New Revision: 315323 > URL: https://svnweb.freebsd.org/changeset/base/315323 > > Log: > Use UMA_ALIGN_PTR instead of sizeof(void *) for zone alignment. > > uma_zcreate()'s alignment argument is supposed to be sizeof(foo) - 1, > and uma.h provides a set of helper macros for common types. Passing > sizeof(void *) results in all of the members being misaligned triggering > unaligned access faults on certain architectures (notably MIPS). > > Reported by: brooks > Obtained from: CheriBSD > MFC after: 3 days > Sponsored by: DARPA / AFRL > > Modified: > head/sys/kern/vfs_lookup.c We should perhaps add a KASSERT() to uma_zcreate to catch this sort of thing. Something like KASSERT(powerof2(align + 1)) (assuming there isn't a real use case for having non-power-of-2 alignments)? -- John Baldwin