Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1815902rwb; Fri, 2 Dec 2022 01:16:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf7yrkT3FNMFdOmvbxq2VhtMvDbEMmt9WOfNVbScZIas7ZGG8X7e4QOkkLpiNt/f7qJHW4CD X-Received: by 2002:a63:180a:0:b0:470:63e5:5c59 with SMTP id y10-20020a63180a000000b0047063e55c59mr43635540pgl.172.1669972580339; Fri, 02 Dec 2022 01:16:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669972580; cv=none; d=google.com; s=arc-20160816; b=eZes2lEmbzLHIUhRjx0htzdM1S0M6q5RVFD/3OYbpcc9pMd+NxvcCTHkyjJUuXSxug CnR9ckwg71aTmRoWWZQYqVvntX4gtRCox2wdoz1oXJqgFY4DEcgwD2eVJPqhL//9D7pS iV83euK/DsMrcptY1qDYoOodffYN4tjZsoO7teRyNZ7fEElqLiFcqhV7CRDfs4mr1h1m cJP0hgu1cImlVourzZzhBQ9DW0TtzLOyfdWdk5wDIJvOkbUngPOoVLbXkF+J5EeWFHjD yYmLw1RFxUhAdIPSMsO7QDQ3o81UIsmuVqrh7eC4OdJrDeaWDPXbfyeUBx9gW5yZm+Bb 59ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=lN42srUvko/yeQiW9diW69NJvz1gAZRnKkgiMVZshFA=; b=wdefD1vzNhoqrqXRlY/PA3KQK3oDM5ZMVebyL410jESuAMrE1InGmQOQqczB4CtRAt ZbGn8WnGHThkObVUxTMlzR8SJm2XaSouW8rOhsmIKGP4EKPcAuOvKeEL/hIWMiPKEijL 44OJa+rXx0mSvAtxfc6mxE/iUw85EaXFhI9TizdUcqdgSfxfF10g9RoPLJi4vLmLWAAk alirQKhuPgDoH48mUNyWAm8Vcyd1xli06+Q6HR1aHd4ewOT8Y3MUlajYcobsU60F8AvG s0DqFsmAeXCEAT+wSIceuH7nsGACCFZ4ZLgGIoWXUecc9WK5Fb6kvjiKEC2gGHvxxzAr KMqQ== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a170902778d00b00182c510591asi6506140pll.246.2022.12.02.01.16.10; Fri, 02 Dec 2022 01:16:20 -0800 (PST) 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232442AbiLBIq4 (ORCPT + 83 others); Fri, 2 Dec 2022 03:46:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232100AbiLBIqy (ORCPT ); Fri, 2 Dec 2022 03:46:54 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B472C8EE51 for ; Fri, 2 Dec 2022 00:46:53 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NNmfb1Rn3zqSxN; Fri, 2 Dec 2022 16:42:47 +0800 (CST) Received: from [10.174.151.185] (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 2 Dec 2022 16:46:51 +0800 Subject: Re: [PATCH v2] x86/alternative: fix undefined reference to __ibt_endbr_seal[_end] To: , , , CC: , , References: <20221011113803.956808-1-linmiaohe@huawei.com> From: Miaohe Lin Message-ID: Date: Fri, 2 Dec 2022 16:46:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20221011113803.956808-1-linmiaohe@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 Friendly ping ;) On 2022/10/11 19:38, Miaohe Lin wrote: > Due to the explicit 'noinline' GCC-7.3 is not able to optimize away the > argument setup of: > > apply_ibt_endbr(__ibt_endbr_seal, __ibt_enbr_seal_end); > > even when X86_KERNEL_IBT=n and the function is an empty stub which leads > to link errors due to missing __ibt_endbr_seal* symbols like below: > > ld: arch/x86/kernel/alternative.o: in function > `alternative_instructions': > alternative.c:(.init.text+0x15d): undefined reference to > `__ibt_endbr_seal_end' > ld: alternative.c:(.init.text+0x164): undefined reference to > `__ibt_endbr_seal' > > Remove explicit 'noinline' to help gcc optimize them away. > [Thanks Peter Zijlstra for tweaking the commit log.] > > Signed-off-by: Miaohe Lin > --- > arch/x86/kernel/alternative.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c > index 5cadcea035e0..beaf9fc44e2f 100644 > --- a/arch/x86/kernel/alternative.c > +++ b/arch/x86/kernel/alternative.c > @@ -624,7 +624,7 @@ void __init_or_module noinline apply_ibt_endbr(s32 *start, s32 *end) > > #else > > -void __init_or_module noinline apply_ibt_endbr(s32 *start, s32 *end) { } > +void __init_or_module apply_ibt_endbr(s32 *start, s32 *end) { } > > #endif /* CONFIG_X86_KERNEL_IBT */ > >