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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48C5AECAAD2 for ; Fri, 26 Aug 2022 10:17:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245723AbiHZKRY (ORCPT ); Fri, 26 Aug 2022 06:17:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245717AbiHZKRX (ORCPT ); Fri, 26 Aug 2022 06:17:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7760D9AFE7; Fri, 26 Aug 2022 03:17:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0834E61495; Fri, 26 Aug 2022 10:17:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63525C433C1; Fri, 26 Aug 2022 10:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661509041; bh=p78Wg7gKlUmKu/uPYjSTRS7XNkVmblFGqs5RQx0zpIQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rNzcIAHJOBUlkVmhw2qeW+WZZAWjpcvuuYdGBiqZ6Eb8RjDGgMr9EwefgIEod0sDT nqzTR+AJf/9rRHhz80R87DFa+abRS/v770JiWBGJebPlWNr9Ch3NmY9G730c6BZSvg a50UCxonxSirKurrjW2ls4lLGQXbuq47RstKyGeH/7ttj7zb4vS8xTfIt8NC+XbYoN ec28/QFiqMxByDSxyOPmXa5ytgjFQQY6lI/gT3dnc2NOtSVFRhgvGTKSxrUQ65F0FQ FSu5Q14mmbYHeSKV82nzu9PXV+9btHDpUpcJSjgh5Bu7oZUjB2EbQqKEmyRkGtP/ve H4sdSOAjZkrgw== Received: by mail-wm1-f52.google.com with SMTP id m3-20020a05600c3b0300b003a5e0557150so3908740wms.0; Fri, 26 Aug 2022 03:17:21 -0700 (PDT) X-Gm-Message-State: ACgBeo1TIBPqEbPnqR2SD200WlwlvdUEIEOtnSagGofgVxwEf4DEPyGl GSVeCVgjGa9R6q7gu6O7BhoJS96xEmw9M9ybljA= X-Google-Smtp-Source: AA6agR6krOKB5v97QLI3e4zgvTAZismklQDu5htbhIUY+mV6hlO9PiurjuV0k4rUeaz32lFqxKb4+lyByEmp/VeM4VY= X-Received: by 2002:a1c:3b55:0:b0:3a6:7b62:3901 with SMTP id i82-20020a1c3b55000000b003a67b623901mr4797379wma.113.1661509039643; Fri, 26 Aug 2022 03:17:19 -0700 (PDT) MIME-Version: 1.0 References: <20220817161438.32039-2-ysionneau@kalray.eu> <31ce5305-a76b-13d7-ea55-afca82c46cf2@kalray.eu> In-Reply-To: From: Ard Biesheuvel Date: Fri, 26 Aug 2022 12:17:08 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 1/1] Fix __kcrctab+* sections alignment To: Geert Uytterhoeven Cc: Yann Sionneau , Arnd Bergmann , linux-kbuild , Linux-Arch Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org On Thu, 25 Aug 2022 at 20:01, Geert Uytterhoeven wrote: > > Hi Ard, > > On Thu, Aug 25, 2022 at 2:56 PM Ard Biesheuvel wrote: > > On Thu, 25 Aug 2022 at 14:21, Yann Sionneau wrote: > > > Well, I am not completely sure about that. See my cover letter, previous > > > mechanism for symbol CRC was actually enforcing the section alignment to > > > 4 bytes boundary as well. > > Yes, because else it may become 2-byte aligned on m68k. > > > > Also, I'm not sure it is forbidden for an architecture/compiler > > > implementation to actually enforce a stronger alignment on u32, which in > > > theory would not break anything. > > > > > > > u32 is a Linux type, and Linux expects natural alignment (and padding). > > Is it? You probably mean its alignment should not be larger than > 4 bytes? Less has been working since basically forever. > You are quite right. of course. And indeed, the issue here is padding not alignment. > > So if your toolchain/architecture violates this rule, I suggest you > > typedef u32 to 'unsigned int __aligned(4)' explicitly. so that things > > don't break in other places. > > > > However, even then, I am highly skeptical. This really seems like an > > issue in your toolchain that could cause problems all over the place. > > > > > But in this precise case it does break something since it will cause > > > "gaps" in the end result vmlinux binary segment. For this to work I > > > think we really want to enforce a 4 bytes alignment on the section. > > > > You are addressing one of many potential issues that could be caused > > by this, so I don't think this patch is a good idea tbh. > > 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