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 2443A149E03; Tue, 25 Jun 2024 09:43:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719308589; cv=none; b=EENLc/UBB5XHGSwsy34Rjk9Gxomw5/RkzNF0xwDFt/LEw7CXOffnR+r5J3Qm5rLULT49MJTd1jVy/0qLCg9vjx7pEbQ6zj5Vj3s9bTRdn8TOBxVmPQcY3f82IiM/MCzx0Vh4zjkxeLy2rdA8TenMoJI0P0A4PWuNozCrXkbd+G4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719308589; c=relaxed/simple; bh=+ebRd9D74V+mGSzFIUCiofFtXQKUOs8FAssnbRH6VF0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=APiUgthUHN9vmBvFgTTtvbxN+7cosQgeA3R12aLDyyr9sbnHweW9xCAKiidMTtfwsWIuamwuCvpmOEx+2grm3etDAWwr9YWQixBfdOfKykBTl9R/oeS3Rn54uUmoVoV+xoP54MTD7U9LRrUDYTfQoJudCVWlZZOQmbEnk1RLQ24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cRXP3ugx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cRXP3ugx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 630E4C32781; Tue, 25 Jun 2024 09:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1719308588; bh=+ebRd9D74V+mGSzFIUCiofFtXQKUOs8FAssnbRH6VF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cRXP3ugxEzfRh96KUf4c5q+2vfpEdLaOAqigZNmGNePDACMEmppyKqKEbvpBzOYR1 MquxkilKs1WIdiyVw+742SbOLaY3G3oRLKRuWJg1VuGYzYKZLjYgZgxQKusQ0ecQgr EIBHbqderrv+gFpifKFN/kQF++4vo1sxyzAn/6DA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xi Ruoyao , Huacai Chen , Sasha Levin Subject: [PATCH 6.9 173/250] LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub Date: Tue, 25 Jun 2024 11:32:11 +0200 Message-ID: <20240625085554.692758082@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240625085548.033507125@linuxfoundation.org> References: <20240625085548.033507125@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xi Ruoyao [ Upstream commit 120dd4118e58dbda2ddb1dcf55f3c56cdfe8cee0 ] GAS <= 2.41 does not support generating R_LARCH_{32,64}_PCREL for "label - ." and it generates R_LARCH_{ADD,SUB}{32,64} pairs instead. Objtool cannot handle R_LARCH_{ADD,SUB}{32,64} pair in __jump_table (static key implementation) and etc. so it will produce some warnings. This is causing the kernel CI systems to complain everywhere. For GAS we can check if -mthin-add-sub option is available to know if R_LARCH_{32,64}_PCREL are supported. For Clang, we require Clang >= 18 and Clang >= 17 already supports R_LARCH_{32,64}_PCREL. But unfortunately Clang has some other issues, so we disable objtool for Clang at present. Note that __jump_table here is not generated by the compiler, so -fno-jump-table is completely irrelevant for this issue. Fixes: cb8a2ef0848c ("LoongArch: Add ORC stack unwinder support") Closes: https://lore.kernel.org/loongarch/Zl5m1ZlVmGKitAof@yujie-X299/ Closes: https://lore.kernel.org/loongarch/ZlY1gDDPi_mNrwJ1@slm.duckdns.org/ Closes: https://lore.kernel.org/loongarch/1717478006.038663-1-hengqi@linux.alibaba.com/ Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=816029e06768 Link: https://github.com/llvm/llvm-project/commit/42cb3c6346fc Signed-off-by: Xi Ruoyao Signed-off-by: Huacai Chen Signed-off-by: Sasha Levin --- arch/loongarch/Kconfig | 5 ++++- arch/loongarch/Kconfig.debug | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 54ad04dacdee9..d1b94ce58f793 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -138,7 +138,7 @@ config LOONGARCH select HAVE_LIVEPATCH select HAVE_MOD_ARCH_SPECIFIC select HAVE_NMI - select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS + select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS && AS_HAS_THIN_ADD_SUB && !CC_IS_CLANG select HAVE_PCI select HAVE_PERF_EVENTS select HAVE_PERF_REGS @@ -257,6 +257,9 @@ config AS_HAS_EXPLICIT_RELOCS config AS_HAS_FCSR_CLASS def_bool $(as-instr,movfcsr2gr \$t0$(comma)\$fcsr0) +config AS_HAS_THIN_ADD_SUB + def_bool $(cc-option,-Wa$(comma)-mthin-add-sub) + config AS_HAS_LSX_EXTENSION def_bool $(as-instr,vld \$vr0$(comma)\$a0$(comma)0) diff --git a/arch/loongarch/Kconfig.debug b/arch/loongarch/Kconfig.debug index 98d60630c3d4b..8b2ce5b5d43e8 100644 --- a/arch/loongarch/Kconfig.debug +++ b/arch/loongarch/Kconfig.debug @@ -28,6 +28,7 @@ config UNWINDER_PROLOGUE config UNWINDER_ORC bool "ORC unwinder" + depends on HAVE_OBJTOOL select OBJTOOL help This option enables the ORC (Oops Rewind Capability) unwinder for -- 2.43.0