Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2913150pxb; Mon, 18 Apr 2022 10:54:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiLn3npd7/LC97jyK7Xmi7X2ZhzJRyHehgGim67M239d/iJrf5jSCdWWV1L4AUMFEmFdV4 X-Received: by 2002:a05:6402:1695:b0:41d:6b06:f81 with SMTP id a21-20020a056402169500b0041d6b060f81mr13267056edv.98.1650304491461; Mon, 18 Apr 2022 10:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650304491; cv=none; d=google.com; s=arc-20160816; b=Ou+Msjycb+y8dQhP1L07aWzv0X7UF9r0r5G73HRPa0At31LPqcc59p4/Ypa3hmBJea PTSnRITgPf5AXRubvyjUSraHsCVjqKWoWtpAP3K3KH3YP11TkowTwkPs28WnLXdUsWzT Vv8wLWX3l6u6+lwHXkSuoNHRBpq1qZX5GIHAnVnje4znJ9Ji20L48hvo0QoInsoc1yIv yAcM6khneIELnzLFm1UQoSGN6YmoWtiNvt2jfeb9+f2sorc3fDIyWZarGL9TtUNCH41e d/wEwgEsOPBO75EZ9vH4gIRtbdmJjLBacJ3HZ+eHiYIXWskVFQMpyPp8PEoslGHvTpCT hFgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N3FZ0UbIBh+pC4LkbWz13qdoGFRxy+mHDUCw3fV57R8=; b=udWpGw+4R+ZulathavKcIIGFpQJorPQDRHSxTmFjsmtUT9PLlXj3uZUuXcooAh+/ji /y3fj5uTp703u8l5MXCXaMp4NdgYRrDdK0+gEK5tb7vptbqdh9GcS7+g5k2nl1i/ROfx HNaiSVCGZO68fx37QH+k0d81O4uqOxHfyaLXxKa93cEQgzl/iY0J42JSp3kUBIeYFVDG k37Zp3Qu7/ffMcGHdBN+8HvWBadzNBbedWq5fLR20bBGEXk7cEzBLQFkbmQQeK63K1Ds jO1AzZMVB5hDtAsPhfuEdfXDvceUJw9Uz2VC7FTb896ANORGifZV8Zm92z3xXGl0kUJr qTTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DmC8YeFX; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j12-20020a05640211cc00b00423f052f4ddsi1768799edw.314.2022.04.18.10.54.27; Mon, 18 Apr 2022 10:54:51 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DmC8YeFX; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239404AbiDRMgu (ORCPT + 99 others); Mon, 18 Apr 2022 08:36:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238989AbiDRMa0 (ORCPT ); Mon, 18 Apr 2022 08:30:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B540E20BF0; Mon, 18 Apr 2022 05:23:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3609660FA7; Mon, 18 Apr 2022 12:23:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BC5FC385A1; Mon, 18 Apr 2022 12:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284619; bh=oknzdsPyyYxHHeLKbM5fyYkIpdaUMdm8VabbP461qHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DmC8YeFXWISbS7BWbJmSWFu34N14XDw79cqTsnO8ZzstEz5DJwBJEPLseXwGCVeAA CNLEAceVcxaee6v2mw0STsSg4hlbUTj/Ag2B7u4ZvPue0mIIQqiB0K40L94qicl7AL sHRPUHcrjKDdUwTrpTuAK8ld0wCw5hqnnTvZ0F04= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Alexei Starovoitov , Sasha Levin Subject: [PATCH 5.17 171/219] x86,bpf: Avoid IBT objtool warning Date: Mon, 18 Apr 2022 14:12:20 +0200 Message-Id: <20220418121211.667290215@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Peter Zijlstra [ Upstream commit be8a096521ca1a252bf078b347f96ce94582612e ] Clang can inline emit_indirect_jump() and then folds constants, which results in: | vmlinux.o: warning: objtool: emit_bpf_dispatcher()+0x6a4: relocation to !ENDBR: .text.__x86.indirect_thunk+0x40 | vmlinux.o: warning: objtool: emit_bpf_dispatcher()+0x67d: relocation to !ENDBR: .text.__x86.indirect_thunk+0x40 | vmlinux.o: warning: objtool: emit_bpf_tail_call_indirect()+0x386: relocation to !ENDBR: .text.__x86.indirect_thunk+0x20 | vmlinux.o: warning: objtool: emit_bpf_tail_call_indirect()+0x35d: relocation to !ENDBR: .text.__x86.indirect_thunk+0x20 Suppress the optimization such that it must emit a code reference to the __x86_indirect_thunk_array[] base. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Alexei Starovoitov Link: https://lkml.kernel.org/r/20220405075531.GB30877@worktop.programming.kicks-ass.net Signed-off-by: Sasha Levin --- arch/x86/net/bpf_jit_comp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 0ecb140864b2..b272e963388c 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c @@ -398,6 +398,7 @@ static void emit_indirect_jump(u8 **pprog, int reg, u8 *ip) EMIT_LFENCE(); EMIT2(0xFF, 0xE0 + reg); } else if (cpu_feature_enabled(X86_FEATURE_RETPOLINE)) { + OPTIMIZER_HIDE_VAR(reg); emit_jump(&prog, &__x86_indirect_thunk_array[reg], ip); } else #endif -- 2.35.1