Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp226676imm; Mon, 9 Jul 2018 00:08:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfbPQ4Xf+7bWpryVSs8QoL20tN0reALpOOOC9qoCFGzn5qT9F39V8JiplHNNwPCb8suiI/M X-Received: by 2002:a17:902:b28c:: with SMTP id u12-v6mr19088211plr.16.1531120108620; Mon, 09 Jul 2018 00:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531120108; cv=none; d=google.com; s=arc-20160816; b=XfqWvLfhNTB2FNtm+qWL8cbXIoPVNsJ2mwn0/y8H2+H9nKi6ZeFnnmfKfzumBK3oKM nT5jEsNTiTABhvhrIC+01TwYLICgN1jkYw3U4qbic0bbvFwyH9XHdGMk9MstcQiEQkxY kZHyt1ldYkxFNGT0lH9cVwMCiQfFPNL/MnUUMz3C9xR4T11HV1/1xUvJx3DuUbXENA5J 0SB8hwbv9MnIEj1guo9xBIDGsyBXWYxIeZ5BiVlFsHl5Fq6WyiqHbuSXcGqIBySTncgG 2+P6xUOcLhrAYHJ0ZNZJH0szNdoaryAHdt4p86OgMv5oEBzv85UBNK2XkEMnLz+/fg4z qTWQ== 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=3+Ei7Tkwy8q6+P8lfrNS7E9p8YvClJ8nHDB4mGBSvCA=; b=nhjv8ZEfOYX14Q2vv+TruzMmxHXym0C1DdiGiTQ4JRrB11mYj7/nSOBgzgyriTWqdy 6CWKzEry0rpUKqplezrLRsAGtyr0NMD7WHEndb4NE5DTxj+wqHF2AQg7tv2XTCbhRzGB 3iLopvvChjKMHeyaAVPzaIA1SVGd7eTkrFlM6EcRcS1/ziS6QhyOoSQr8EyYT4ebf/fY UyJg2FB4btdAxO/P7kxG/zTBjH/vvXmpDoD/b/XpH4elyeGLpbpTnQ05qyZYICiSYQP7 G5a9UK3U9XZ3NL9+1WbKp2xndgFJTbwilgbR+wt0orKUsktyit1Uo4vazAOYMVxHBPhw dWkQ== 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 r25-v6si13170220pge.104.2018.07.09.00.08.14; Mon, 09 Jul 2018 00:08:28 -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 S1754410AbeGIHH1 (ORCPT + 99 others); Mon, 9 Jul 2018 03:07:27 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:46068 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752894AbeGIHHZ (ORCPT ); Mon, 9 Jul 2018 03:07:25 -0400 Received: by mail-ua0-f195.google.com with SMTP id z4-v6so11068689uao.12; Mon, 09 Jul 2018 00:07:25 -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=3+Ei7Tkwy8q6+P8lfrNS7E9p8YvClJ8nHDB4mGBSvCA=; b=bHT7dyDsJXFJYKRcofdiHTelIdEs1LjwKTGRhkD3Tl21g4RpSJSUwlR/WMhTP+yJbV wpFf5GjZMWtIJmojfyic64/EZgV9echkCVACxS2BjvvCFKgwGmi/mWpTomsJ1hW9LqZ0 PBe7xN0vBJ952UFr8TiyirymVti2n/CwCcNs4ueiUv/4cxFqhH81PEh1reGGZxLR86aE DtG9sM/f4WKPi7+DPEohkbDR81nEbbSa5lKlOcOVGKfoiyxWOgMNcZ3PYK7a1o9B91SL lSbknqzBCOtlvvr0WnWDnc0TbGQ17xcf9Niy21FXUk2q6sAJ38NWcJXtgUEG0eydzAPf bJeA== X-Gm-Message-State: APt69E3ThiQRVsUVnP7Ka3NjaObFDoH9xwxsq4QQPlM/8xy5UwPMT4GY oNDe1spB7CSR7hZlt8A34wa41sWUTjwJ+cP8Ug4= X-Received: by 2002:ab0:80e:: with SMTP id a14-v6mr12938549uaf.114.1531120044756; Mon, 09 Jul 2018 00:07:24 -0700 (PDT) MIME-Version: 1.0 References: <20180709044444.6397-1-abrodkin@synopsys.com> <20180709054842.GB7618@kroah.com> In-Reply-To: <20180709054842.GB7618@kroah.com> From: Geert Uytterhoeven Date: Mon, 9 Jul 2018 09:07:13 +0200 Message-ID: Subject: Re: [RESEND PATCH v2] devres: Really align data field to unsigned long long To: Greg KH Cc: Alexey Brodkin , Linux Kernel Mailing List , arcml , Linux-Arch , Thomas Gleixner , stable 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 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). > > --- a/drivers/base/devres.c > > +++ b/drivers/base/devres.c > > @@ -24,8 +24,12 @@ struct devres_node { > > > > struct devres { > > struct devres_node node; > > - /* -- 3 pointers */ > > - unsigned long long data[]; /* guarantee ull alignment */ > > + /* > > + * 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). > > + * Make sure "data" is really 64-bit aligned for any 32-bit CPU. > > + */ > > + unsigned long long data[] __aligned(sizeof(unsigned long long)); > > }; > > Does this change the padding today for any other arches? If so, does > the increased memory usage cause any noticable issues? Yes it does. struct devres_node contains an odd number of pointers, so there will be a hole between node and data on all 32-bit architectures. 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