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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9874C4332F for ; Tue, 31 Oct 2023 05:38:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E8AC6B00A3; Tue, 31 Oct 2023 01:38:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 44A3A6B00A4; Tue, 31 Oct 2023 01:38:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EB116B00AC; Tue, 31 Oct 2023 01:38:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1911D6B00A3 for ; Tue, 31 Oct 2023 01:38:19 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E105EA0ABB for ; Tue, 31 Oct 2023 05:38:18 +0000 (UTC) X-FDA: 81404651076.08.BCF4A4C Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf22.hostedemail.com (Postfix) with ESMTP id D3253C0005 for ; Tue, 31 Oct 2023 05:38:15 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=jQ7N8Kke; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of masahiroy@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=masahiroy@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698730696; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZSGvPo764QH7tJAfo9bXnue2OfBWEE4A5vaHkRrncV8=; b=21bU0I74Dai/22cKQ8a75UTmX0MB0Gybl5fYIWXchujfJCwUmwU/LUv+bfWC2fV3a/j451 iQJk0PSgLRhNNZvXDOGhszFoCJnY/Z8vKMR2HSl/zHZGwPNtISydhVw7Y4INPShjMrjSTA jiPLthj5P9lAkQzkRT2HofgvkecvtBU= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=jQ7N8Kke; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of masahiroy@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=masahiroy@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698730696; a=rsa-sha256; cv=none; b=i9M2g9e3zDAvvcnylBABIiJouElo/FIcC48E2JKn+XrPBEC+3HPgyCSjfkOfI1zkzsF+VH zyhxDslkz2k5F6urlfgavU/8Ifi29y8RSjVyuTv4M6udw3SQksxAmXgNWnZDPI3FYP7MpQ LnAEb5i+IbmPMskJh7gKqtPI13p16Po= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 8AB0DB80E41 for ; Tue, 31 Oct 2023 05:38:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D031C433CB for ; Tue, 31 Oct 2023 05:38:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698730692; bh=74TnMIViJ53aWi+jH3OPEsmr3nmy5Zut75G5OW8eiEA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jQ7N8KkeWhaWp0An7PTtL+2hiRHJyCTYTEXmchMOJX89G+zyV3omLOCg0o7nlDndQ c83SvYFbTOEOg65yek326JLs/+T64I02+ymj6L1Qn4zJoTCI+0Zc99/cNZs5jvI5fK ifMJR7DYvefj7vzTlzy/jXVRWhjAU6JpRReHMYtyDrbl5ikiRZ2YaoLa92YykZQzBk CM2HNB8vsyBNUfxsgu2YY4ADtIBZAPoRbmwCcnGisIyhWx+X2yv80oNVocFRqO48ak Zsrz+AdZRwkMia/mOkyVOjongulLkoGPMXB9vmAEblP2JasPxpR5fZdvnOPnP5dnfU KJQyhtq633pwg== Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-1eb39505ba4so3528697fac.0 for ; Mon, 30 Oct 2023 22:38:12 -0700 (PDT) X-Gm-Message-State: AOJu0Yzc5aOknx11NuNElndWmGPemrv2ebiIdbBDAUofxXlnivOth1W+ 4TEJT95H2STNVj6HFmQ325OHYmvfC1GcE5rZO5E= X-Google-Smtp-Source: AGHT+IHLaZDG+EB683EmjfX64T9gJ5sdGaTxbuxC+FcHcyrmNf41binky8xIbf99uvFODJ8XIFHe6+9HKbEkxNdTan4= X-Received: by 2002:a05:6870:90d5:b0:1d0:d9e2:985f with SMTP id s21-20020a05687090d500b001d0d9e2985fmr12476968oab.57.1698730691785; Mon, 30 Oct 2023 22:38:11 -0700 (PDT) MIME-Version: 1.0 References: <202310282049.HXCHtgEz-lkp@intel.com> <20231028093605.b516ad5d8ca820ec76da3072@linux-foundation.org> In-Reply-To: <20231028093605.b516ad5d8ca820ec76da3072@linux-foundation.org> From: Masahiro Yamada Date: Tue, 31 Oct 2023 14:37:35 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [akpm-mm:mm-nonmm-unstable 18/58] ERROR: modpost: vmlinux: local symbol 'kthread_stop_put' was exported To: Andrew Morton , "open list:SIFIVE DRIVERS" , =?UTF-8?B?Ru+/ve+/ve+/vW5nLXJ177+977+977+9IFPvv73vv73vv71uZw==?= Cc: kernel test robot , Andreas Gruenbacher , oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Linux Kbuild mailing list , Nick Desaulniers , Nathan Chancellor , Linux Kernel Mailing List , Paul Walmsley , Palmer Dabbelt , Albert Ou Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: D3253C0005 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: u8ffpwkrownttquak5zsnbz3qzjjpqgc X-HE-Tag: 1698730695-490969 X-HE-Meta: U2FsdGVkX1/A1PasAVKbWl5biDmNhqixGqFrrw/ubuAkF5VZW8etynKl83iXVvEB4XM7Cr5e/oIWC5jj2seU2u7ag7WHoedHYyIl9CBLVtN8h2S7ndmItNA7htg+yuSK1iRL2qyCav/ZfyZJLPTn9b2glGmvg9e8eIk+BPxDhkdV/hVs3nyrmFhVNvUbbDGLir5JkCer6u2lZlL4Hu0uKjpJXfYmvnjPUJksEDFvLWxsIwCrfzohH4Dpjp6xbdioK3PrF7D6CYMMeAy6nUA+O0dTlBWEOzwX26r/F9StnN32zZ9FygdtJSwDeNC02OWp11C6uEf+SuCYCtk/u2aYweEG4xno1s5U/IArF8VeX6rucoyqMiuWtH9g3QbxjSsq9LTL5S8KS+8KZgnUTzhCZH++ulqnXTLq6d4Fkx96rKqj3Rn09iaqYHGMShoZIt/s3A1SS3AQRrvc37JQi96z60+8sODU/WuvhWn5cC3QMd0AWdRciyyVM95ezPIDuXMCUPvgbuv0lKVLcqjGEyZmhj/rZbrOlcdR8mk9h1lsKE+qlg745cVwNNnwBxs4c020GtmU0NFmPWIbob8n6cx6Aa5kwa+K0kntVhci+zGxAZJAmqW+ywxhZnUw24uZd8BiDgwt2G5PUYM0x2vQiedk+5jxq+cBTGfq2QKQhq8Pjbcu39K6b5UaI0lqe0XRtr9VfFZsSFVbj4xHRwmyfmmDSGcc8JCpnGuwRM372I0B5RIncg60z9OkELntpmTVTOAW5wPuiCMQD5/OGhPS3bCu432pMNI7RmmG8ViN5PFsdK9PU4mlOKg/o0aTa8sKNu1T/NF+P3hsR9a4g7absLDx9o+e1i6zG4LAoY05NPGDTfA9Mln5dXHMXEhvWl79kmTILsStXTYJpPk/spif44K/JltULuwI1W88gyPJ4JdSVGi6DAm1EkLYa+TabdPfgq/7fq29dT6IlVdSCqPf754 5BiF94WB REvlVUs2VIRs5RRhUlRS0pVBjXVDD12n+UgHSiAkMZ+jklsgnEwnMVzoVDfGJhIGvC/vq2vvcEWml+NSYnQiqrrgL3LFKQc5WPI+is/AweHJfTp5bjLNkwB4/EUqNEaWK57C31CEOd4slRpDvzOy7yDy28I+T9dF57FlLdNnaNI1tA7o5d8hQxH4Ds5Df+6HZwGZ0idjIz+g0bw2yrcmEfEmFbaHmXwLG8h1OIu2yGMJlZBhRqkfIdde3SpPEecCNdazlvEzbkIyC0SzA0iTOrNjEIEbwYZelrtkytei7G7wLhirhAtoSej4vXwFBLnmN5++QIRGycBpGlZgsfUsu17MEBpsiDDvjccMtdDp2xbp1Po9Z92ZDlkltwq+57KSr7Fhsl7rNkeoDQ0AXoebznm8UP5qQgYkOmajeQN5QXVf1dcr1Xdj18b5ISZUtUpW1b9T7uzX39E+hhS5GVfhHqRLARw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: (+CC: RISCV, toolchian folks) Original Thread: https://lore.kernel.org/oe-kbuild-all/202310282049.HXCHtgEz-lkp@intel.com/ On Sun, Oct 29, 2023 at 1:36=E2=80=AFAM Andrew Morton wrote: > > On Sat, 28 Oct 2023 20:29:18 +0800 kernel test robot wrot= e: > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-= nonmm-unstable > > head: d431880137b55533f664056070226a88dba99637 > > commit: 6309727ef27162deabd5c095c11af24970fba5a2 [18/58] kthread: add k= thread_stop_put > > config: riscv-randconfig-c033-20221102 (https://download.01.org/0day-ci= /archive/20231028/202310282049.HXCHtgEz-lkp@intel.com/config) > > compiler: riscv32-linux-gcc (GCC) 13.2.0 > > reproduce (this is a W=3D1 build): (https://download.01.org/0day-ci/arc= hive/20231028/202310282049.HXCHtgEz-lkp@intel.com/reproduce) > > > > If you fix the issue in a separate patch/commit (i.e. not just a new ve= rsion of > > the same patch/commit), kindly add following tags > > | Reported-by: kernel test robot > > | Closes: https://lore.kernel.org/oe-kbuild-all/202310282049.HXCHtgEz-l= kp@intel.com/ > > > > All errors (new ones prefixed by >>, old ones prefixed by <<): > > > > ERROR: modpost: vmlinux: local symbol 'system_power_efficient_wq' was e= xported > > [ it now proceeds to list 16000 more such "errors" ] > > I see no error here - these symbols are exported because modules use > them. Unless I misinterpret the intent of this modpost check. > > Masahiro, could you please take a look? I was able to reproduce the issue even in the mainline kernel. But, the warnings are not only the export symbols, but also a ton of false-positive section mismatch warnings. To me, the RELA sections look broken when the vmlinux size grows to a certain extent. I suspected a toolchain bug, but I am not 100% sure. In my investigation, this happens under some conditions. - It happens on RISCV 32-bit - It happens with GCC. LLVM is no problem. - It happens when the vmlinux size grows I attached a simple reproducer script at the end of this reply. Please checkout the v6.6 tag. Run the reproducer, with the yes2modconfig line commented out. When vmlinux.o is small, the relocation info looks sane. For example, $ riscv64-linux-gnu-size vmlinux.o text data bss dec hex filename 10762048 905937 342657 12010642 b74492 vmlinux.o $ riscv64-linux-gnu-readelf -r vmlinux.o | grep -m1 -A10 rela.export_symbo= l Relocation section '.rela.export_symbol' at offset 0x1d9491d4 contains 9789 entries: Offset Info Type Sym.Value Sym. Name + Addend 00000004 c3130301 R_RISCV_32 00000024 system_state + 0 00000010 c33b6901 R_RISCV_32 00000018 static_key_initialized + 0 00000018 c3024d01 R_RISCV_32 00000014 reset_devices + 0 00000020 c33b9e01 R_RISCV_32 00000008 loops_per_jiffy + 0 0000002c c2f57201 R_RISCV_32 00000110 init_uts_ns + 0 00000038 c3233601 R_RISCV_32 00000354 wait_for_initramfs + 0 00000040 c2ffff01 R_RISCV_32 00000340 init_task + 0 00000048 c313fc01 R_RISCV_32 00000b58 riscv_cached_mvendorid + 0 00000050 c2f78a01 R_RISCV_32 00000b7e riscv_cached_marchid + 0 Run the reproducer, with the yes2modconfig line in. vmlinux.o gets bigger, and the relocation info is messed up. ELF_R_SYM() starts to point local symbols ".LASF*" $ riscv64-linux-gnu-size vmlinux.o text data bss dec hex filename 16831652 1141862 390321 18363835 11835bb vmlinux.o $ riscv64-linux-gnu-readelf -r vmlinux.o | grep -A10 rela.export_symbol Relocation section '.rela.export_symbol' at offset 0x3201524c contains 11648 entries: Offset Info Type Sym.Value Sym. Name + Addend 00000004 3f41b601 R_RISCV_32 01302449 .LASF1851 + 0 00000010 3f3f4301 R_RISCV_32 012ffca4 .LASF1225 + 0 00000018 3f40d201 R_RISCV_32 01300bc1 .LASF1623 + 0 00000020 3f646a01 R_RISCV_32 01319a43 .LASF5361 + 0 0000002c 3f2f6201 R_RISCV_32 012f5c1f .LASF3521 + 0 00000038 3f168701 R_RISCV_32 012dd796 .LASF4363 + 0 00000040 3f5d8c01 R_RISCV_32 01319a26 .LASF3685 + 0 00000048 3f092501 R_RISCV_32 012e5792 .LASF939 + 0 00000050 3f22b501 R_RISCV_32 012f89a4 .LASF277 + 0 This is the reproducer shell script. ------------------->8----------------------------- #!/bin/sh set -e # I used riscv64-linux-gnu-gcc available on Ubuntu. # Instead, you can also use riscv32-linux-gcc, riscv64-linux-gcc, etc. # provided by the 0day. export CROSS_COMPILE=3Driscv64-linux-gnu- make ARCH=3Driscv defconfig # # Configure for 32-bit # make ARCH=3Driscv 32-bit.config # # Turn =3Dm into =3Dy in order to grow vmlinux # make ARCH=3Driscv mod2yesconfig # # Enable DEBUG_INFO # ./scripts/config -d CONFIG_DEBUG_INFO_NONE ./scripts/config -e CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT # sync the .config make ARCH=3Driscv olddefconfig make ARCH=3Driscv -j$(nproc) vmlinux_o ------------------------>8------------------------------------ --=20 Best Regards Masahiro Yamada