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.5 required=3.0 tests=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 5816DC04AB5 for ; Thu, 6 Jun 2019 09:43:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3718620872 for ; Thu, 6 Jun 2019 09:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728229AbfFFJnu (ORCPT ); Thu, 6 Jun 2019 05:43:50 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42558 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727740AbfFFJnr (ORCPT ); Thu, 6 Jun 2019 05:43:47 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x569af6o083746 for ; Thu, 6 Jun 2019 05:43:46 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2sxyqe2cc2-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 06 Jun 2019 05:43:46 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Jun 2019 10:43:44 +0100 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 6 Jun 2019 10:43:41 +0100 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x569heXG27787628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 6 Jun 2019 09:43:41 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D7E76B2066; Thu, 6 Jun 2019 09:43:40 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A7394B205F; Thu, 6 Jun 2019 09:43:40 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.136.182]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 6 Jun 2019 09:43:40 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 25C7916C3A57; Thu, 6 Jun 2019 02:43:40 -0700 (PDT) Date: Thu, 6 Jun 2019 02:43:40 -0700 From: "Paul E. McKenney" To: Geert Uytterhoeven Cc: Vineet Gupta , Peter Zijlstra , Will Deacon , arcml , lkml , "linux-arch@vger.kernel.org" Subject: Re: single copy atomicity for double load/stores on 32-bit systems Reply-To: paulmck@linux.ibm.com References: <2fd3a455-6267-5d21-c530-41964a4f6ce9@synopsys.com> <20190531082112.GH2623@hirez.programming.kicks-ass.net> <20190603201324.GN28207@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 19060609-0052-0000-0000-000003CC2620 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011223; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01213992; UDB=6.00638109; IPR=6.00995071; MB=3.00027205; MTD=3.00000008; XFM=3.00000015; UTC=2019-06-06 09:43:44 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19060609-0053-0000-0000-00006134604B Message-Id: <20190606094340.GD28207@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-06_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906060070 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 04, 2019 at 09:41:04AM +0200, Geert Uytterhoeven wrote: > Hi Paul, > > On Mon, Jun 3, 2019 at 10:14 PM Paul E. McKenney wrote: > > On Mon, Jun 03, 2019 at 06:08:35PM +0000, Vineet Gupta wrote: > > > On 5/31/19 1:21 AM, Peter Zijlstra wrote: > > > >> I'm not sure how to interpret "natural alignment" for the case of double > > > >> load/stores on 32-bit systems where the hardware and ABI allow for 4 byte > > > >> alignment (ARCv2 LDD/STD, ARM LDRD/STRD ....) > > > > Natural alignment: !((uintptr_t)ptr % sizeof(*ptr)) > > > > > > > > For any u64 type, that would give 8 byte alignment. the problem > > > > otherwise being that your data spans two lines/pages etc.. > > > > > > Sure, but as Paul said, if the software doesn't expect them to be atomic by > > > default, they could span 2 hardware lines to keep the implementation simpler/sane. > > > > I could imagine 8-byte types being only four-byte aligned on 32-bit systems, > > but it would be quite a surprise on 64-bit systems. > > Or two-byte aligned? > > M68k started with a 16-bit data bus, and alignment rules were retained > when gaining a wider data bus. > > BTW, do any platforms have issues with atomicity of 4-byte types on > 16-bit data buses? I believe some embedded ARM or PowerPC do have > such buses. But m68k is !SMP-only, correct? If so, the only issues would be interactions with interrupt handlers and the like, and doesn't current m68k hardware use exact interrupts? Or is it still possible to interrupt an m68k in the middle of an instruction like it was in the bad old days? Thanx, Paul > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds