Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp653737rdb; Fri, 22 Dec 2023 00:23:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/bGmlqRJw+LshE8BdYyTEfzH5clCGx+uyTPP5OzxPflavT0HF5jQGb5PS0S57b+LS6NSP X-Received: by 2002:a05:6a00:4587:b0:6d9:8f70:f0d with SMTP id it7-20020a056a00458700b006d98f700f0dmr146759pfb.48.1703233422004; Fri, 22 Dec 2023 00:23:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703233421; cv=none; d=google.com; s=arc-20160816; b=SI1SottgCGE4Gc8YUSTa5OasFaomiuq3k1VAX6V1Ox4Xg4knec3cS9bEMoE3fwsv7K R1BzTO64stwXLqYKzHiphp+8zuWMuwqkp/doonNxm45RpAxG1XS8ep6LqEBFMS6nApp3 H2pF2YiHIRKfxN6j4t0DiABFndwCa84Zv+Tddan1Od4gMivjn/Mpefe4/jv6mM3vArEA 5p9hWH/jpgT/pt9WSdiYfLqXKP+EGImOpPvk8OWIZYwzfNDAJPOgXsIBsaX9hB+eb2v8 jcJiS0z+ZuwW2oMPDL7gMcEdJgIKpscNGsSCdPtN01uybExopzF0MrzibIEXXxWkwUt1 KA0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:autocrypt :from:content-language:references:cc:to:subject:user-agent :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=oH2R+6vTaqxR+zwInjYovPF7lRk1KBl4mgowJCb2NHw=; fh=Len4RsHkchBMkGhm4ct6yheAlade/7jM/FrqXineG60=; b=L9v9Bv1s2zeYYuqNPqUfqQaPKzlGP8qKW2NDk9LWuRucCowtx2R+aGx1iL9PG1gKsW d8W4sG0ND0GDwrKs+JipgTMWgIWHSKnodJjHFi1fqdCQxZj6zQ9bs6WPesgdU9/cm5Ei 1WYtf3AoeuA7vF6AOvYusjqHFbeT4anEcungn5zcolBnvXIq4RzvD9CVdjyaCOcj75Y7 euyc6WNhj6Glx6D9khckoRxBwdtQH6DzIlohpPYQPw1pRiG8QiX05jofbNMbL8isNku0 z/VRRuzEe2e1vVfYimRdDcw/pk+tcwR+2yEzZTNiub6edhOA9jLoOKaV7vxLkTkyNQHP CfQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=Sj34BkSx; spf=pass (google.com: domain of linux-kernel+bounces-9491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9491-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w11-20020a65410b000000b005c701bf0e27si2926605pgp.79.2023.12.22.00.23.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 00:23:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=Sj34BkSx; spf=pass (google.com: domain of linux-kernel+bounces-9491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9491-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de 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 99A54B21A33 for ; Fri, 22 Dec 2023 08:23:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02B23D301; Fri, 22 Dec 2023 08:23:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=deller@gmx.de header.b="Sj34BkSx" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 B9040C8F9; Fri, 22 Dec 2023 08:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1703233395; x=1703838195; i=deller@gmx.de; bh=MqZgoimzUABcqVdqZ74x7o6tQHZptscqCGyWf1vLEY8=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=Sj34BkSxsIfrgCVmJXwfh2uL9Z5pFVsW8mewYCBJnt4Jk/tTZWUX3DD+AIGWbX+J DLG23/NGr8NgI39Ut6ZPifDsJtcoMNnOvaLNafwEOsotDxJTp2OUlEddWhiL2332q rq9ZO4pqXGtWZkBqQMushEwTZS9w9WuxYXgsdqWkcnDgTIWsr8a8sExWtOCs4tihZ GmzZ6V+AZJL1F8b11uQPEiL8BtmJhtEjPhpN1gnCfc/KykrwNRDeBgbrd02o267Rs n7bgBLIliB1xHYSAzqoVhImgU29qWBKWSLjhBcj/zW9udY1wL+1yGbBQ7Oo16r6PX 8TclkRM4QvMfsMzHzg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.55] ([94.134.157.108]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M3DO3-1rHQA232TN-003eYR; Fri, 22 Dec 2023 09:23:15 +0100 Message-ID: Date: Fri, 22 Dec 2023 09:23:14 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/4] Section alignment issues? To: Masahiro Yamada , deller@kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , linux-modules@vger.kernel.org, linux-arch@vger.kernel.org, Luis Chamberlain References: <20231122221814.139916-1-deller@kernel.org> Content-Language: en-US From: Helge Deller Autocrypt: addr=deller@gmx.de; keydata= xsFNBF3Ia3MBEAD3nmWzMgQByYAWnb9cNqspnkb2GLVKzhoH2QD4eRpyDLA/3smlClbeKkWT HLnjgkbPFDmcmCz5V0Wv1mKYRClAHPCIBIJgyICqqUZo2qGmKstUx3pFAiztlXBANpRECgwJ r+8w6mkccOM9GhoPU0vMaD/UVJcJQzvrxVHO8EHS36aUkjKd6cOpdVbCt3qx8cEhCmaFEO6u CL+k5AZQoABbFQEBocZE1/lSYzaHkcHrjn4cQjc3CffXnUVYwlo8EYOtAHgMDC39s9a7S90L 69l6G73lYBD/Br5lnDPlG6dKfGFZZpQ1h8/x+Qz366Ojfq9MuuRJg7ZQpe6foiOtqwKym/zV dVvSdOOc5sHSpfwu5+BVAAyBd6hw4NddlAQUjHSRs3zJ9OfrEx2d3mIfXZ7+pMhZ7qX0Axlq Lq+B5cfLpzkPAgKn11tfXFxP+hcPHIts0bnDz4EEp+HraW+oRCH2m57Y9zhcJTOJaLw4YpTY GRUlF076vZ2Hz/xMEvIJddRGId7UXZgH9a32NDf+BUjWEZvFt1wFSW1r7zb7oGCwZMy2LI/G aHQv/N0NeFMd28z+deyxd0k1CGefHJuJcOJDVtcE1rGQ43aDhWSpXvXKDj42vFD2We6uIo9D 1VN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aAXnqYK3/yWf FwRDcGV6nxanxZGKEkSHHOm8jHwvQWvPP73pvuPBEPtKGLzbgd7OOcGZWtq2hNC6cRtsRdDx 4TAGMCz4j238m+2mdbdhRh3iBnWT5yPFfnv/2IjFAk+sdix1Mrr+LIDF++kiekeq0yUpDdc4 ExBy2xf6dd+tuFFBp3/VDN4U0UfG4QJ2fg19zE5Z8dS4jGIbLg== In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:av7WhO7m5Epi+xgBhaQL15t4R9VG8acHnUpLiaS9Q7fLrwILzuL YIaupZZoU8XckFgwlNhAJmKNQLd6MX06+M3vu9X5QMv93y6GcqIuohgrZLey6Rctrj0CeMG jPoHk+k4WhTbf9wjQcr5PnNckLN1MiszpGzBNybR3ewSmARX+LsH4ewehhoJkVq5+0vCV9s FgWS75/30PhNjfDNXuf8Q== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:UflBrlhezVk=;uSvyXd/kvq4ylUrvKs2NxAZtzjx WTmTEKyyA5bmv+9SN+q8aEluHD/267pc0j4Bl+ITMvFUohIfOfvMZZQYbJrXzy0dZ5bqN5cmK Y431M8JV9Cb53Mu2U/9RlGFr8FNG5kqM38I0wBoufz4xTXQtZzISIFdLwmPQEx8OFvL4fhZp5 Ljl/Uxst/o5niV1t3IDpGpmtX0Tu6t+sSUlcGslZasOeKo+WfYfuLM6WgmlEWGAozytHmSSlR CJO262NXb82YU7YIM7WDpHEqPivVED9wmelmuUZutcBr3NwNc2RmjxNyhT7+zf4jvXaBVspO5 Ef0onkWhzd693veShBPBrLK+XK9HlLFV/zR6aMLxJ0yw1XaQ1vjM3G16kqO5ZxmLvahNZp/vm QeiBqb81IAO1gXRwG3O0rEIag4ihJgssMXHLTaf+GhQ452eT1hNfQbyOAfUHy8Mmp01WHR+ON q2DcJDOoNS+kAela/ydSm3aq3WyIBkdoF3lcsBk8Ck3vp+L2JMzC7MocfBh7dB+MPDZVJpOGk 03oe96vCVrahK09eb5hxtH0KLevKpWHLn8mkAHZesPzLOPonO6gSOFd8QM30bGsdPvY9vFNB9 3Naqn5p6WW3v4BhnkBrpRjqzb8CCYZCKf0EN+S3eMqdP1ulQ6lbISUhN3/wp54Z3ITf2ErXce 92wIykA0mYIZoqAYowPp+3X/HM7d2xJL3XNsHKj76SU3L+TB+MYmXTus5+Zl4CZPZ2BoNnJDG jS/udjOrzfNVsOrZV5POAVW7bcrl1sZlAbwbqwuccuGH3RBCgXuQCfd5fukhAjkMhPXOkZd5W H/tqHBlKoUSfT6m/PR38BUHovTHQWIK+9oaC/1dxyGRiFhbRKmj4Qq7tUFhCtrFV5yuCHMB7q LL0oQUsgjAL9hAdbQc5Fu5gdrxfEXo1Aymn2/tqaPBeY/wNv/jJvkrIbRLJltM8cJzHlvNBYW Boe0SmMM8tHLeJtOnDGaZ67+r5I= On 12/21/23 16:42, Masahiro Yamada wrote: > On Thu, Dec 21, 2023 at 10:40=E2=80=AFPM Masahiro Yamada wrote: >> >> On Thu, Nov 23, 2023 at 7:18=E2=80=AFAM wrote: >>> >>> From: Helge Deller >>> >>> While working on the 64-bit parisc kernel, I noticed that the __ksymta= b[] >>> table was not correctly 64-bit aligned in many modules. >>> The following patches do fix some of those issues in the generic code. >>> >>> But further investigation shows that multiple sections in the kernel a= nd in >>> modules are possibly not correctly aligned, and thus may lead to perfo= rmance >>> degregations at runtime (small on x86, huge on parisc, sparc and other= s which >>> need exception handlers). Sometimes wrong alignments may also be simpl= y hidden >>> by the linker or kernel module loader which pulls in the sections by l= uck with >>> a correct alignment (e.g. because the previous section was aligned alr= eady). >>> >>> An objdump on a x86 module shows e.g.: >>> >>> ./kernel/net/netfilter/nf_log_syslog.ko: file format elf64-x86-64 >>> Sections: >>> Idx Name Size VMA LMA File o= ff Algn >>> 0 .text 00001fdf 0000000000000000 0000000000000000 00000= 040 2**4 >>> CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE >>> 1 .init.text 000000f6 0000000000000000 0000000000000000 00002= 020 2**4 >>> CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE >>> 2 .exit.text 0000005c 0000000000000000 0000000000000000 00002= 120 2**4 >>> CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE >>> 3 .rodata.str1.8 000000dc 0000000000000000 0000000000000000 0000= 2180 2**3 >>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>> 4 .rodata.str1.1 0000030a 0000000000000000 0000000000000000 0000= 225c 2**0 >>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>> 5 .rodata 000000b0 0000000000000000 0000000000000000 00002= 580 2**5 >>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>> 6 .modinfo 0000019e 0000000000000000 0000000000000000 00002= 630 2**0 >>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>> 7 .return_sites 00000034 0000000000000000 0000000000000000 00002= 7ce 2**0 >>> CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA >>> 8 .call_sites 0000029c 0000000000000000 0000000000000000 00002= 802 2**0 >>> CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA >>> >>> In this example I believe the ".return_sites" and ".call_sites" should= have >>> an alignment of at least 32-bit (4 bytes). >>> >>> On other architectures or modules other sections like ".altinstruction= s" or >>> "__ex_table" may show up wrongly instead. >>> >>> In general I think it would be beneficial to search for wrong alignmen= ts at >>> link time, and maybe at runtime. >>> >>> The patch at the end of this cover letter >>> - adds compile time checks to the "modpost" tool, and >>> - adds a runtime check to the kernel module loader at runtime. >>> And it will possibly show false positives too (!!!) >>> I do understand that some of those sections are not performce critical >>> and thus any alignment is OK. >>> >>> The modpost patch will emit at compile time such warnings (on x86-64 k= ernel build): >>> >>> WARNING: modpost: vmlinux: section .initcall7.init (type 1, flags 2) h= as alignment of 1, expected at least 4. >>> Maybe you need to add ALIGN() to the modules.lds file (or fix modpost)= ? >>> WARNING: modpost: vmlinux: section .altinstructions (type 1, flags 2) = has alignment of 1, expected at least 2. >>> WARNING: modpost: vmlinux: section .initcall6.init (type 1, flags 2) h= as alignment of 1, expected at least 4. >>> WARNING: modpost: vmlinux: section .initcallearly.init (type 1, flags = 2) has alignment of 1, expected at least 4. >>> WARNING: modpost: vmlinux: section .rodata.cst2 (type 1, flags 18) has= alignment of 2, expected at least 64. >>> WARNING: modpost: vmlinux: section .static_call_tramp_key (type 1, fla= gs 2) has alignment of 1, expected at least 8. >>> WARNING: modpost: vmlinux: section .con_initcall.init (type 1, flags 2= ) has alignment of 1, expected at least 8. >>> WARNING: modpost: vmlinux: section __bug_table (type 1, flags 3) has a= lignment of 1, expected at least 4. >>> ... >> >> >> >> >> modpost acts on vmlinux.o instead of vmlinux. >> >> >> vmlinux.o is a relocatable ELF, which is not a real layout >> because no linker script has been considered yet at this >> point. >> >> >> vmlinux is an executable ELF, produced by a linker, >> with the linker script taken into consideration >> to determine the final section/symbol layout. >> >> >> So, checking this in modpost is meaningless. >> >> >> >> I did not check the module checking code, but >> modules are also relocatable ELF. > > > > Sorry, I replied too early. > (Actually I replied without reading your modpost code). > > Now, I understand what your checker is doing. > > > I did not test how many false positives are produced, > but it catches several suspicious mis-alignments. Yes. > However, I am not convinced with this warning. > > > + warn("%s: section %s (type %d, flags %lu) has > alignment of %d, expected at least %d.\n" > + "Maybe you need to add ALIGN() to the modules.lds > file (or fix modpost) ?\n", > + modname, sec, sechdr->sh_type, sechdr->sh_flags, > is_shalign, should_shalign); > + } > > > Adding ALGIN() hides the real problem. Right. It took me some time to understand the effects here too. See below... > I think the real problem is that not enough alignment was requested > in the code. > > For example, the right fix for ".initcall7.init" should be this: > > diff --git a/include/linux/init.h b/include/linux/init.h > index 3fa3f6241350..650311e4b215 100644 > --- a/include/linux/init.h > +++ b/include/linux/init.h > @@ -264,6 +264,7 @@ extern struct module __this_module; > #define ____define_initcall(fn, __stub, __name, __sec) \ > __define_initcall_stub(__stub, fn) \ > asm(".section \"" __sec "\", \"a\" \n" \ > + ".balign 4 \n" \ > __stringify(__name) ": \n" \ > ".long " __stringify(__stub) " - . \n" \ > ".previous \n"); \ > > Then, "this section requires at least 4 byte alignment" > is recorded in the sh_addralign field. Yes, this is the important part. > Then, the rest is the linker's job. > > We should not tweak the linker script. That's right, but let's phrase it slightly different... There is *no need* to tweak the linker script, *if* the alignment gets correctly assigned by the inline assembly (like your initcall patch above). But on some platforms (e.g. on parisc) I noticed that this .balign was missing for some other sections, in which case the other (not preferre= d) possible option is to tweak the linker script. So I think we agree that fixing the inline assembly is the right way to go? Either way, a link-time check like the proposed modpost patch may catch section issue for upcoming/newly added sections too. Helge