Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1993169rwb; Fri, 2 Dec 2022 04:11:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf6eJT0tTWdBcGlARkvzsJ8QlXYZpe5IKtdC5OHgvPtXiRkrS/CUt/MV1KoJnB6LeMAHCCfc X-Received: by 2002:a65:4c85:0:b0:46f:59bd:6125 with SMTP id m5-20020a654c85000000b0046f59bd6125mr62955429pgt.147.1669983067563; Fri, 02 Dec 2022 04:11:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669983067; cv=none; d=google.com; s=arc-20160816; b=UunQn2e+tPvKBFJwCl0Ef24QkY/MBEtWwVJ7IWffA4kT7kIFcOJsGSVRL7ThB9eE3B fKWbpnY6QSisMOhd+Oy5R097Q5I7aux2euMSKNVJ/7FFsLDlRig7tTEPOIOEwSIDeRZ+ Y/Yp/GXubmSkojHJeJUoqRvIbErIpN4mNn1xk/t0tyw1Y2pZGMD24w9bLBmzEZi10ks6 cWsTFlKARyXmQwPR7yT4CROPUvZdxsqW5HV7ENqFQhU9/TfEaduWhM0ODo8nBLLgbxOi bam/TVkzZNPoDJ1K3VZUzdLvUDI4txQ4ZAxL7lWhahn924bDY+R4enkONNoo5OgtTVmb wAlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=FuTxsHaX4pa8PYtAzRpn9Ilwnb3Tx9DNZ8XPxnFRgCQ=; b=dnePNq0PIV2QQhzwzy7hmGzEMJDosuKl+oPoKDeeKKVFjhjw0o/KfUzx2ezWpOuqqL xajE+uj1Lv+X5FvfBIcQcwCzpp07E3kuq/xQB2eWtMMsvs+guxVJz+SBsIgPtrpf2lhs lid0OkSpkTos36Ksl5EPgF/aN6iThG1qEOYZ30tKV9B4ZS/f8Q+3piNaL9CnXP4JglZL zQrRyRF1LvPdy7QNYUV09ML8DEbkEJIxgAQlkc/gA28BZ2yppxaF9taH6fNSXhsrKcv2 M1Lkj/fuDx80BgoneqWPy9alCk/mgdWlKrIXVDs/+B/QoTakPd1hSjXRe8oUrKyu0C7v m27A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zSlJAiWa; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a170902ba8900b00188a7401d89si6424894pls.481.2022.12.02.04.10.55; Fri, 02 Dec 2022 04:11:07 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zSlJAiWa; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232681AbiLBL7j (ORCPT + 83 others); Fri, 2 Dec 2022 06:59:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbiLBL7i (ORCPT ); Fri, 2 Dec 2022 06:59:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01E4D9D2FC for ; Fri, 2 Dec 2022 03:59:37 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669982376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FuTxsHaX4pa8PYtAzRpn9Ilwnb3Tx9DNZ8XPxnFRgCQ=; b=zSlJAiWabZ/MW0paX2M/vZelt8JK7y5RcEMdMjWFUho3B/TFC64NfVpSJ8mSqlmD0+Bwsq L0x603Q1gXnujeN11DD+ZAcBe0xbL3Tkp9UwmolpHJ5W0NYd7bmWUpfBKTbldhyhFwZBzt QWzVsd14FYWaEp4iTe7WQwG8zf+zp4zWqNJk53O3dWBLLUShN4IHqU5m439d3J315xYjgR PJEMRsVNiOtWEeoIhVjTy4j5awo0vm2zvuX4RDAsyY94DNxSTW6QkfoxAfYbKibTVQr/oT KmdSt7HkOp4Nf5jWGClOItmR4krg8NcjQ+iUmwzLa9Xx3dTDPqzq497jVs24Qw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669982376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FuTxsHaX4pa8PYtAzRpn9Ilwnb3Tx9DNZ8XPxnFRgCQ=; b=TAQFXhInn7wLSJP2Coi1IlaWl5AspRGCeIR5ymKiugQCZJMupdRJiXoim4T5WIctUoVM9p J7BWGYBZ9jOkqJBw== To: Miaohe Lin , mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, linmiaohe@huawei.com Subject: Re: [PATCH v2] x86/alternative: fix undefined reference to __ibt_endbr_seal[_end] In-Reply-To: <20221011113803.956808-1-linmiaohe@huawei.com> References: <20221011113803.956808-1-linmiaohe@huawei.com> Date: Fri, 02 Dec 2022 12:59:36 +0100 Message-ID: <87y1rqow2f.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 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. Thanks, tglx