From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Bottomley Subject: Re: bit fields && data tearing Date: Mon, 08 Sep 2014 15:43:48 -0700 Message-ID: <1410216228.2027.88.camel@jarvis.lan> References: <21512.10628.412205.873477@gargle.gargle.HOWL> <20140904090952.GW17454@tucnak.redhat.com> <540859EC.5000407@hurleysoftware.com> <20140904175044.4697aee4@alan.etchedpixels.co.uk> <5408C0AB.6050801@hurleysoftware.com> <20140905001751.GL5001@linux.vnet.ibm.com> <1409883098.5078.14.camel@jarvis.lan> <5409243C.4080704@hurleysoftware.com> <20140905040645.GO5001@linux.vnet.ibm.com> <1410066442.12512.13.camel@jarvis.lan> <20140907162146.GK5001@linux.vnet.ibm.com> <1410116687.2027.19.camel@jarvis.lan> <540CC305.8010407@hurleysoftware.com> <1410155407.2027.29.camel@jarvis.lan> <540E1587.3060108@tilera.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <540E1587.3060108@tilera.com> Sender: linux-ia64-owner@vger.kernel.org To: Chris Metcalf Cc: Peter Hurley , paulmck@linux.vnet.ibm.com, "H. Peter Anvin" , One Thousand Gnomes , Jakub Jelinek , Mikael Pettersson , Benjamin Herrenschmidt , Richard Henderson , Oleg Nesterov , Miroslav Franc , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Tony Luck , linux-ia64@vger.kernel.org List-Id: linux-arch.vger.kernel.org On Mon, 2014-09-08 at 16:45 -0400, Chris Metcalf wrote: > On 9/8/2014 1:50 AM, James Bottomley wrote: > > Actual alignment is pretty irrelevant. That's why all architectures > > which require alignment also have to implement misaligned traps ... this > > is a fundamental requirement of the networking code, for instance. > > Can you clarify what you think the requirement is? The tile architecture > doesn't support misaligned load/store in general, but we do support it for > userspace (using a nifty JIT approach with a direct-map hash table kept > in userspace), and also for get_user/put_user. But that's it, and, > the networking subsystem works fine for us. This was years ago (possibly decades). We had to implement in-kernel unaligned traps for the networking layer because it could access short and int fields that weren't of the correct alignment when processing packets. It that's all corrected now, we wouldn't really notice (except a bit of a speed up since an unaligned trap effectively places the broken out instructions into the bit stream). James > Occasionally we report bugs for driver code that doesn't use the > get_unaligned_xxx() macros and friends, and our fixes are generally taken > upstream. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bedivere.hansenpartnership.com ([66.63.167.143]:41253 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754951AbaIHWnu (ORCPT ); Mon, 8 Sep 2014 18:43:50 -0400 Message-ID: <1410216228.2027.88.camel@jarvis.lan> Subject: Re: bit fields && data tearing From: James Bottomley Date: Mon, 08 Sep 2014 15:43:48 -0700 In-Reply-To: <540E1587.3060108@tilera.com> References: <21512.10628.412205.873477@gargle.gargle.HOWL> <20140904090952.GW17454@tucnak.redhat.com> <540859EC.5000407@hurleysoftware.com> <20140904175044.4697aee4@alan.etchedpixels.co.uk> <5408C0AB.6050801@hurleysoftware.com> <20140905001751.GL5001@linux.vnet.ibm.com> <1409883098.5078.14.camel@jarvis.lan> <5409243C.4080704@hurleysoftware.com> <20140905040645.GO5001@linux.vnet.ibm.com> <1410066442.12512.13.camel@jarvis.lan> <20140907162146.GK5001@linux.vnet.ibm.com> <1410116687.2027.19.camel@jarvis.lan> <540CC305.8010407@hurleysoftware.com> <1410155407.2027.29.camel@jarvis.lan> <540E1587.3060108@tilera.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Chris Metcalf Cc: Peter Hurley , paulmck@linux.vnet.ibm.com, "H. Peter Anvin" , One Thousand Gnomes , Jakub Jelinek , Mikael Pettersson , Benjamin Herrenschmidt , Richard Henderson , Oleg Nesterov , Miroslav Franc , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Tony Luck , linux-ia64@vger.kernel.org Message-ID: <20140908224348.GbLhEwU-WbPk_DR0HOg3NdfvfuNHRKCiSVoLvp61c1w@z> On Mon, 2014-09-08 at 16:45 -0400, Chris Metcalf wrote: > On 9/8/2014 1:50 AM, James Bottomley wrote: > > Actual alignment is pretty irrelevant. That's why all architectures > > which require alignment also have to implement misaligned traps ... this > > is a fundamental requirement of the networking code, for instance. > > Can you clarify what you think the requirement is? The tile architecture > doesn't support misaligned load/store in general, but we do support it for > userspace (using a nifty JIT approach with a direct-map hash table kept > in userspace), and also for get_user/put_user. But that's it, and, > the networking subsystem works fine for us. This was years ago (possibly decades). We had to implement in-kernel unaligned traps for the networking layer because it could access short and int fields that weren't of the correct alignment when processing packets. It that's all corrected now, we wouldn't really notice (except a bit of a speed up since an unaligned trap effectively places the broken out instructions into the bit stream). James > Occasionally we report bugs for driver code that doesn't use the > get_unaligned_xxx() macros and friends, and our fixes are generally taken > upstream.