From mboxrd@z Thu Jan 1 00:00:00 1970 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 C8AEAAD23 for ; Thu, 27 Oct 2022 17:04:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E5ADC433C1; Thu, 27 Oct 2022 17:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666890298; bh=sCuLsfho8avh6U137l5CQMsogzthBagkig63456NyFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=onGCHrlO3hhVhnBS2RFtEX+p1tif5DeogDK+T29ibGcr6U1SFFIhLxJ1nnEY65P7C gUFzb+IaCq1UGzVVDAHnFd/QaZCuQCHDRVe41dLq6HO/8JXQIsg6d9y2vhu8oAipYF ja63gQIlwDOkTQQTeX/Y0qxYtUEu9hszyuuYSsIM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andrii Nakryiko , Mel Gorman , Arnaldo Carvalho de Melo , Hao Luo , Michal Suchanek , Jiri Olsa , Andrew Morton , Linus Torvalds Subject: [PATCH 5.10 18/79] kbuild: skip per-CPU BTF generation for pahole v1.18-v1.21 Date: Thu, 27 Oct 2022 18:55:28 +0200 Message-Id: <20221027165054.986514671@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221027165054.270676357@linuxfoundation.org> References: <20221027165054.270676357@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Andrii Nakryiko commit a0b8200d06ad6450c179407baa5f0f52f8cfcc97 upstream. [small context changes due to missing floats support in 5.10] Commit "mm/page_alloc: convert per-cpu list protection to local_lock" will introduce a zero-sized per-CPU variable, which causes pahole to generate invalid BTF. Only pahole versions 1.18 through 1.21 are impacted, as before 1.18 pahole doesn't know anything about per-CPU variables, and 1.22 contains the proper fix for the issue. Luckily, pahole 1.18 got --skip_encoding_btf_vars option disabling BTF generation for per-CPU variables in anticipation of some unanticipated problems. So use this escape hatch to disable per-CPU var BTF info on those problematic pahole versions. Users relying on availability of per-CPU var BTFs would need to upgrade to pahole 1.22+, but everyone won't notice any regressions. Link: https://lkml.kernel.org/r/20210530002536.3193829-1-andrii@kernel.org Signed-off-by: Andrii Nakryiko Acked-by: Mel Gorman Cc: Arnaldo Carvalho de Melo Cc: Hao Luo Cc: Michal Suchanek Cc: Jiri Olsa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Jiri Olsa Signed-off-by: Greg Kroah-Hartman --- scripts/link-vmlinux.sh | 5 +++++ 1 file changed, 5 insertions(+) --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -161,6 +161,11 @@ gen_btf() vmlinux_link ${1} + if [ "${pahole_ver}" -ge "118" ] && [ "${pahole_ver}" -le "121" ]; then + # pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars + extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_vars" + fi + info "BTF" ${2} LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J ${extra_paholeopt} ${1}