Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1655563rdh; Mon, 25 Sep 2023 22:13:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4Q50G3+Nn4Ep6yfdJm7FOIsnGJhtUMM3zPaBrvoESXTMGNa84eKy/SaLvlnCqcEA5CYip X-Received: by 2002:a17:90a:728e:b0:268:b64b:f684 with SMTP id e14-20020a17090a728e00b00268b64bf684mr7797463pjg.33.1695705228708; Mon, 25 Sep 2023 22:13:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695705228; cv=none; d=google.com; s=arc-20160816; b=LOqL66bn6SS5fjMWW/KNxf/m5xhV5hj3bApftuBoitwnBNn40p9wlFMZOf18l3ameR uku600fTANrDN2vOr2/BSjVCCedAzZy+GUIpEQM21tKoq+D/nIiyOHRa08dMcRUGZvDm vLNuZAndzK95Lo8Xy+kbMz/L8buERBofjE6zzbyYqXBfLPs1hYvmAM7tzZtTqEzthFfd hjXbJl1SOpTTcwSR8ejlhvhb6b6ikxiR02OsBQSP9Q00ZdrFcqFijJQ4p1ArpyUIvFbD y+sB0L5givAuUd5W5cQYxponBtvjgh74YO0l+AurO8/cks9lIkTbBwd5/aSrT5xn/j4X kqUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=iM72w41jJ0uTcmpakwU36eusGXW9uEpXtWiPgSR0LzQ=; fh=gsf/yCR1rrH7cy+Zqef8snVukB+vkZzdazi8kU7uUuk=; b=IskrBdrEihhrivWb03gCgkvtjFz7pMU3O6mIhKHLCCKJHN4jWNf3na3RHNvYiVDY8Q RNyxBrd+7jYnAhTBSPmQgIDWfkxe5cu0Anzyt6ZsYN8k5MCJKUtvIxPt5Hw0izk3oD8J 32f55O/Oq7U9MVu0D2tkDY7WvEBRQlf7Zj+qQCd65FgU5dFquFx164ONLrr98A5Mv/09 qgKzCSP55V0V77hLP4P+EXDYJ8kalcPMKk1hxY0uGROqZ4lnIz1qeJvVKyFyo5qVs3HP SG567HrWNeg82/TSsCk86P/O6RAph8ebAMkeOHZuKkcuLGgZ8a50OCYwIlpgbTQ5J9JA f2Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LEiIUym7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id lo11-20020a170903434b00b001c38d1cd443si11809640plb.238.2023.09.25.22.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 22:13:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LEiIUym7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 199A1826651E; Mon, 25 Sep 2023 15:14:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230476AbjIYWOq (ORCPT + 99 others); Mon, 25 Sep 2023 18:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjIYWOp (ORCPT ); Mon, 25 Sep 2023 18:14:45 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C91EBC; Mon, 25 Sep 2023 15:14:38 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-502e7d66c1eso12096031e87.1; Mon, 25 Sep 2023 15:14:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695680076; x=1696284876; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=iM72w41jJ0uTcmpakwU36eusGXW9uEpXtWiPgSR0LzQ=; b=LEiIUym7FsC+YOEQVJzf7uTcUmJ2U2nOqOL6eDI7Ot+gtBculDvwbnp7izTY2LZa/w MbkOzDLPbaI49Xr8QBXOWBPhqI7BHvQvpWbFQ9n79oyylvWLqRbY2mx7k6dBnr+XvYbL mYEsnekwTVfNaaaO2X44+eRuXpy9d6VPg9SQGQf19R5qt7fD1sMHVo3pCe5wB7eFL2lK xpykcov5iNbZOUcVyaMJ5jz+okI+HQI80UjvTY0MzR0PpHDZn6Ep3RoF0BRmuIx8cqlE GRU9uTIozrsJVHubqI8AtZWioiVDOhyq0F2eSq5Cwmve4FQn9vC6WefYZ+a1z4WOnLud helA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695680076; x=1696284876; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iM72w41jJ0uTcmpakwU36eusGXW9uEpXtWiPgSR0LzQ=; b=UlyDTuCLvXpnkbtS9NtC4oDVbvFZscvdkTi4MYoCLen4vJ/KZmX1gvkDHYroNaLgGP ffERKAXTgFw/YlnBzBQ1D7UjnM0wiBPUNQoK5tJ194hehUEuU5H2Tet6wqLHqi5HB0YA SgbMznRfHt36uOjX5xBHrGzcPPta0r69LNpyDxmbS3U+EP8VM1n1cGhyXTW1qDLo/bD3 /61HZf5Sm/wwwAZTQNGMYZLCAFIkSJpTRTth9oYkEzlxTRhdNKSqimVInj4JbHz7LbrO 5+Lv+ZJKsliuBeSDA5hzecWH5CVhaaBzALE2MXUVuuWqXr9sUxzPqjY0Kz7tcei9LGT+ ucKA== X-Gm-Message-State: AOJu0YzfsxnVWqlX/uQmbM6qwyuzoe7o8R5UrdzNGNysYgHp8GsnZ5Q5 Hf1lhEtiR57BkgXGarmbiLE= X-Received: by 2002:a05:6512:b9b:b0:500:8c19:d8c6 with SMTP id b27-20020a0565120b9b00b005008c19d8c6mr7453171lfv.58.1695680076324; Mon, 25 Sep 2023 15:14:36 -0700 (PDT) Received: from krava ([83.240.61.244]) by smtp.gmail.com with ESMTPSA id e9-20020a50ec89000000b0052c9f1d3cfasm6005501edr.84.2023.09.25.15.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 15:14:35 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Tue, 26 Sep 2023 00:14:33 +0200 To: Masami Hiramatsu Cc: Jiri Olsa , Alexei Starovoitov , Steven Rostedt , Florent Revest , linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: Re: [PATCH v5 04/12] fprobe: Use ftrace_regs in fprobe entry handler Message-ID: References: <169556254640.146934.5654329452696494756.stgit@devnote2> <169556259571.146934.4558592076420704031.stgit@devnote2> <20230925211515.41d26a160c546c7bce08ac64@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230925211515.41d26a160c546c7bce08ac64@kernel.org> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 25 Sep 2023 15:14:53 -0700 (PDT) On Mon, Sep 25, 2023 at 09:15:15PM +0900, Masami Hiramatsu wrote: > Hi Jiri, > > On Mon, 25 Sep 2023 12:41:59 +0200 > Jiri Olsa wrote: > > > On Sun, Sep 24, 2023 at 10:36:36PM +0900, Masami Hiramatsu (Google) wrote: > > > From: Masami Hiramatsu (Google) > > > > > > This allows fprobes to be available with CONFIG_DYNAMIC_FTRACE_WITH_ARGS > > > instead of CONFIG_DYNAMIC_FTRACE_WITH_REGS, then we can enable fprobe > > > on arm64. > > > > > > Signed-off-by: Masami Hiramatsu (Google) > > > Acked-by: Florent Revest > > > > I was getting bpf selftests failures with this patchset and when > > bisecting I'm getting crash when running on top of this change > > Thanks for bisecting! > > > > > looks like it's missing some of the regs NULL checks added later? > > yeah, if the RIP (arch_rethook_prepare+0x0/0x30) is correct, > > void arch_rethook_prepare(struct rethook_node *rh, struct ftrace_regs *fregs, bool mcount) > > RSI (the 2nd argument) is NULL. This means fregs == NULL and caused the crash. > I think ftrace_get_regs(fregs) for the entry handler may return NULL. > > Ah, > > @@ -182,7 +182,7 @@ static void fprobe_init(struct fprobe *fp) > fp->ops.func = fprobe_kprobe_handler; > else > fp->ops.func = fprobe_handler; > - fp->ops.flags |= FTRACE_OPS_FL_SAVE_REGS; > + fp->ops.flags |= FTRACE_OPS_FL_SAVE_ARGS; > } > > static int fprobe_init_rethook(struct fprobe *fp, int num) > > This may cause the issue, it should keep REGS at this point (this must be done in > [9/12]). But after applying [9/12], it shouldn't be a problem... > > Let me check it again. that helped with the crash, I'll continue bisecting to find out where it breaks the tests thanks, jirka