Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp2415081lfu; Fri, 25 Mar 2022 00:15:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1IyOezp9mNyex8CmxihMDa9XMSQ/CQ+ze6faO2Aje8T3HMs8ZCXBiRM2N8DvZtAvToSW1 X-Received: by 2002:aa7:c1cd:0:b0:419:fdb:e17e with SMTP id d13-20020aa7c1cd000000b004190fdbe17emr11242839edp.364.1648192520950; Fri, 25 Mar 2022 00:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648192520; cv=none; d=google.com; s=arc-20160816; b=Y0ZOYbPaXxYs/YXKN1ZpiwsFz2hd2zdhiJl54V0jlrVxxB0phi/5oLz/HwRlnxn/hb NWUKpSlO5r7zQGML7uT1t8boylcHSCLKzuyBut3HQECeRc0w3tkNGNyZVzfPFnaqWVcN ut2/Lwu+IP+uQBMBPpg5p4Lo5UwEz0zTFOh9fKyB5+MI2sZ16p/j1jGMq3+vWZXfOFmn Ra8WNgmRPktb8/+7MyHWp9IJqVkc1WYjdtrnoijoHh/LZ7DGe4eedTAGrfw5nbhQu9Dk vagttTS8LLbc+gyp3+eMBFZd3HgO/5o1vZcWrp7PgfnWiMpA2FdZsiNwkb/ygX52WMZF SMdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=e8oRVZ23KjzG/ypngzxPfcRE3bvQPKD6JKIf9Qg0x6w=; b=fPT7ZFD3X4poTA0hdUQMtz/oUXiMa+5M5sRyXwbDlblDitUtmNbR1XoJQRhG3NmA7o fSkBYJu1/S9FmGtme/Bw/WtqmGE1ORRTtcCcj2KvRFTLLP9vV7E3Rn9h/+srHuomNPmR WUGwQAnwSZfgcnGqD6Z9iIvJyzJN2S/LdLY5z7/4we4aBi+5cq284AM6c0LCwcydOvJJ aYEhic3SHCgVo1j1BfdFMJzflzHsGfY7PeOcfnuFRn6y1huXVlIvmsZJuNK7sN4UbqkI ejswRWVfPCewpbeqUBLtpjAnpe1zbYka9yZ3OnhB33WxpucRge1x7lY/qfe+PV3VibHA Y4wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NLa+LKKC; 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=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h16-20020a056402095000b00418c2b5be7fsi1713583edz.353.2022.03.25.00.14.45; Fri, 25 Mar 2022 00:15:20 -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=@gmail.com header.s=20210112 header.b=NLa+LKKC; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357652AbiCYCF3 (ORCPT + 99 others); Thu, 24 Mar 2022 22:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237272AbiCYCF2 (ORCPT ); Thu, 24 Mar 2022 22:05:28 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A15AD6D1B9; Thu, 24 Mar 2022 19:03:55 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id k6so6612109plg.12; Thu, 24 Mar 2022 19:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e8oRVZ23KjzG/ypngzxPfcRE3bvQPKD6JKIf9Qg0x6w=; b=NLa+LKKCEYhiDLBTumzp8eZ2+tl8XDRYFgi2MPSiH9gd75ab5/pWG/yxu4T55oKqy6 /a4BLs4P0yXKPJBCZKf5yIMwJnr76H8hnEYYDD4EwqY3RZNwgIdb14BqJYkBsh6cYAXg pZ93xFc63IwBiDpYXIY5EMuzCDCb3f81o5RKFYH0fVrqpc8z4cfGHtcEio4i6Bidx+gf BI2QkGwd8h9zDoYb0+JL00ctWrimYIou0Wt7Gh3K/M/oXp7VneF0XqCanJsFi4rfSzza oD5uOLcDZemYA+CBf7dCg1h7/R1euOE7B6SiM0EI4FhXMzF5qV5PUTHuqcLck5tRPCmF xTpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e8oRVZ23KjzG/ypngzxPfcRE3bvQPKD6JKIf9Qg0x6w=; b=wulo8WGYHrQpOL03DI1XUk5EZRMSMG4WBhyAcjQeZsEv3Aon5tfm4BzrTWClfUrNFz 3lSU1L9uRrCTPeENvjeYsuAm+qi5T8PFvKhp4kS20h7FnRMQ7RC9sj4BnOwLw27SOBZe cPM+JvwQ/aBSE2Eyzu2eMLaEfnD6WRPHi4c1XkFHFN3aq2t+l/0oVWXlQob2Ey07wOLp w65Jntg2he7y4H7iGvubD93dOc31/BmetTjhWkGzyLUmHdYb1gywX6BirPQizV340Ylf 2bkJ/C8qWbTOKi45Ayp29HlBVKwOYQN0Vi9F2yvExiK9Zg+xyxc2qXAaqtXCIDAOKlWa DRnQ== X-Gm-Message-State: AOAM533RW71oi4eigTGFLzLrzMy0Sm9JQENXlCjc5TMA37BwlGTJUcFw QiJcIukOlgEWFuZK6IJQmfZ1aGx9r6EuYpMQTeg= X-Received: by 2002:a17:90b:4b45:b0:1c7:cc71:fdf7 with SMTP id mi5-20020a17090b4b4500b001c7cc71fdf7mr5156663pjb.33.1648173835008; Thu, 24 Mar 2022 19:03:55 -0700 (PDT) MIME-Version: 1.0 References: <164800288611.1716332.7053663723617614668.stgit@devnote2> <164800289923.1716332.9772144337267953560.stgit@devnote2> <20220323204119.1feac1af0a1d58b8e63acd5d@kernel.org> In-Reply-To: <20220323204119.1feac1af0a1d58b8e63acd5d@kernel.org> From: Alexei Starovoitov Date: Thu, 24 Mar 2022 19:03:43 -0700 Message-ID: Subject: Re: [PATCH v13 bpf-next 1/1] rethook: x86: Add rethook x86 implementation To: Masami Hiramatsu Cc: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , X86 ML , Jiri Olsa , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Andrii Nakryiko , Network Development , bpf , lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Steven Rostedt , "Naveen N . Rao" , Anil S Keshavamurthy , "David S . Miller" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Wed, Mar 23, 2022 at 4:41 AM Masami Hiramatsu wrote: > > On Wed, 23 Mar 2022 09:05:26 +0100 > Peter Zijlstra wrote: > > > On Wed, Mar 23, 2022 at 11:34:59AM +0900, Masami Hiramatsu wrote: > > > Add rethook for x86 implementation. Most of the code has been copied from > > > kretprobes on x86. > > > > Right; as said, I'm really unhappy with growing a carbon copy of this > > stuff instead of sharing. Can we *please* keep it a single instance? > > OK, then let me update the kprobe side too. > > > Them being basically indentical, it should be trivial to have > > CONFIG_KPROBE_ON_RETHOOK (or somesuch) and just share this. > > Yes, ideally it should use CONFIG_HAVE_RETHOOK since the rethook arch port > must be a copy of the kretprobe implementation. But for safety, I think > having CONFIG_KPROBE_ON_RETHOOK is a good idea until replacing all kretprobe > implementations. Masami, you're respinning this patch to combine arch_rethook_trampoline and __kretprobe_trampoline right?