Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1204714rdb; Fri, 22 Dec 2023 20:11:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2pCTpUTYnhE8lPBtOShCb5s5V6hOVll6Efsv/+eaVKYXn1rKwQR1bkBmxgiY4nsYFIvGB X-Received: by 2002:a05:6a20:729c:b0:194:ef0c:3cb1 with SMTP id o28-20020a056a20729c00b00194ef0c3cb1mr1486326pzk.53.1703304675322; Fri, 22 Dec 2023 20:11:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703304675; cv=none; d=google.com; s=arc-20160816; b=nnAYzbMOV+FHLOIkleU5Tala4lT1urv27anxuMAZDhxn970sWA+G0ruYiAMSDwqbQH RqknmRFDlkHw+N9GpKfH9Nz2lwPs6zHip+TzfuumzCaJ1WIJ7aVGTkaA4nE2TUoBT0wv +/86rQe3DJyW9uuwDiYBl7cd+01AO7Jz3/ED1w+tqvj4aV3rkrynBs9Zqw6oRjOVZrMO lz7Zc3p28dS7IIFC46WjBGKA+LyAoU5BlfKPVzdHjOUTAufk0shWlJM2E4v/lxFfwpYe nAqtwoXo+SEZpIHKmPiCT0yQsBsP8pW8DsNc0zg1kVkGTqLza00FSzujhta6hN5Mn6IP SkfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=79l7LveHcQfH8zGZ4SksMAGI22jiv7uhiBIy7QkxBI8=; fh=bKbkCLvRDttV3nJjb8Gi/BgKONEXFqN6yZUs/cPqSuE=; b=rn9cOCtFGiUx00waMB3UYmQy/xg6V/yCE40udrUVCpcgOC5iNO7Cdx+SQbLg6K6ZHn QvcGRmLrzrTH/vGQTKcVWEoOqrvHxhrRKdn6EM5DUjYG7l3WEAb0vIKSG86LWgeMEQGr RwzkMMbTPL5ncvPQl/NY1nVfyyZQ+mn9o6OwfFXZxEbP+DPupH1YoJk8ffDfhHMLIEzG A3PeI0XH/FWZrRWQWyMa8YdOySWJS15Bmmt9TZodPNcvcGW/v7L8PKGHmcyUbe6elM64 gDwWIkrUoRMxRCdGk2Glzn+KUSck0poo59ydQen4Ahxhq5csG4tLV/IcF63wG4yWeh8E 1Wxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JmZOmP5G; spf=pass (google.com: domain of linux-kernel+bounces-10281-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10281-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d3-20020a170902aa8300b001d3e11d5cf4si4157066plr.109.2023.12.22.20.11.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 20:11:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10281-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JmZOmP5G; spf=pass (google.com: domain of linux-kernel+bounces-10281-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10281-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EB0A7B23127 for ; Sat, 23 Dec 2023 04:11:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 186C663D9; Sat, 23 Dec 2023 04:10:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JmZOmP5G" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30D146108; Sat, 23 Dec 2023 04:10:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AACCBC433C8; Sat, 23 Dec 2023 04:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703304655; bh=REV9/Zx5FgKggOJ8WxjNU6ABdvkJMIvl6xbQ7ra4ahs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JmZOmP5GZ4X1zSpVjaJcxWvbZ0gV/+qqDcOvY0z9iwMuJQgxr1hOazBnVSBwCl/tj CAg9g3pUOcPFc+V41306d2/vbQggAuVV3VVy+6LGZW5/YlV64iwh6vqd7HakhZeq9L LS5XrUMOKvMJGHu4GvABy43ePZgwUi3NYFjFaIx0sCiOUZvz/LvLAy/9QuESx5Vku5 IpIaEsnUDQBYRzA1kuWpqsqDRHjSlaLp6hB4DXMTDa4xMDdZw1HG/nwwfxIiF3aHkY itxeWdY3J/Cr4P6IiWFF0B/J9WTgq1EYVx3NVa5cniv/RfZMK/fyXghVi1brPWz/gG yQpi0RQDc9A9Q== Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-5945c41e32cso71190eaf.0; Fri, 22 Dec 2023 20:10:55 -0800 (PST) X-Gm-Message-State: AOJu0YyvLwJBeuT9u12LuJg1WxMhsZTKEVpr9urlQtqxk7VhxjpFdPuk GpBwHX9K+CQUGFu/n1FN4ycRSySm+VuUGAWjwLo= X-Received: by 2002:a05:6870:a706:b0:203:f963:d969 with SMTP id g6-20020a056870a70600b00203f963d969mr2737463oam.34.1703304655002; Fri, 22 Dec 2023 20:10:55 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231122221814.139916-1-deller@kernel.org> <20231122221814.139916-4-deller@kernel.org> <7a504ceb-da00-4c0b-acc0-3ab48fb60f5e@gmx.de> In-Reply-To: <7a504ceb-da00-4c0b-acc0-3ab48fb60f5e@gmx.de> From: Masahiro Yamada Date: Sat, 23 Dec 2023 13:10:18 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/4] vmlinux.lds.h: Fix alignment for __ksymtab*, __kcrctab_* and .pci_fixup sections To: Helge Deller Cc: deller@kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , linux-modules@vger.kernel.org, linux-arch@vger.kernel.org, Luis Chamberlain Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 22, 2023 at 6:02=E2=80=AFPM Helge Deller wrote: > > On 12/21/23 14:07, Masahiro Yamada wrote: > > On Thu, Nov 23, 2023 at 7:18=E2=80=AFAM wrote: > >> > >> From: Helge Deller > >> > >> On 64-bit architectures without CONFIG_HAVE_ARCH_PREL32_RELOCATIONS > >> (e.g. ppc64, ppc64le, parisc, s390x,...) the __KSYM_REF() macro stores > >> 64-bit pointers into the __ksymtab* sections. > >> Make sure that the start of those sections is 64-bit aligned in the vm= linux > >> executable, otherwise unaligned memory accesses may happen at runtime. > > > > > > Are you solving a real problem? > > Not any longer. > I faced a problem on parisc when neither #1 and #3 were applied > because of a buggy unalignment exception handler. But this is > not something which I would count a "real generic problem". > > > 1/4 already ensures the proper alignment of __ksymtab*, doesn't it? > > Yes, it does. > > >... > > So, my understanding is this patch is unneeded. > > Yes, it's not required and I'm fine if we drop it. > > But regarding __kcrctab: > > >> @@ -498,6 +501,7 @@ > >> } = \ > >> = \ > >> /* Kernel symbol table: Normal symbols */ = \ > >> + . =3D ALIGN(4); = \ > >> __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { = \ > >> __start___kcrctab =3D .; = \ > >> KEEP(*(SORT(___kcrctab+*))) = \ > > I think this patch would be beneficial to get proper alignment: > > diff --git a/include/linux/export-internal.h b/include/linux/export-inter= nal.h > index cd253eb51d6c..d445705ac13c 100644 > --- a/include/linux/export-internal.h > +++ b/include/linux/export-internal.h > @@ -64,6 +64,7 @@ > > #define SYMBOL_CRC(sym, crc, sec) \ > asm(".section \"___kcrctab" sec "+" #sym "\",\"a\"" "\n" \ > + ".balign 4" "\n" \ > "__crc_" #sym ":" "\n" \ > ".long " #crc "\n" \ > ".previous" "\n") Yes! Please send a patch with this: Fixes: f3304ecd7f06 ("linux/export: use inline assembler to populate symbol CRCs") --=20 Best Regards Masahiro Yamada