Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp310515imm; Mon, 9 Jul 2018 02:05:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcL/Kt5PQ3MvFRvJfPWlDv1ekNNv/ljJAHUKyHV5tAtgcsAE/GX3PGKJoOSW2JKArTPdrGw X-Received: by 2002:a62:ac12:: with SMTP id v18-v6mr20184720pfe.126.1531127129377; Mon, 09 Jul 2018 02:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531127129; cv=none; d=google.com; s=arc-20160816; b=T+04Uwa3T4jY5pU6P9BCRXG6ZtdaoYvL5e6gfEyuZleVNSGDmRbrUS95ifF/AtIYfA 4Qlejf8W3WaunmkBQ1AGPpIyysC5+3EyEjzYCySvOUyBkyEOvBULsHmlwVGbSnMdSEW+ hEM12/7c+x8eY8CbkE4fv8B3c9fXREstaAqZwnVw7QUmT+X1VYlyNnlYhUvcJ/qM/5On +y7KC2z/qjC8AtHz3/8hRbYNltsmMZQQf8cvLYY4rb2YQ/D1GwapHPV6+V/H6WPjlNaY 2GFoYZM5imSHPiFP/k/OxQHJl7kYSnni8cdpg+zMLMXMyoQnuz7BPw+5nM+sQOriWyD4 NbfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=FCTITmVXvW84PbhpO3L3mubD3aQ9LXR3+QLOSeJe0x0=; b=uA4OE/trk7375HjVK2Uak784HT994FBEDubI4xA6QJn9Wqn8iOJJ470W5KIKQuDn7V 7yYmLQ1JJYVXq/MANY/8w873ul5JjAF4PgbxQufigQL1xItxZWUmudOlBvd4HkigJdcV PtMUAA9JVIU3SwuTJr/v2jZfhR3BMN8EJztWYMRQC7LKr5m4LdW8wxDLNsFVmc/oL6wZ eOFOGWC5gojo5ie+Um5U3vLU81AdmRQEkHXBRg3WRhY9TQd3PsbPCHHl43FGInVVYYun lc3TmrCqaXw8frqTKrg0yR+Qph3gsgDsW5nOnOk/VntxNaVeyKrVg2Rwirp6Sh1wLWP3 XCgg== ARC-Authentication-Results: i=1; mx.google.com; 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 e17-v6si13084716pgo.144.2018.07.09.02.05.14; Mon, 09 Jul 2018 02:05:29 -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; 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 S933012AbeGIJEJ (ORCPT + 99 others); Mon, 9 Jul 2018 05:04:09 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:43481 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932422AbeGIJEG (ORCPT ); Mon, 9 Jul 2018 05:04:06 -0400 Received: by mail-vk0-f66.google.com with SMTP id d74-v6so10019789vke.10; Mon, 09 Jul 2018 02:04:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FCTITmVXvW84PbhpO3L3mubD3aQ9LXR3+QLOSeJe0x0=; b=r6UO7lEHon5HE6XRC8K8/Op24n+tV10vZgMxqu6+5aSm+xZIIxTwqrupcZv6/6Y2tL cdgpt9FMH8ko54uD27cLvrseCT9hWUnrw4DOEsP5NiftyCGxnEroyBl1vUAjrLFXJsfV K4SfZVKKL0iQeT3MaPr0mLn/38e6lGvg+Rzp+31pJpZjr4brfjxaevkvFlg40vd0c64u bn7WrgW5qQqljWdyL0rDio9saFh5RVVbGgM/RC6ySCZ2XqRBZqr0xx1bm1KHeO9MyHpX E4zX8aM6v6gOy4uNUcuSv2D8Ah20dkrKxQ/9kOAdhBx3OGVs7VLEbChDvkcNc87K/BZs k88Q== X-Gm-Message-State: APt69E3aSIf1w6r/XD+tFOVQb0HenlSL1mAT/XgqSyDa2Ai0SN3C0zeE ONJe+TEc0/glp13bKVGnhfzB3rl7UE7KgRceDYI= X-Received: by 2002:a1f:3701:: with SMTP id e1-v6mr10977164vka.50.1531127045158; Mon, 09 Jul 2018 02:04:05 -0700 (PDT) MIME-Version: 1.0 References: <20180709044444.6397-1-abrodkin@synopsys.com> <20180709054842.GB7618@kroah.com> <71dfb71de86ebe365897b2069bec0cb40b376928.camel@synopsys.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 9 Jul 2018 11:03:54 +0200 Message-ID: Subject: Re: [RESEND PATCH v2] devres: Really align data field to unsigned long long To: Alexey Brodkin Cc: Thomas Gleixner , Linux Kernel Mailing List , Linux-Arch , stable , Greg KH , arcml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexey, On Mon, Jul 9, 2018 at 10:37 AM Alexey Brodkin wrote: > On Mon, 2018-07-09 at 09:52 +0200, Geert Uytterhoeven wrote: > > On Mon, Jul 9, 2018 at 9:22 AM Alexey Brodkin > > wrote: > > > On Mon, 2018-07-09 at 09:07 +0200, Geert Uytterhoeven wrote: > > > > On Mon, Jul 9, 2018 at 7:49 AM Greg KH wrote: > > > > > On Mon, Jul 09, 2018 at 07:44:44AM +0300, Alexey Brodkin wrote: > > > > > > Depending on ABI "long long" type of a particular 32-bit CPU > > > > > > might be aligned by either word (32-bits) or double word (64-bits). > > > > > > > > Or even 16-bit (on e.g. m68k). > > > > > > Indeed, thanks for the note! > > > Will add this in my v3. > > > > Note that in this particular case, the field will probably always be > > aligned to 4 bytes, > > as the struct will be allocated using *alloc(). > > Well I think maybe it worth mentioning only 32-bit and 64-bit alignments in > this particular case because as it was mentioned initially in the comment there're > 3 pointers before "data" field and for 32-bit machines I guess we may safely > assume that a pointer size is 32-bit. > > This leaves us only one problematic situation 32-bit instead of 64-bit alignment. > > > > For ARC I'd like this fix to be back-ported starting > > > from v4.8 where we added support of "native" atomic64_t, see commit > > > ce6365270ecd (" ARCv2: Implement atomic64 based on LLOCKD/SCONDD instructions"). > > > > > > What about m68k, do you have any preference of earliest kernel version > > > where this fix might be useful? > > > > Given m68k is 32-bit, it will access atomic64_t variables while > > holding a spinlock, > > so it should still be safe without this change. > > Well ARC and ARMv7 are 32-bit machines as well still both have > a special instructions to read/write 64-bit data. Sure. > > Not to mention no one will try etnaviv on m68k ;-) > > See it was just a trigger case but other GPUs that use or will use > DRM GPU scheduler are good candidates to it that problem and not to > mention some other users of atomic64_t. > > But from you above comment I may deduce that m68k doesn't have > instructions for 64-bit data; in that case there's no reason to worry > at least about struct devres_node :) That's correct: m68k has no instructions for 64-bit data. 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