Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2092150pxb; Fri, 25 Mar 2022 10:57:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf/PCiCrYKFD+RBoTKB28cMgbIX6CZMQpD4HHegOQft/wgIr1hCbSA8dKbyi2QTKTDpC36 X-Received: by 2002:a17:90b:1b4e:b0:1c6:fff4:34dc with SMTP id nv14-20020a17090b1b4e00b001c6fff434dcmr25956915pjb.76.1648231042570; Fri, 25 Mar 2022 10:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648231042; cv=none; d=google.com; s=arc-20160816; b=Iv9R1cSfjzPIqu8C/EEkBgT8dFhOzse30Axn7oMEX82M0GsFLwBeNL8VVmDUbOO0+6 vjUi3Tv3Hz2ELeKkl5FY1SbafMXfQualZmmLp9O1ZGmhBNxK3RyAfeH5j2TigRKOXqz4 Goz1eFYf3XhIETFVGZvt0nD7h7lybHrbgz6HBjq/67uxe2S/RQS/faStCNJanlJDvVbj GmyUY17YXe1ddC33RR6tAV3nmCpsmwa3rL/pPR8y4JUiSMesE7e5rd4J6OIOt/hDuv4x LIXLyRhz/ft/m5X36HqaBcmPQ66nk+2POte9RMPUAjLSzcyutY8MtNnC3bjurIcVat+A PPWA== 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=YhbHvKOe3R9wr4WqHvvvMBja08hCbQeffvIT8N9J4tY=; b=n/mgWYCiQ/waMfAl3ZGLGeec4JN9UQzYsnr5/CDjKKx8lnyOfZAZZCL1n02odpq2KA RTSHVR8d6qtCb2b9Xl8Nr/ocdAJgbjjIarVmqFHCDvPQKS5LF19riApLqKYboiok3yGX mLtqD58v3sBJm0ixutN456opIkvDK/OHKIUFiRwl/Yp5nYYE+W9wUEzxPOZwh0xl4e3Q cPW+MVeq5QPPDnX+iZEnadm1Y69XdtR6+pAb6gSHtOi3zxzODG2sS6CUfhZx7yeITi8m OOpn4ZRtJLzNGxGznRsDY2pfLYRdo4HRn16ko1VPF8bzF3lYjpneJBouNenE7b2oU8jz rHxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lSD69GpG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k10-20020a170902760a00b00153b2d16475si2906707pll.125.2022.03.25.10.57.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 10:57:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lSD69GpG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 01CC610EC48; Fri, 25 Mar 2022 10:36:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354337AbiCYCmr (ORCPT + 99 others); Thu, 24 Mar 2022 22:42:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232525AbiCYCmp (ORCPT ); Thu, 24 Mar 2022 22:42:45 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC69186E35; Thu, 24 Mar 2022 19:41:12 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id jx9so6333671pjb.5; Thu, 24 Mar 2022 19:41:12 -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=YhbHvKOe3R9wr4WqHvvvMBja08hCbQeffvIT8N9J4tY=; b=lSD69GpG3fScXZeIiFhxLUpG7zr6II06PDD3LiZ/yFNZpViixqk1oVGH+ZIv9YsmFF JuD0HVFNEkKEKGmFjXBEHItS29+7VHjlEpcZHBbR35jvTZFNQ9q+ohKHhbAAU4hOZs1u esCibAlKYdQDmXnnGixMs07Ow6L8iVgfqAzon9mdbzl11CpCR8deFFfotcFePhlTELFY M97urpuWR79ToiJ4Ni6RaX1ezlCJp5vhp4aowfkBgT3tvDFAdCskFtxT72gGy9+WTi/Q Zslw1aCnM9yovxGWFx3pEr23MOknGo8M7r4pHYgiR9RGy+ALNpYQXL+sX1A9KCZlDMRN Xvnw== 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=YhbHvKOe3R9wr4WqHvvvMBja08hCbQeffvIT8N9J4tY=; b=TZ+JuPG/17QaPc0MiWt91R4apW4ijXneVC1tSfLa6AhzT3lDI/rLA5V2M3dvUBH/V1 WTs5jhyNEB/lbNYkSHA98PUvYE+/ss7ZYt7R5PO/sRkZ2asv3Grqav3qta8Tr/CAuouf UJYYs+223F6xl0tld8KETVYq+UDoRHBziDOkpq/8qIvOIvO5Od80AgUei/hXhYx11or+ ArwVBgOQQ4OuU+DIVV3jIgJkKz32a2MHD16/gBuBPSl4t9V+WgboDjCjZUV5KBCqg0j5 jGrNh49YOWyqIy5ZTTWX1NVuZdePVJaR96J2rkGqZC3BhaTgNlY1LXLLthQcD+azHuwE eSMg== X-Gm-Message-State: AOAM533G39ZFTAsN/nZoFV68jumivdQSG3oM56mf5wgYT/HoceY2yJd5 ZaJ4wRmBr7v3lo61NH3W4VEswJlGLaRko1romUA= X-Received: by 2002:a17:90b:1a81:b0:1bc:c3e5:27b2 with SMTP id ng1-20020a17090b1a8100b001bcc3e527b2mr21991347pjb.20.1648176072202; Thu, 24 Mar 2022 19:41:12 -0700 (PDT) MIME-Version: 1.0 References: <164800288611.1716332.7053663723617614668.stgit@devnote2> <164800289923.1716332.9772144337267953560.stgit@devnote2> <20220323204119.1feac1af0a1d58b8e63acd5d@kernel.org> <20220325112114.4604291a58ee5b214ee334da@kernel.org> In-Reply-To: <20220325112114.4604291a58ee5b214ee334da@kernel.org> From: Alexei Starovoitov Date: Thu, 24 Mar 2022 19:41:01 -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=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Mar 24, 2022 at 7:21 PM Masami Hiramatsu wrote: > > On Thu, 24 Mar 2022 19:03:43 -0700 > Alexei Starovoitov wrote: > > > 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? > > Yes, let me send the first patch set (for x86 at first). great > BTW, can you review these 2 patches? These are only for the fprobes, > so it can be picked to bpf-next. > > https://lore.kernel.org/all/164802091567.1732982.1242854551611267542.stgit@devnote2/T/#u Yes. They look good. Will push them soon.