Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6234837ybi; Wed, 29 May 2019 05:03:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxX9PP3FB6qDk0wlqWRREctmozMjEnEjUcyATU9auObCu1CUtS633e+wbSSvsWo7hlIgYhd X-Received: by 2002:a62:7d10:: with SMTP id y16mr148457506pfc.116.1559131422567; Wed, 29 May 2019 05:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559131422; cv=none; d=google.com; s=arc-20160816; b=Cc3hZ5QZG/UwPoGKDqv0K/NSz11mDAxRaGJEjsT+x7IpN/FYEFrdKGhKAeY7X5nrXV n0tJf1Kucx3ffi2m2Lh1oQ3ExoXaXK6tKaiQIYkTUxD+u7OgSuxyQKMMadShpUldTGdQ VLW5ZF9WoSA4fh2nXo7Cu0Y/hyeDo6DFVsIiTrK90R6pXyTNfFKmFO2Ri+4DOtjPFzGA Tg1t6i/b0Eq/AIJVoNUhkTmcc13pt5b4iiqLT8BVzoN2zbtETxXtm12Mh67m9idFkWGI Ec+1CPOQOY0JH3RCdcrNCR7J2x0IEoRnDfbmfYqo3PEewCHrtXRCmcvp6KtWToOrpm98 lT9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YPtPUNuDX71Si0dZ9/GsA4yGWJlCJusvLAiyqICMNXY=; b=OXwGEUC+7MLgfgiERl8vvqx5WsWY3sT9LDHr6iRUE2Aop3g6hu3MNDt09ZVvkz4X8z yDCWuvpvbrcx+1iEkVoMoQkbsDg+m0mmhiSZnRuCS6RD5G1Nqh0PgF7o3sp7rF/8Mn1X PGSCMiLzHwK28Tq/wOkZU0wXQdRCLGFryCFknzu0LQN4pDRHjKqqxzxB8s+knp5qRTLw FeyW3IW33gh9imdkYoIB/jgPGJ1EbQW4RQbNZ0SCq0mRnhOLG9SUj3GHHTDQ36zTIIcA YhO4qnhPWbx+KGLFkopvy7iByf6KrF0puNChek8MhvPB2O28EhfQl04YktFLvYQQoo0s 2cAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Nzz9NhjF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5si25435199pln.41.2019.05.29.05.03.19; Wed, 29 May 2019 05:03:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Nzz9NhjF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726612AbfE2MBe (ORCPT + 99 others); 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.