From patchwork Tue Jun 20 08:18:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youling Tang X-Patchwork-Id: 110348 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3519039vqr; Tue, 20 Jun 2023 01:51:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/e78DcaJuUGb0MaZrTPBGqioceCS+5Riw9f4aIRrOvftRgfTNstJF0WharhGBXcEfua4m X-Received: by 2002:a05:6358:ede:b0:12d:f4bc:384a with SMTP id 30-20020a0563580ede00b0012df4bc384amr3515726rwh.16.1687251066106; Tue, 20 Jun 2023 01:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687251066; cv=none; d=google.com; s=arc-20160816; b=IX0TCNidIBP6IbtEO+W92mDJebtODxV7ptCiHhLKBOVy7S5xx14CcI8fsh2vco/qro /z+wcSooZcXc6+MpWH+FPUwfn4HgW4RYerukrGfTy9F7+AbFGETgA8oSEjNr+Cyzt6bM AibaY/fpdUwUF3JjEZInUxq+g24aEYX3BJk6oHSgtQC6GCYHKbDuXnSJ04p+kUPF9YYA pdPovCsGxM70tiavyrLLZZn1MNGmibntQuTNWCc9OqxJCeRTuu1Csek2C9zEO4s58zpk 57Q9N/H3pNkRdai7/e6UoUMxxI4X9iIEzid48r/stw4iCDADIxKTKYH1KPVaSUT3uK3p MAwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=2fRa4+3bMxZgmC0C4fCo7d1GV3/rX6JzNzLtiZ5RAd4=; b=VI2F3b8KvqyLuaPtsT2OFwX5MDxEWoTv/DGGJHacqgrw+rsBPj32xW1tHZXUHhojY3 4SeZWr+SZGrkmZGGeyLP+YGKtLK/Ylq8wh5lsrDyTkwdx3JrYRfIXt9JxQbQOSvmI+uj THjSBwSBnTtqc2rRI6yNZ6zTCG20zB8m3Ae8M07QD6wOGG1rg4cqTj8oa067JlCTVKcZ /BPOfa47Q/nsHJupRzMfvyt64GHwISaHuC6qmIy9zYtnSMiLQZz/wi+X5BwGZvdEreIc 3O4ucy6x847IVmnkdOAGmk5t8Vp/OrzzckjDfnFY4xvKpEFcnF1oILqGWLE+F9l7xjuy cOxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 131-20020a630189000000b005533647f7c5si1292587pgb.420.2023.06.20.01.50.53; Tue, 20 Jun 2023 01:51:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbjFTISs (ORCPT + 99 others); Tue, 20 Jun 2023 04:18:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjFTISp (ORCPT ); Tue, 20 Jun 2023 04:18:45 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6C11BDD; Tue, 20 Jun 2023 01:18:43 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8AxnOriYJFkyh4HAA--.14406S3; Tue, 20 Jun 2023 16:18:42 +0800 (CST) Received: from bogon.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxReThYJFkJ3AhAA--.28832S2; Tue, 20 Jun 2023 16:18:41 +0800 (CST) From: Youling Tang To: Josh Poimboeuf , Peter Zijlstra , Huacai Chen , madvenka@linux.microsoft.com Cc: chenzhongjin@huawei.com, WANG Xuerui , Xi Ruoyao , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, tangyouling00@gmail.com, youling.tang@outlook.com, Jinyang He Subject: [RFC PATCH v1 20/23] LoongArch: Move some data definitions into the .data section Date: Tue, 20 Jun 2023 16:18:29 +0800 Message-Id: <1687249112-2790-1-git-send-email-tangyouling@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf8CxReThYJFkJ3AhAA--.28832S2 X-CM-SenderInfo: 5wdqw5prxox03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoW7ZF1fJFyrZw1kAw13Kr1xWFX_yoW8Aw4rpr 13A34kKr48Gr1UJa4UXa4ku3yUJa4DWw43Wa1qk3s5GwnFvF1DX3W0vr92qFyvv3yxKr4F qFn5trs2v3WUCwbCm3ZEXasCq-sJn29KB7ZKAUJUUUUx529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUPEb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVWxJr0_GcWln4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r12 6r1DMcIj6I8E87Iv67AKxVW8Jr0_Cr1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x 0EwIxGrwACjcxG6xCI17CEII8vrVW3JVW8Jr1lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IY c2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_JF0_Jw1lx2IqxV Aqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q 6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6x kF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AK xVW8Jr0_Cr1UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyT uYvjxUDqQDUUUUU X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769210973747195120?= X-GMAIL-MSGID: =?utf-8?q?1769210973747195120?= Make part of the data definition into the .data section, avoid objtool to detect "unreachable instruction" warning. At the same time, removing unreachable instruction flow operations (b process_entry). Co-developed-by: Jinyang He Signed-off-by: Jinyang He Signed-off-by: Youling Tang --- arch/loongarch/kernel/genex.S | 2 ++ arch/loongarch/kernel/relocate_kernel.S | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/loongarch/kernel/genex.S b/arch/loongarch/kernel/genex.S index 44ff1ff64260..883b718b5ffe 100644 --- a/arch/loongarch/kernel/genex.S +++ b/arch/loongarch/kernel/genex.S @@ -77,7 +77,9 @@ SYM_FUNC_END(except_vec_cex) 668: RESTORE_ALL_AND_RET SYM_FUNC_END(handle_\exception) + .pushsection ".data", "aw", %progbits SYM_DATA(unwind_hint_\exception, .word 668b - 666b) + .popsection .endm BUILD_HANDLER ade ade badv diff --git a/arch/loongarch/kernel/relocate_kernel.S b/arch/loongarch/kernel/relocate_kernel.S index d0123fa2b511..1ea3df967b46 100644 --- a/arch/loongarch/kernel/relocate_kernel.S +++ b/arch/loongarch/kernel/relocate_kernel.S @@ -75,7 +75,6 @@ copy_word: LONG_ADDI s5, s5, -1 beqz s5, process_entry b copy_word - b process_entry done: ibar 0 @@ -112,6 +111,6 @@ SYM_CODE_END(kexec_smp_wait) relocate_new_kernel_end: -SYM_DATA_START(relocate_new_kernel_size) - PTR relocate_new_kernel_end - relocate_new_kernel -SYM_DATA_END(relocate_new_kernel_size) +.pushsection ".data", "aw", %progbits +SYM_DATA(relocate_new_kernel_size, .long relocate_new_kernel_end - relocate_new_kernel) +.popsection From patchwork Tue Jun 20 08:18:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youling Tang X-Patchwork-Id: 110353 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3520587vqr; Tue, 20 Jun 2023 01:55:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tRETs/pRhnkntTIshdUCE2OvGX7DSArXZVAbvDuT5CJWvKiAXV7Zb9HBlIoDWr1hXjT/Y X-Received: by 2002:a05:6a20:a108:b0:116:fc1b:fa3b with SMTP id q8-20020a056a20a10800b00116fc1bfa3bmr9059644pzk.9.1687251322633; Tue, 20 Jun 2023 01:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687251322; cv=none; d=google.com; s=arc-20160816; b=c9WeVEQpshZT/+5Yiwg2io4Yk3nyPg15gtC+ZZBN8a1rBwxImb4rqUZQ8xmSg3urtQ RmpQ3fSP12n3mHP5IvWHlb1EodjzU8NxOU7hyl9YEM4xihgnxkMOfoLVVmr0oRbpjzeg ZaNZGgR3ZIQm5qHCHQGdRx9q8iiqxLTSdqrRn2ROpsCy1A4YKJ6oNmWiNLs2W3T6RrzY ALEIvcucLkLcpxgW0okTCrTfm4QXy7Ngui0wgN//LvnAM1YrN0Uid5Y2TcXnVjq5NRjU d6J3OoGXsVy51nRDbNuHWNu0VhshomzJqufB2wUn8doqysQXlpqx/UnOrf+9wSc4Gc+i 7Zmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=kkDiTkDpp/NPR1+Fi566A0PMNLX0kklp9JB3HY+sYss=; b=GFyG8iFoPi1ADK1gQgLNtnVxMVd68usPfAeJqhIDxsjZyzUBcztEcj/jNmKX8xVJp9 M2zAtF7sEJCU1rMuk9owmkDZE7bzm1O2bdkhBHtGAy6RqEgDCTEMoJgoaIJaaPlbe+N5 NVcD8ZUN8qQvp1DmwjHv7tpff9+68AUXVK69gE22QnE4Z9ekf19y+I6+qE//qxPnQHtg KRIRcURRJoRdlqqfcwbekE2Bia5+g3FqTyaIEM6ONZdYm5crW78r74QDOtYyLci9nbQn Xokuwln86e36oDPVlNzQyuaplSQj3j5DLSi6yM0bxH2yMosvoBXVsOBLnDi7iJsRCXf0 Gs6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a170902c40700b001ab007aff67si1607120plk.32.2023.06.20.01.55.10; Tue, 20 Jun 2023 01:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231855AbjFTISv (ORCPT + 99 others); Tue, 20 Jun 2023 04:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbjFTISp (ORCPT ); Tue, 20 Jun 2023 04:18:45 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D7719127; Tue, 20 Jun 2023 01:18:43 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8CxPuviYJFk1B4HAA--.14548S3; Tue, 20 Jun 2023 16:18:42 +0800 (CST) Received: from bogon.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxReThYJFkJ3AhAA--.28832S3; Tue, 20 Jun 2023 16:18:42 +0800 (CST) From: Youling Tang To: Josh Poimboeuf , Peter Zijlstra , Huacai Chen , madvenka@linux.microsoft.com Cc: chenzhongjin@huawei.com, WANG Xuerui , Xi Ruoyao , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, tangyouling00@gmail.com, youling.tang@outlook.com Subject: [RFC PATCH v1 21/23] objtool: Add arch-specific "noreturn" function handling Date: Tue, 20 Jun 2023 16:18:30 +0800 Message-Id: <1687249112-2790-2-git-send-email-tangyouling@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1687249112-2790-1-git-send-email-tangyouling@loongson.cn> References: <1687249112-2790-1-git-send-email-tangyouling@loongson.cn> X-CM-TRANSID: AQAAf8CxReThYJFkJ3AhAA--.28832S3 X-CM-SenderInfo: 5wdqw5prxox03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoWxXFyrJrWkWr1kXrW5XF18Zwc_yoW5Kw43pF 1DC348uFyjga43Jw1UJw15WrW5uw12gry8Kr1jvr9xAr4aq39rtF4Sy3WqvF1Fqw4Fga4I yF4S9F4jyFWvvwcCm3ZEXasCq-sJn29KB7ZKAUJUUUU3529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUPEb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVWxJr0_GcWln4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q 6rW5McIj6I8E87Iv67AKxVW8Jr0_Cr1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x 0EwIxGrwACjcxG6xCI17CEII8vrVW3JVW8Jr1lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IY c2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_JF0_Jw1lx2IqxV Aqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q 6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6x kF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AK xVW8Jr0_Cr1UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyT uYvjxUDdOzDUUUU X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769211242979790190?= X-GMAIL-MSGID: =?utf-8?q?1769211242979790190?= Fix the following warnings: arch/loongarch/mm/fault.o: warning: objtool: no_context.part.0() falls through to next function do_sigsegv() It should mark 'dead_end' when the function is "noreturn/__noreturn". Signed-off-by: Youling Tang --- tools/objtool/arch/loongarch/special.c | 5 +++++ tools/objtool/arch/powerpc/special.c | 3 +++ tools/objtool/arch/x86/special.c | 4 ++++ tools/objtool/check.c | 7 ++++++- tools/objtool/include/objtool/special.h | 3 +++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/tools/objtool/arch/loongarch/special.c b/tools/objtool/arch/loongarch/special.c index 8669dbe44459..be4d5d83e331 100644 --- a/tools/objtool/arch/loongarch/special.c +++ b/tools/objtool/arch/loongarch/special.c @@ -5,6 +5,11 @@ #include #include +/* Architecture specific "noreturn" function */ +const char * const arch_noreturns[] = { + "die", +}; +int arch_noreturns_size = ARRAY_SIZE(arch_noreturns); bool arch_support_alt_relocation(struct special_alt *special_alt, struct instruction *insn, diff --git a/tools/objtool/arch/powerpc/special.c b/tools/objtool/arch/powerpc/special.c index d33868147196..35107e6ae2f1 100644 --- a/tools/objtool/arch/powerpc/special.c +++ b/tools/objtool/arch/powerpc/special.c @@ -4,6 +4,9 @@ #include #include +/* Architecture specific "noreturn" function */ +const char * const arch_noreturns[] = {}; +int arch_noreturns_size = ARRAY_SIZE(arch_noreturns); bool arch_support_alt_relocation(struct special_alt *special_alt, struct instruction *insn, diff --git a/tools/objtool/arch/x86/special.c b/tools/objtool/arch/x86/special.c index 7c97b7391279..48fa72f564f9 100644 --- a/tools/objtool/arch/x86/special.c +++ b/tools/objtool/arch/x86/special.c @@ -7,6 +7,10 @@ #define X86_FEATURE_POPCNT (4 * 32 + 23) #define X86_FEATURE_SMAP (9 * 32 + 20) +/* Architecture specific "noreturn" function */ +const char * const arch_noreturns[] = {}; +int arch_noreturns_size = ARRAY_SIZE(arch_noreturns); + void arch_handle_alternative(unsigned short feature, struct special_alt *alt) { switch (feature) { diff --git a/tools/objtool/check.c b/tools/objtool/check.c index f91723010d6b..c637e54088f6 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -110,11 +110,16 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, if (func->bind == STB_WEAK) return false; - if (func->bind == STB_GLOBAL) + if (func->bind == STB_GLOBAL) { for (i = 0; i < ARRAY_SIZE(global_noreturns); i++) if (!strcmp(func->name, global_noreturns[i])) return true; + for (i = 0; i < arch_noreturns_size; i++) + if (!strcmp(func->name, arch_noreturns[i])) + return true; + } + if (!func->len) return false; diff --git a/tools/objtool/include/objtool/special.h b/tools/objtool/include/objtool/special.h index 86d4af9c5aa9..f800817f0ed8 100644 --- a/tools/objtool/include/objtool/special.h +++ b/tools/objtool/include/objtool/special.h @@ -30,6 +30,9 @@ struct special_alt { unsigned int orig_len, new_len; /* group only */ }; +extern const char * const arch_noreturns[]; +extern int arch_noreturns_size; + int special_get_alts(struct elf *elf, struct list_head *alts); void arch_handle_alternative(unsigned short feature, struct special_alt *alt); From patchwork Tue Jun 20 08:18:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youling Tang X-Patchwork-Id: 110341 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3515164vqr; Tue, 20 Jun 2023 01:40:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ejktLJWAQzY6NBJgLIYSDLkBdbfI+O1GiRvitZs2cDTkzA3uz4/a6ENLCSzp13RdPet39 X-Received: by 2002:a9d:7509:0:b0:6b4:7139:572c with SMTP id r9-20020a9d7509000000b006b47139572cmr5047747otk.1.1687250448394; Tue, 20 Jun 2023 01:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687250448; cv=none; d=google.com; s=arc-20160816; b=xGloTkLcZghfQOz980lsd0NQ40k8byNbmediy3mpejwL01jKOajWPkFNvmFWd74Jqt 6Juw5zSMK/wagXFXX2RB4uxTCn7iD3QwUZR64HZUFCkoWgg7Qve6hq7CKmwzSEIV+ek1 7bGT1eRrpyvycHxidxtJcp31Mh/HxnVc4ZAXim7/fxpO63M0Ag/cEsCyo7F2zI/RyGaq SbXj3G0Q+NvWdhM5YG586WvIPPRdaxfG8e3pv6fm7FqVavqoZLZ7Bk5/IBwINms4L4Rm YDSir0a5YLLVb5HoJMaOwFGBIpcASG28B3iGQUCowShny6ZkthO1vpFk+fHdOAr5ZpPE U3Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=uY6/bfW29LJmhMLvG9Z8XK2a7wv6iCcocBUEm7xuqMg=; b=urrhrCNEoigdX07PQ14suvuVaHMFgmRX6nP0IpUyA5/N6LiozIRcfiKASwtKQgxs4h 46Ak+bqspBIXZCpQj0pKDxqs4JMwWyAhxmoZTrhSINCBXR3Mf0V4buyp6XeAN3XkRVsk bqJlvFmYs69e+mfk7h1vttcUPn0vZXCJ47BvqIaABzY5uAqbVRBpnPn/srJZpM3hfFqk z8jgZdWjqbl/oQh0eh5QLNlBnFodziZwnMLqiA0W2LstQvAsexhmF1p2fq5MNou+GWYA OKyCMrO0Hsc4TIaAhlzaMDyvHDcOHQEMxVrU5ZuL6nJJvyNk5blNLxT9YREV+Jhsu7o8 VuqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v27-20020a63b95b000000b0054405fa9251si1209642pgo.896.2023.06.20.01.40.34; Tue, 20 Jun 2023 01:40:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231873AbjFTIS5 (ORCPT + 99 others); Tue, 20 Jun 2023 04:18:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231826AbjFTISq (ORCPT ); Tue, 20 Jun 2023 04:18:46 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B78C5DB; Tue, 20 Jun 2023 01:18:44 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8DxzOrjYJFk3h4HAA--.14572S3; Tue, 20 Jun 2023 16:18:43 +0800 (CST) Received: from bogon.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxReThYJFkJ3AhAA--.28832S4; Tue, 20 Jun 2023 16:18:42 +0800 (CST) From: Youling Tang To: Josh Poimboeuf , Peter Zijlstra , Huacai Chen , madvenka@linux.microsoft.com Cc: chenzhongjin@huawei.com, WANG Xuerui , Xi Ruoyao , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, tangyouling00@gmail.com, youling.tang@outlook.com, Jinyang He Subject: [RFC PATCH v1 22/23] objtool: Make update_cfi_state() arch-specific function Date: Tue, 20 Jun 2023 16:18:31 +0800 Message-Id: <1687249112-2790-3-git-send-email-tangyouling@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1687249112-2790-1-git-send-email-tangyouling@loongson.cn> References: <1687249112-2790-1-git-send-email-tangyouling@loongson.cn> X-CM-TRANSID: AQAAf8CxReThYJFkJ3AhAA--.28832S4 X-CM-SenderInfo: 5wdqw5prxox03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoW3GFyUWFWUGr4kGw1kKw47Jrc_yoWxGF47pF WDZ3yrGrWUWw4xuwnFqrZ0gFZxKws7Wr10gryxJ34ftry2grn5JFs29FyqyF4rWrs5ua42 qFWakr4UXa1ay3gCm3ZEXasCq-sJn29KB7ZKAUJUUUU3529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUPEb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVWxJr0_GcWln4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q 6rW5McIj6I8E87Iv67AKxVW8Jr0_Cr1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x 0EwIxGrwACjcxG6xCI17CEII8vrVW3JVW8Jr1lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IY c2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_JF0_Jw1lx2IqxV Aqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q 6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Xr0_Ar1lIxAIcVC0I7IYx2IY6x kF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AK xVW8Jr0_Cr1UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyT uYvjxUDdOzDUUUU X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_FILL_THIS_FORM_SHORT,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769210325848299000?= X-GMAIL-MSGID: =?utf-8?q?1769210325848299000?= Currently update_cfi_state() is implemented for the x86_64 architecture. This function is specific to the architecture. In order to avoid powerpc build errors, define x86_64 as the default implementation and rename update_cfi_state() to arch_update_cfi_state(). LoongArch will reimplement arch_update_cfi_state(). Co-developed-by: Jinyang He Signed-off-by: Jinyang He Signed-off-by: Youling Tang --- tools/objtool/arch/loongarch/decode.c | 76 +++++++++++++++++++++++++++ tools/objtool/check.c | 10 ++-- tools/objtool/include/objtool/arch.h | 3 ++ tools/objtool/include/objtool/check.h | 5 ++ 4 files changed, 89 insertions(+), 5 deletions(-) diff --git a/tools/objtool/arch/loongarch/decode.c b/tools/objtool/arch/loongarch/decode.c index 90adbbeab8d4..6ca8cbad6813 100644 --- a/tools/objtool/arch/loongarch/decode.c +++ b/tools/objtool/arch/loongarch/decode.c @@ -4,6 +4,8 @@ #include #include +#include + #include #include @@ -274,3 +276,77 @@ void arch_initial_func_cfi_state(struct cfi_init_state *state) state->cfa.base = CFI_SP; state->cfa.offset = 0; } + + +int arch_update_cfi_state(struct instruction *insn, + struct instruction *next_insn, + struct cfi_state *cfi, struct stack_op *op) +{ + struct cfi_reg *cfa = &cfi->cfa; + struct cfi_reg *regs = cfi->regs; + + /* stack operations don't make sense with an undefined CFA */ + if (cfa->base == CFI_UNDEFINED) { + if (insn_func(insn)) { + WARN_FUNC("undefined stack state", insn->sec, insn->offset); + return -1; + } + return 0; + } + + if (cfi->type == UNWIND_HINT_TYPE_REGS) + return update_cfi_state_regs(insn, cfi, op); + + + switch (op->dest.type) { + case OP_DEST_REG: + switch (op->src.type) { + case OP_SRC_ADD: + if (op->dest.reg == CFI_SP && op->src.reg == CFI_SP) { + /* addi.d sp, sp, imm */ + cfi->stack_size -= op->src.offset; + if (cfa->base == CFI_SP) + cfa->offset -= op->src.offset; + } else if (op->dest.reg == CFI_FP && op->src.reg == CFI_SP) { + /* addi.d fp, sp, imm */ + if (cfa->base == CFI_SP && cfa->offset == op->src.offset) { + cfa->base = CFI_FP; + cfa->offset = 0; + } + } else if (op->dest.reg == CFI_SP && op->src.reg == CFI_FP) { + /* addi.d sp, fp, imm */ + if (cfa->base == CFI_FP && cfa->offset == 0) { + cfa->base = CFI_SP; + cfa->offset = -op->src.offset; + } + } + break; + case OP_SRC_REG_INDIRECT: + /* ld.d _reg, sp, imm */ + if (op->src.reg == CFI_SP && + op->src.offset == (regs[op->dest.reg].offset + cfi->stack_size)) { + restore_reg(cfi, op->dest.reg); + /* Gcc may not restore sp, we adjust it directly. */ + if (cfa->base == CFI_FP && cfa->offset == 0) { + cfa->base = CFI_SP; + cfa->offset = cfi->stack_size; + } + } + break; + default: + break; + } + break; + case OP_DEST_REG_INDIRECT: + if (op->src.type == OP_SRC_REG) + /* st.d _reg, sp, imm */ + if (op->dest.offset) + save_reg(cfi, op->src.reg, CFI_CFA, op->dest.offset - cfi->stack_size); + break; + default: + WARN_FUNC("unknown stack-related instruction", insn->sec, insn->offset); + return -1; + } + + return 0; +} diff --git a/tools/objtool/check.c b/tools/objtool/check.c index c637e54088f6..42f87a33f558 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2230,7 +2230,7 @@ static bool has_valid_stack_frame(struct insn_state *state) return false; } -static int update_cfi_state_regs(struct instruction *insn, +int update_cfi_state_regs(struct instruction *insn, struct cfi_state *cfi, struct stack_op *op) { @@ -2255,7 +2255,7 @@ static int update_cfi_state_regs(struct instruction *insn, return 0; } -static void save_reg(struct cfi_state *cfi, unsigned char reg, int base, int offset) +void save_reg(struct cfi_state *cfi, unsigned char reg, int base, int offset) { if (arch_callee_saved_reg(reg) && cfi->regs[reg].base == CFI_UNDEFINED) { @@ -2264,7 +2264,7 @@ static void save_reg(struct cfi_state *cfi, unsigned char reg, int base, int off } } -static void restore_reg(struct cfi_state *cfi, unsigned char reg) +void restore_reg(struct cfi_state *cfi, unsigned char reg) { cfi->regs[reg].base = initial_func_cfi.regs[reg].base; cfi->regs[reg].offset = initial_func_cfi.regs[reg].offset; @@ -2323,7 +2323,7 @@ static void restore_reg(struct cfi_state *cfi, unsigned char reg) * 41 5d pop %r13 * c3 retq */ -static int update_cfi_state(struct instruction *insn, +int __weak arch_update_cfi_state(struct instruction *insn, struct instruction *next_insn, struct cfi_state *cfi, struct stack_op *op) { @@ -2795,7 +2795,7 @@ static int handle_insn_ops(struct instruction *insn, for (op = insn->stack_ops; op; op = op->next) { - if (update_cfi_state(insn, next_insn, &state->cfi, op)) + if (arch_update_cfi_state(insn, next_insn, &state->cfi, op)) return 1; if (!insn->alt_group) diff --git a/tools/objtool/include/objtool/arch.h b/tools/objtool/include/objtool/arch.h index 2b6d2ce4f9a5..88570c598752 100644 --- a/tools/objtool/include/objtool/arch.h +++ b/tools/objtool/include/objtool/arch.h @@ -95,4 +95,7 @@ int arch_rewrite_retpolines(struct objtool_file *file); bool arch_pc_relative_reloc(struct reloc *reloc); +int __weak arch_update_cfi_state(struct instruction *insn, + struct instruction *next_insn, + struct cfi_state *cfi, struct stack_op *op); #endif /* _ARCH_H */ diff --git a/tools/objtool/include/objtool/check.h b/tools/objtool/include/objtool/check.h index 34898364bf03..dd1b95c67620 100644 --- a/tools/objtool/include/objtool/check.h +++ b/tools/objtool/include/objtool/check.h @@ -33,4 +33,9 @@ struct alt_group { extern unsigned long nr_insns; +int update_cfi_state_regs(struct instruction *insn, + struct cfi_state *cfi, + struct stack_op *op); +void save_reg(struct cfi_state *cfi, unsigned char reg, int base, int offset); +void restore_reg(struct cfi_state *cfi, unsigned char reg); #endif /* _CHECK_H */ From patchwork Tue Jun 20 08:18:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youling Tang X-Patchwork-Id: 110340 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3514676vqr; Tue, 20 Jun 2023 01:39:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6lQC0RsZgM5j9u8VbrjRqvWI8sg+MDr7ZpjHT1HfUZMQLvju1/cO+ooUB5Q8YAEfok47Se X-Received: by 2002:a05:6a00:1a89:b0:668:7744:10f5 with SMTP id e9-20020a056a001a8900b00668774410f5mr4897619pfv.10.1687250370765; Tue, 20 Jun 2023 01:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687250370; cv=none; d=google.com; s=arc-20160816; b=Z9wrzmGA2TejojeVtbFz5oz+edDsW6pKCRTnyziTDxoWUFWSS30avoqtqAF1X/1oaJ vH22ZlQP2rZ/57xYTvQzoLKuotiDrtWuAUnQEsnO1e3uZooynHM5wPBYyCijiRO1DfwM 8dR7zlqwgFNWfE5UOeST32UeOrOFZ7yOB0O1arqtX6kYoP/YH2UeFx57cV1rNELbS4Xr 8o2PQizRhuPoWu6LWMIvnL7g15JivkBF7hYlSnlOvu9KitiZv/d/g4f5YcfUTCyC76sj eI6x83e5pvQ9dGjEX56hvMthAS2kDMvcLdq0RpXxvDcLg8gPfhYqMnAnYNeWtBfCVko8 RmGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=2rGc7oHaaETtaWP09k4lNiD73dO3IxJ7pMNRTa+98Oc=; b=csOqNerO4AlKQ14dh9pkYoWJvCf2FHEpsAfuzSa/T16zXPTAbzD1CPAeqr9GwEO7AA shWrSSksn+687ImVK3RsETpJ5QxCEy8T8lcq9g35yGbf+tQvX01XjHX2hMYb+EyY8OZO 8G4ObLbWUyecKQSWk0A+91AXULmD/mKOXvVhiBzSbdc1ldwE97roX2PcTO6sgpwf1eSJ CF5eJl0ZcSPQkgD5etNztDBiFnKE0guqINYTkWWx3cUN0duLv4ZeN1r8+1XCxCfZSJ8k yMZF08BE0UnSozcd8wxqUqCAlLBQ8x/IZeBimvIfPDhNOH/lZ+MGrjNgAb4nw0r8u3wZ Q1zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h65-20020a625344000000b0065e445224e5si1202536pfb.332.2023.06.20.01.39.14; Tue, 20 Jun 2023 01:39:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230514AbjFTISz (ORCPT + 99 others); Tue, 20 Jun 2023 04:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231833AbjFTISr (ORCPT ); Tue, 20 Jun 2023 04:18:47 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 892F5132; Tue, 20 Jun 2023 01:18:45 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8CxtOjkYJFk6B4HAA--.4271S3; Tue, 20 Jun 2023 16:18:44 +0800 (CST) Received: from bogon.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxReThYJFkJ3AhAA--.28832S5; Tue, 20 Jun 2023 16:18:43 +0800 (CST) From: Youling Tang To: Josh Poimboeuf , Peter Zijlstra , Huacai Chen , madvenka@linux.microsoft.com Cc: chenzhongjin@huawei.com, WANG Xuerui , Xi Ruoyao , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, tangyouling00@gmail.com, youling.tang@outlook.com Subject: [RFC PATCH v1 23/23] LoongArch: objtool: Mark non-standard object files and directories Date: Tue, 20 Jun 2023 16:18:32 +0800 Message-Id: <1687249112-2790-4-git-send-email-tangyouling@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1687249112-2790-1-git-send-email-tangyouling@loongson.cn> References: <1687249112-2790-1-git-send-email-tangyouling@loongson.cn> X-CM-TRANSID: AQAAf8CxReThYJFkJ3AhAA--.28832S5 X-CM-SenderInfo: 5wdqw5prxox03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoW7CrWfZr1xJFWrZr17AFWxKrX_yoW8ArWkpr nI9a1kJr4kur1kKrykt3y5Zr1Uta4DKr12ga1YvFy8CrnrXr1DZr4xJrWDXF1jgw4rAayF gwn3G34aqFWUJacCm3ZEXasCq-sJn29KB7ZKAUJUUUU3529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUmjb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Cr1j6rxdM2kKe7AKxVWUAVWUtwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07 AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWr XVW3AwAv7VC2z280aVAFwI0_Gr1j6F4UJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2 Ij64vIr41lF7xvrVCFI7AF6II2Y40_Zr0_Gr1UMxkF7I0En4kS14v26r126r1DMxAIw28I cxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI1I0E14v26r126r1DMI8I3I 0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWU tVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcV CY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAF wI0_Gr1j6F4UJwCI42IY6I8E87Iv6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43 ZEXa7IU5HOJ5UUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769210244991582142?= X-GMAIL-MSGID: =?utf-8?q?1769210244991582142?= Set OBJECT_FILES_NON_STANDARD for their related files and directories, which will tell objtool to skip checking them. It's ok to skip them because they don't affect runtime stack traces. Signed-off-by: Youling Tang --- arch/loongarch/kernel/Makefile | 2 ++ arch/loongarch/power/Makefile | 2 ++ arch/loongarch/vdso/Makefile | 2 ++ 3 files changed, 6 insertions(+) diff --git a/arch/loongarch/kernel/Makefile b/arch/loongarch/kernel/Makefile index fcbfa0f38b53..9ea4d6b93f4d 100644 --- a/arch/loongarch/kernel/Makefile +++ b/arch/loongarch/kernel/Makefile @@ -3,6 +3,8 @@ # Makefile for the Linux/LoongArch kernel. # +OBJECT_FILES_NON_STANDARD_head.o := y + extra-y := vmlinux.lds obj-y += head.o cpu-probe.o cacheinfo.o env.o setup.o entry.o genex.o \ diff --git a/arch/loongarch/power/Makefile b/arch/loongarch/power/Makefile index 58151d003e40..bbd1d4793e8b 100644 --- a/arch/loongarch/power/Makefile +++ b/arch/loongarch/power/Makefile @@ -1,3 +1,5 @@ +OBJECT_FILES_NON_STANDARD_suspend_asm.o := y + obj-y += platform.o obj-$(CONFIG_SUSPEND) += suspend.o suspend_asm.o diff --git a/arch/loongarch/vdso/Makefile b/arch/loongarch/vdso/Makefile index d89e2ac75f7b..37c7795990b8 100644 --- a/arch/loongarch/vdso/Makefile +++ b/arch/loongarch/vdso/Makefile @@ -1,6 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 # Objects to go into the VDSO. +OBJECT_FILES_NON_STANDARD := y + # Absolute relocation type $(ARCH_REL_TYPE_ABS) needs to be defined before # the inclusion of generic Makefile. ARCH_REL_TYPE_ABS := R_LARCH_32|R_LARCH_64|R_LARCH_MARK_LA|R_LARCH_JUMP_SLOT