From owner-freebsd-arm@freebsd.org Sat Dec 19 20:58:34 2015 Return-Path: Delivered-To: freebsd-arm@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 B8202A4DC28 for ; Sat, 19 Dec 2015 20:58:34 +0000 (UTC) (envelope-from iz-rpi03@hs-karlsruhe.de) Received: from smtp.hs-karlsruhe.de (smtp.HS-Karlsruhe.DE [193.196.64.25]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D3F91F4D; Sat, 19 Dec 2015 20:58:33 +0000 (UTC) (envelope-from iz-rpi03@hs-karlsruhe.de) Received: from iz-wera01.hs-karlsruhe.de ([193.196.65.46]) by smtp.hs-karlsruhe.de with esmtp (Exim 4.80.1) (envelope-from ) id 1aAOa8-007Wk6-Mg; Sat, 19 Dec 2015 21:58:24 +0100 X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 From: Ralf Wenk To: Ian Lepore cc: freebsd-arm , Rui Paulo , John-Mark Gurney , Warner Losh Subject: Re: mount_smbfs In-reply-to: <1450487583.25138.132.camel@freebsd.org> References: <54B9DCD1.3040306@foxvalley.net> <4759EAA0-D4AA-4923-9350-B7E753819169@me.com> <6E32991C3BD8465DB8DB0E65DFDA47AA@ad.peach.ne.jp> <20150123195403.GO1949@funkthat.com> <20150123213619.GP1949@funkthat.com> <1450487583.25138.132.camel@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 19 Dec 2015 21:58:23 +0100 Message-Id: X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2015 20:58:34 -0000 Ian Lepore wrote on Fri, 18 Dec 2015 at 18:13:03 -0700: > On Fri, 2015-01-23 at 13:36 -0800, John-Mark Gurney wrote: > > Warner Losh wrote this message on Fri, Jan 23, 2015 at 13:21 -0800: > > > > > > > On Jan 23, 2015, at 11:54 AM, John-Mark Gurney wrote: > > > > > > > > Daisuke Aoyama wrote this message on Sat, Jan 24, 2015 at 03:07 +0900: > > > > > Quick hack patch is attached. > > > > > > > > Please use {l,b}e16dec, or if the code is suppose to be native endian, > > > > make it dependant on __NO_STRICT_ALIGNMENT and add the proper endian > > > > swap, not __arm__ as there are other arches that require the same fix... > > > > > > If there???s just a couple of places that need this, don???t bother making them dependent > > > on __NO_STRICT_ALIGNMENT. That clutters things up a bit too much. Given the 3 > > > or 4 places this is used, and the relative infrequency of the calls, just doing a memcpy > > > unconditionally is always correct and reduces the risk of one branch of the #if being > > > changed w/o the other. Since it is already using NBENCODE(), I think that using > > > {l,b}e16enc (not dec) would be a larger code churn. > > > > Clearly neither of us looked at the code closely... NBENCODE should be > > rewritten to take a pointer and use le16enc... Then memsetw should just > > call NBENCODE internally as it goes... > > Well I looked at the code closely, even if it did take me almost a year > to get around to it. :) > > The conclusion I reached is that alignment and endian problems should > just be turned into a non-issue by discarding the existing macro and > memsetw() function and writing a new inline function that deals purely > with bytes instead of 16-bit values. > > It's up for review on phabricator at https://reviews.freebsd.org/D4622 > > And I'll also attach the diff to this mail for anyone who wants to test > it (which I can't do, no smb server). Done. Your patch applied to revision 292468 is working here nice. The PR https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=180438 could be added to the phabricator information as well. Thank you. Ralf