Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36560014rwd; Tue, 11 Jul 2023 02:38:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlGZgE2ZrKdioB1vgrwGQihkWT+3LKG9gTpdJ43cKHzxAHenzw1TEYj4V4PqlNnNXFurBIOh X-Received: by 2002:a05:6a20:3ca1:b0:131:44d2:cea3 with SMTP id b33-20020a056a203ca100b0013144d2cea3mr8867124pzj.57.1689068310300; Tue, 11 Jul 2023 02:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689068310; cv=none; d=google.com; s=arc-20160816; b=TwHbgJdmzvnLogWeVv6/xJLY0DieXYxtdW0cSLyULBfLyj4iZLGhGPR5LM06FsEARl bdKY1/URs/DYnV1xTV5AfSz56PMBEgZCDDhh9qqxZNvhtFP1F54NNcpaAqI2g8cFnxDk PSW57gV2inwTZkC5LIFki/JPpRoK+u4dgFPkN6+4oExGe7VcQLhqA/7o6yllzUU1CZvm pdPnzabLcDD08IHHAhQc0L4Rm7wJN04aX/ULVkd8T601VCN+nY8s3CNFKXgzXEuuJLnL uv4m5IgG63zKAFRm0RrFdhJVuzQAUUifRCdboUvEYjT1EVKUub1KlceQHlGBz491cIk6 P6HA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=1jlkb8dUUa0Nv29PncgxS1y0JcIN/aXBsVfRkm+5+/k=; fh=A/iTK4ByaBbZ28HmqSXeJy2l0eu6hrhZ4VrfzDt8MTI=; b=pHWCjl2jbLAt2Nu8Y7mTLF5FAq8GNFvfb7ljL5JWUn2hGwcdcULfynGPV9CeyO6J7L MozpUKuRPhcwK872qs/uWpeBgqKnLsqpdVhTrUlctR5jRm4AgRhjlpyVenOxvnu8K909 j+SwqMRAO1kdtII+nltl/iz7eQX+itUK6hf7fD2Ci3w1iE49gLYgshi29mXnYvPpAANS nRA+4kp8UeDb/gZP5d1M2Al8fn9IBw5y4AJgyaL5yAH5kD55SXzZEhEO2usEOPQXN0fH yMCBDZM8RCvcvCVBiF2HOmWHV+u5lqykYNnvCI/6OLwKn+NdF6SQ4thazt0hpFmcD81K KRRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=SQcGB8uQ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 200-20020a6219d1000000b00682909b9671si1194085pfz.75.2023.07.11.02.38.18; Tue, 11 Jul 2023 02:38: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; dkim=pass header.i=@suse.com header.s=susede1 header.b=SQcGB8uQ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231886AbjGKJZM (ORCPT + 99 others); Tue, 11 Jul 2023 05:25:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231782AbjGKJYs (ORCPT ); Tue, 11 Jul 2023 05:24:48 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBA1FF7; Tue, 11 Jul 2023 02:20:15 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 676B4226B8; Tue, 11 Jul 2023 09:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1689067214; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1jlkb8dUUa0Nv29PncgxS1y0JcIN/aXBsVfRkm+5+/k=; b=SQcGB8uQgfa14QM7KSMT2CXef1FZOxkEY2eO9m0hIECqCvg5dyDqs8GjTLcYrp0Nuccupd +JnmjAwVPOUkF1dNu+dMSvE1kEKTrx/L2t/Y4ojlka+tm0s8PG8UUHQ1otJVUZ6Mybieal 7Iks0BXJEpBdVuAUVSInOe+W/AQ0qRk= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 34BD71390F; Tue, 11 Jul 2023 09:20:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jtwYDM4erWSiVwAAMHmgww (envelope-from ); Tue, 11 Jul 2023 09:20:14 +0000 From: Petr Pavlu To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mhiramat@kernel.org, peterz@infradead.org Cc: samitolvanen@google.com, x86@kernel.org, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Pavlu Subject: [PATCH v2 0/2] x86/retpoline,kprobes: Fix the [__indirect_thunk_start, ..end] range Date: Tue, 11 Jul 2023 11:19:50 +0200 Message-Id: <20230711091952.27944-1-petr.pavlu@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_NONE,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 Fix problems with an output position of thunk sections and the associated definition of range [__indirect_thunk_start, __indirect_thunk_end] which affects the kprobes optimization. Initial v1 of the series kept the mentioned range but it turns out the logic which uses it is not necessary so it is removed altogether. Changes since v1 [1]: - Drop the patch which moved the return thunk out of [__indirect_thunk_start, ..end] and instead replace it with a removal of the kprobes optimization check which looked for calls to indirect thunks. - Slightly adjust the commit message for the first patch, to better match the new second patch. [1] https://lore.kernel.org/lkml/20230705081547.25130-1-petr.pavlu@suse.com/ Petr Pavlu (2): x86/retpoline,kprobes: Fix position of thunk sections with CONFIG_LTO_CLANG x86/retpoline,kprobes: Skip optprobe check for indirect jumps with retpolines and IBT arch/x86/include/asm/nospec-branch.h | 3 --- arch/x86/kernel/kprobes/opt.c | 40 +++++++++++----------------- arch/x86/kernel/vmlinux.lds.S | 4 +-- arch/x86/lib/retpoline.S | 4 +-- tools/perf/util/thread-stack.c | 4 +-- 5 files changed, 20 insertions(+), 35 deletions(-) -- 2.35.3