Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp214939pxb; Wed, 23 Mar 2022 16:38:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyihg7M+wOf9hvgOqtDQwAWNyftLp5k4P8pjOM88zZMHYZDgu/0WOOnJ9rfntopitmpBzhv X-Received: by 2002:a17:906:3a15:b0:6cf:ea4e:a1cc with SMTP id z21-20020a1709063a1500b006cfea4ea1ccmr2821417eje.753.1648078714976; Wed, 23 Mar 2022 16:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648078714; cv=none; d=google.com; s=arc-20160816; b=WLIXbDZacFyY2YwLUA+dFAQe0Y3F2dNW5RxG2mKnmV+STAZMvSnJTt3w9KUT/JvdSX domQoIKwUvPWDkgZndEpmJVlAkz0NjdRPI56CcKLuXXDlrkGa0IArXV5gXMjrtjlEo7D YZR/hbD7RXnY62ywvk6GuXtwz4CVEFqjqcR31wtqmSLmmdJI60SwlkmtUQYTLek/Drvt Ijx6dxJhQgEBuUgb5LoJp2jdSttPDqLtdZ7tM6CdtEYga3rMYSOLRb4ehWyI6RmvscuW RFBV9UC1JRm4UVk8BoAyY0y1m6h2HPSbL8JEeFTylfBQras8V/aYUTbUqaOo3GjAKHGE vAZA== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=GzhYsI6dclTsBX80mn2Lvu6Mx7WQY2Lp16xIKms2sZg=; b=dmp0FzMVDxULbV/fvAH4ueNnZdMfZqyECuBx/THOGs396uU1UPGm7+iFNAq5JlDzkH 6rVWGyIq7RW7E3/G7B1VZFAbdsm4jbeI17VuLAs83XRwE+fVD/PpEN5u9JKPGXbathvF 57fDviqK7sUTppT5sKpx1COWm54yxaDNmbxPYaKYOXcFEDjFm4jV643GnL93Md5EqM// AErdbTbufkF/SScnW7TxFZPV6ySShkjGDkjrezgmvWMNV+zQifBtBNcnkdT5yXlp6nfI lvm81pHoA9T0Ac413VHu3DakZbI5FuTgpgMivRSvYd/eKCq9+l3s/XNAQOn14AgS2Mq1 fY+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d9VXbx22; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a1709064d4d00b006df76385f1asi14170280ejv.954.2022.03.23.16.38.08; Wed, 23 Mar 2022 16:38:34 -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=@kernel.org header.s=k20201202 header.b=d9VXbx22; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241307AbiCWCg0 (ORCPT + 99 others); Tue, 22 Mar 2022 22:36:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230089AbiCWCgZ (ORCPT ); Tue, 22 Mar 2022 22:36:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E39670062; Tue, 22 Mar 2022 19:34:56 -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 ams.source.kernel.org (Postfix) with ESMTPS id 30AF2B81DD9; Wed, 23 Mar 2022 02:34:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA68EC340F2; Wed, 23 Mar 2022 02:34:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648002893; bh=cORONT9KFjGjK1waRa5byQPgHZgQsfuIcAEnv79p6NE=; h=From:To:Cc:Subject:Date:From; b=d9VXbx220K9vFoNmWvuXW0JejxOyab0sfAIx3GmPRVZpTuEN7wOmZ0DvrH6fvCL9X RYzvv9WeeMkVHqFHyWXcUfCe6adsb1Xxi8ujVPP+dWM9teAoI2CHqzeC0IkwiW0GiX Ld5j7PtMuy7FE/Ry2Klamn4ATqiF9O0xms8XB2a14UKr6gCDd7xsR4QcnBN3pouNQl rPwKTzwcQrT2I/Z5voYFHPuCpv2hyobBJfS1z1snnu+kRYloeeDEWx6XyqrPZw2nia eqVPddE4l9RdKvtedulD2jLD4CEcjza7qacDzJZtXFM5pYr7/qFz+MebFCVqT7gtjE lgFztLflsHRtQ== From: Masami Hiramatsu To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Peter Zijlstra Cc: Jiri Olsa , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Andrii Nakryiko , Masami Hiramatsu , netdev@vger.kernel.org, bpf@vger.kernel.org, lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Steven Rostedt , "Naveen N . Rao" , Anil S Keshavamurthy , "David S . Miller" Subject: [PATCH v13 bpf-next 0/1] fprobe: Introduce fprobe function entry/exit probe Date: Wed, 23 Mar 2022 11:34:46 +0900 Message-Id: <164800288611.1716332.7053663723617614668.stgit@devnote2> X-Mailer: git-send-email 2.25.1 User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.9 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 Hi, Here is the 13th version of rethook x86 port. This is developed for a part of fprobe series [1] for hooking function return. But since I forgot to send it to arch maintainers, that caused conflict with IBT and SLS mitigation series. Now I picked the x86 rethook part and send it to x86 maintainers to be reviewed. [1] https://lore.kernel.org/all/164735281449.1084943.12438881786173547153.stgit@devnote2/T/#u Note that this patch is still for the bpf-next since the rethook itself is on the bpf-next tree. But since this also uses the ANNOTATE_NOENDBR macro which has been introduced by IBT/ENDBR patch, to build this series you need to merge the tip/master branch with the bpf-next. (hopefully, it is rebased soon) The fprobe itself is for providing the function entry/exit probe with multiple probe point. The rethook is a sub-feature to hook the function return as same as kretprobe does. Eventually, I would like to replace the kretprobe's trampoline with this rethook. Thank you, --- Masami Hiramatsu (1): rethook: x86: Add rethook x86 implementation arch/x86/Kconfig | 1 arch/x86/include/asm/unwind.h | 8 ++- arch/x86/kernel/Makefile | 1 arch/x86/kernel/kprobes/common.h | 1 arch/x86/kernel/rethook.c | 121 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 arch/x86/kernel/rethook.c -- Masami Hiramatsu (Linaro)