Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2938874rwb; Fri, 2 Dec 2022 18:19:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf6d4wwxs3UHu0P7JoVIBUNKmn04gifttKfyqbPNIwbME4rnm/vq+gaiNcDBHSY8mDRMk9jT X-Received: by 2002:a05:6a00:1892:b0:572:b324:bbe9 with SMTP id x18-20020a056a00189200b00572b324bbe9mr55636285pfh.57.1670033975331; Fri, 02 Dec 2022 18:19:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670033975; cv=none; d=google.com; s=arc-20160816; b=CqxDRSQ6oV8sfqh1SvQ32FnePrkYzDRMdQY//Ly5Ij7Qv6Q38ppJeFvhPcrCBeYyak ZIUeuqomal8OsFLZBMlJyjXKLTpCUzt8hDALO58TJv5WEzLDCTcenetHBowcZfAAuIes 0+rNPSFFwQT1kCC8E8PV9w3LxPIyUUfUoPds7IBFIHYivMVxAchsPtzU09KH/Jnkmk+U tSWwsFjGYV2pYMhqLkCHu4y0ytxrWBtSlidSwkvzImraM3osqlL2UZEMTGd7A5JcGSm6 KyhbpLhU/Eu76DN2krTMJ3w84zPCV4w6NoZpfHVefRIm2tK4TAu84e2c+FROQnfFRUPJ iuvQ== 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=jmMcZZljsuhi1dVKJpJ73pA4oXUGlLmencGArg0QhHk=; b=yIavkXWK2jmZAfIYi2jxNnuAGiaBWq6LQ0429Zj3JcSImbMXHmLdPI38QrVZZM4KBe dK9LNzL6BtEVeoENHGb2EZ0/3UjkJlMGsx33d6OCsFn84np2NZGV5AJJhxL599iTT7M0 s8zq4XpwGG0ldl14SVcRdNqDMYz/1kjFoPr8s1GqC04p7b4pEpOYp9JapAyU+UmaZ6/B TRq1VsXlqm40Osy/qjZQa9Pyv2/3cN+t7cB+0sXqHcWAM0f3tdN2QiMPy/a3gzXr2fu9 Zymbemae+iozB2HEqvJVKuivBdui8Gi8xNWIC8ai5S4wqxGx9pBHpbvPCrvUKYOPn5rC C+ag== 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 n12-20020a170903110c00b0017f7faef235si9269181plh.148.2022.12.02.18.19.25; Fri, 02 Dec 2022 18:19:35 -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 S235010AbiLCBUk (ORCPT + 83 others); Fri, 2 Dec 2022 20:20:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234921AbiLCBUh (ORCPT ); Fri, 2 Dec 2022 20:20:37 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBA0CE464A for ; Fri, 2 Dec 2022 17:20:34 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NPBj70dwHzqSc9; Sat, 3 Dec 2022 09:16:27 +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; Sat, 3 Dec 2022 09:20:32 +0800 Subject: Re: [PATCH v2] x86/alternative: fix undefined reference to __ibt_endbr_seal[_end] To: Thomas Gleixner CC: , , , , , References: <20221011113803.956808-1-linmiaohe@huawei.com> <87y1rqow2f.ffs@tglx> From: Miaohe Lin Message-ID: <26329195-584e-afe3-d0c2-4715a48128a6@huawei.com> Date: Sat, 3 Dec 2022 09:20:31 +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: <87y1rqow2f.ffs@tglx> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 On 2022/12/2 19:59, Thomas Gleixner wrote: > On Tue, Oct 11 2022 at 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' > > This is incomplete because the noinline is only visible within > alternative.c, but there is another caller in module.c > > This needs an inline stub in the header to be correct. > I see. I think I should update my gcc instead :) Thanks for your reply. Thanks, Miaohe Lin