Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp578742imm; Mon, 9 Jul 2018 07:06:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf0CEjMs2A1KI5m4YCnKA7CFcCpnqB1cfovcXSFo+m6bwrsyl3mdh+RRSnZ9KZls/5FNAnS X-Received: by 2002:a17:902:88:: with SMTP id a8-v6mr20303786pla.156.1531145203656; Mon, 09 Jul 2018 07:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531145203; cv=none; d=google.com; s=arc-20160816; b=Lo1eMkKmNJwxaJI4YRYWNwEwJAb8ZeJ/3srHEbLyGYHbvcNeBjftGgfu78curnMlfj mOTosGVQZz8Kipwh54EDHXSd2i99Rajo79JHXT36mQQK4SLsINGDJLlrgvjg9y5JSWIY UsL5llOqUR9LkAUDcprizNIxaiUJd6qA9cQnLeOvQOos9u5W792fTkknYAb2VHQ2NSCA pdCp5QqeK+E0yKUbQDoM5OWUmEc35NrciYk5lGV0F0Wyke+hWLR4VlfWbmRhXjGDtemy BngGOgTjnkE91TTHrvLlqeaTRy9WJFe9SKfFL+PNe3ukx93NuDcoVX9IOgnzKQLVRwWA 9icg== 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:arc-authentication-results; bh=skY1rec6DbMsYEOSE0ejG2iW4tOc00qR+aKnb28opRQ=; b=D3/0NiD8Vfz7vN1Yxj+TUmHvcjtIpYI/4cm9fCQT1IZb2xyj5hop0K3h/Dx5gpGtM8 9s6rVvRIYgQLQlgFLwlkD6eRGnA7rbKWToj2vbILfI0t2+/X5PAzeh7PQpxjV4Mp5AgX 9L83u/Ks/nbIzgU70EwsFD5GoTrCr7fYgVr8tCI7AhgqK9MdvkUCl5RoLyQikyNLP9mW B/y+nbPAsnL1zHKb9T+leTMzSU+zMq1SPKTUciHlaobPeOljjxAWKFNnqr2bcaziZW+h EDn5TQNTJjQXBqAaVB6VOqK0qmBtyZA4/V4DV2vrqwPvMf2gejhybNKWDTj/LySBOAfl m0nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=BwkUPqed; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4-v6si14673328plc.436.2018.07.09.07.06.26; Mon, 09 Jul 2018 07:06:43 -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=@armlinux.org.uk header.s=pandora-2014 header.b=BwkUPqed; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932931AbeGIOEl (ORCPT + 99 others); Mon, 9 Jul 2018 10:04:41 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:34038 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932827AbeGIOEi (ORCPT ); Mon, 9 Jul 2018 10:04:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: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=skY1rec6DbMsYEOSE0ejG2iW4tOc00qR+aKnb28opRQ=; b=BwkUPqedI0FQzRDRVeyaprCyE IAPYLm48aUP5NdJXGtw1q+M9Lqtp4Tb0T62JmFkNw0+3Sbrka+Ptf3k9U7TctQbgJ3PqVgQ6WlBIp iX6WBZ0lyB83Ewb+5hjkH2s50zPrLR48RyIl7ptZm7qF4T/zhv0hqTbhxZzwpaVZXBAp0=; Received: from n2100.armlinux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:44450) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1fcWmB-00064Q-1a; Mon, 09 Jul 2018 15:04:27 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1fcWm7-0001cA-0y; Mon, 09 Jul 2018 15:04:23 +0100 Date: Mon, 9 Jul 2018 15:04:21 +0100 From: Russell King - ARM Linux To: Alexey Brodkin Cc: linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arch@vger.kernel.org, Will Deacon , Peter Zijlstra , Boqun Feng , Arnd Bergmann , Thomas Gleixner , Ingo Molnar , Darren Hart , Shuah Khan , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , David Laight , Geert Uytterhoeven , Greg Kroah-Hartman Subject: Re: [PATCH] atomic{64}_t: Explicitly specify data storage length and alignment Message-ID: <20180709140421.GF17271@n2100.armlinux.org.uk> References: <20180709124741.21037-1-abrodkin@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180709124741.21037-1-abrodkin@synopsys.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2018 at 03:47:41PM +0300, Alexey Brodkin wrote: > Atomic instructions require data they operate on to be aligned > according to data size. I.e. 32-bit atomic values must be 32-bit > aligned while 64-bit values must be 64-bit aligned. > > Otherwise even if CPU may handle not-aligend normal data access, > still atomic instructions fail and typically raise an exception > leaving us dead in the water. > > This came-up during lengthly discussion here: > http://lists.infradead.org/pipermail/linux-snps-arc/2018-July/004022.html > > Signed-off-by: Alexey Brodkin > Cc: Will Deacon > Cc: Peter Zijlstra > Cc: Boqun Feng > Cc: Russell King > Cc: Arnd Bergmann > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Darren Hart > Cc: Shuah Khan > Cc: "Paul E. McKenney" > Cc: Josh Triplett > Cc: Steven Rostedt > Cc: Mathieu Desnoyers > Cc: Lai Jiangshan > Cc: David Laight > Cc: Geert Uytterhoeven > Cc: Greg Kroah-Hartman > --- > arch/arm/include/asm/atomic.h | 2 +- > include/asm-generic/atomic64.h | 2 +- > include/linux/types.h | 4 ++-- > tools/include/linux/types.h | 2 +- > tools/testing/selftests/futex/include/atomic.h | 2 +- > .../rcutorture/formal/srcu-cbmc/include/linux/types.h | 4 ++-- > 6 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h > index 66d0e215a773..2ed6d7cf1407 100644 > --- a/arch/arm/include/asm/atomic.h > +++ b/arch/arm/include/asm/atomic.h > @@ -267,7 +267,7 @@ ATOMIC_OPS(xor, ^=, eor) > > #ifndef CONFIG_GENERIC_ATOMIC64 > typedef struct { > - long long counter; > + u64 __aligned(8) counter; > } atomic64_t; ARM doesn't need or require this change, and you're changing the type from signed to unsigned, which is likely to break stuff. So, NAK on this from the ARM point of view. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 13.8Mbps down 630kbps up According to speedtest.net: 13Mbps down 490kbps up