From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87641C28CC0 for ; Wed, 29 May 2019 12:01:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 463D420644 for ; Wed, 29 May 2019 12:01:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Nzz9NhjF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbfE2MBe (ORCPT ); Wed, 29 May 2019 08:01:34 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58832 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbfE2MBe (ORCPT ); Wed, 29 May 2019 08:01:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=YPtPUNuDX71Si0dZ9/GsA4yGWJlCJusvLAiyqICMNXY=; b=Nzz9NhjF8qG2NqUpURT9rN5I8 GitsRNBIKtwiTOhTDSPZGCjNfpraqKc9ITf6ZzGPoNENCmd72vVOzeolX69T8ltrz/laD4QSfK/Sm SrDJ0Ebsss5km5xqOMyCWbUtrJOvVLv0blhjI6uB8rkzbUC6AFnWJmc8R0eNi1PanZ9WrsJFl6wIW M7DpaAaRIYsdynADtd2wKisFTn4pvvDjYEna0VzWY+AVxDSjUjyMSRuqv+rx24E1f482BrTqeP2yb PKvkcpDaldigqqxfmU2+iFQunen/H62839PwiNEo0nBqX9o6nbtPUDUx0ULQt+gm1e790tkTTLHo3 Q60lmYXZA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVxGi-0003lQ-Tc; Wed, 29 May 2019 12:01:21 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 45DDD201DA657; Wed, 29 May 2019 14:01:18 +0200 (CEST) Date: Wed, 29 May 2019 14:01:18 +0200 From: Peter Zijlstra To: David Laight Cc: 'Dmitry Vyukov' , Marco Elver , Mark Rutland , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , the arch/x86 maintainers , Arnd Bergmann , Josh Poimboeuf , "open list:DOCUMENTATION" , LKML , linux-arch , kasan-dev Subject: Re: [PATCH 3/3] asm-generic, x86: Add bitops instrumentation for KASAN Message-ID: <20190529120118.GQ2623@hirez.programming.kicks-ass.net> References: <20190528163258.260144-1-elver@google.com> <20190528163258.260144-3-elver@google.com> <20190528165036.GC28492@lakrids.cambridge.arm.com> <20190529100116.GM2623@hirez.programming.kicks-ass.net> <20190529103010.GP2623@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 29, 2019 at 11:20:56AM +0000, David Laight wrote: > From: Dmitry Vyukov > > Sent: 29 May 2019 11:57 > > Interesting. Does an address passed to bitops also should be aligned, > > or alignment is supposed to be handled by bitops themselves? > > The bitops are defined on 'long []' and it is expected to be aligned. > Any code that casts the argument is likely to be broken on big-endian. > I did a quick grep a few weeks ago and found some very dubious code. > Not all the casts seemed to be on code that was LE only (although > I didn't try to find out what the casts were from). > > The alignment trap on x86 could be avoided by only ever requesting 32bit > cycles - and assuming the buffer is always 32bit aligned (eg int []). > But on BE passing an 'int []' is just so wrong .... Right, but as argued elsewhere, I feel we should clean up the dubious code instead of enabling it.