Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1010824pxj; Thu, 17 Jun 2021 20:06:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxID4amW7j5a7/k8pEIJvXTWcZF5jMNZU7YAjWHHF4j7A+dqRwHqdvF6adsOZaTljfIXFir X-Received: by 2002:a17:906:b34e:: with SMTP id cd14mr8673064ejb.69.1623985573723; Thu, 17 Jun 2021 20:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623985573; cv=none; d=google.com; s=arc-20160816; b=cg1hAsPd5deLF2WHUANRFt++i1hnCe1EsBLY1JK297rczcknfPiL8CazGDXtPIrnq4 1anMcOjPrQmrQbZmvezUFNblh1jrfDqwb2S3cx5+PWFYdlcmo6XN4B7SKRihhfkc056Q Ukcvt2jcEuOt4A42ROnAkgsfrkdZBqG0l7968zKVCG7O+31uwpiM3w84g71AX1U/Uz+2 zCq4df/QiUObeoV/wSDmATLiaGoCOLce05yvPh1LHcvHhr0NvWkVAOfF5f3JDPHbrbrK WuL3N5kgTcnx+Erj3NkCUis4pWctQ9gJPcnIzzRJvnPGzUx1a9gPCcWesVjSJF7pev2b AnQA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=UNx3nffSJh7J2G/+ZdCpTJZgUet6JhXDrWAixJyDvHM=; b=UYVCJYgKg+t+1io/IQUVuYl5hLXTOc543lMcYBiQ2cGz6AWyZU4gi6+X9AUPilsTQx 1hHtU05XtKQpbqKK4SjNN6X1WBtCHtNb8VxZZRNhhMBaJyoqq7D5/YACBveHAcgFgn4w IXtIQR996DTagSGc63j1hTupvdjZUjeYzikC+k6r7tOqxOPsqaGSB3ckjqpIH7A8wq0l AGxIlySqIuOWlHn7N9zZBRs81AqeS7MheHFn0coaxJe2Fk0WvDlpwSAPblcEzeWV4MZ5 Nt7mD8Md4PLmoR8YMT/WYFDQA9w5EScIbcmGkeXG9FfDTBtDJZH8jLhfo+/3GsN54Tk5 K7kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uR+jaHbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g24si7486595edy.490.2021.06.17.20.05.50; Thu, 17 Jun 2021 20:06:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uR+jaHbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232059AbhFRAAZ (ORCPT + 99 others); Thu, 17 Jun 2021 20:00:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:56514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbhFRAAY (ORCPT ); Thu, 17 Jun 2021 20:00:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A98C361019; Thu, 17 Jun 2021 23:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623974295; bh=M0lRaJht8iOxf3cY0Le5dA8WTI73qlYLqx7cmUga8cA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uR+jaHbIFOiP1N1bZF91AcJpKpoCLDh5MS+QwS/B6V7VL35kk1fLu0yhGmOKnsWdy A1RQixbBMPj2iJ4h73eZxwlBAKoD4WsU02kq8ukkU8Xm4SrCXTnoEXbiZF1j0U+jmP eOEvxHg6q/FC2i4rfbDFvIdvio5KoG+GmfPiW5Zlur4sPjclnPN/0enES53byckVPu hoshuo/aK5nClbdKYjTRISgQtPSLtGaWrKtj22p6fL0DnskhbQd2xvYQDErkLQ+1u2 V7ztTkspcRI1irecm9DgT+IdU7NlUdAdgjfZIqQtALLm7DQuQJDjtilHTTBCcib8mS 3WiLp4wBEWf6g== Date: Fri, 18 Jun 2021 08:58:11 +0900 From: Masami Hiramatsu To: Josh Poimboeuf Cc: Andrii Nakryiko , Masami Hiramatsu , Steven Rostedt , Ingo Molnar , X86 ML , Daniel Xu , open list , bpf , Jakub Kicinski , Ingo Molnar , Alexei Starovoitov , Thomas Gleixner , Kernel Team , Yonghong Song , linux-ia64@vger.kernel.org, Abhishek Sagar Subject: Re: [PATCH -tip v7 09/13] kprobes: Setup instruction pointer in __kretprobe_trampoline_handler Message-Id: <20210618085811.19f0a7b8c1e91d54483ba9f8@kernel.org> In-Reply-To: <20210617182159.ka227nkmhe4yu2de@treble> References: <162209754288.436794.3904335049560916855.stgit@devnote2> <162209762943.436794.874947392889792501.stgit@devnote2> <20210617043909.fgu2lhnkxflmy5mk@treble> <20210617044032.txng4enhiduacvt6@treble> <20210617234001.54cd2ff60410ff82a39a2020@kernel.org> <20210618000239.f95de17418beae6d84ce783d@kernel.org> <20210617182159.ka227nkmhe4yu2de@treble> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 17 Jun 2021 13:21:59 -0500 Josh Poimboeuf wrote: > On Thu, Jun 17, 2021 at 10:45:41AM -0700, Andrii Nakryiko wrote: > > > > > > I know I suggested this patch, but I believe it would only be useful in > > > > > > combination with the use of UNWIND_HINT_REGS in SAVE_REGS_STRING. But I > > > > > > think that would be tricky to pull off correctly. Instead, we have > > > > > > UNWIND_HINT_FUNC, which is working fine. > > > > > > > > > > > > So I'd suggest dropping this patch, as the unwinder isn't actually > > > > > > reading regs->ip after all. > > > > > > > > > > ... and I guess this means patches 6-8 are no longer necessary. > > > > > > > > OK, I also confirmed that dropping those patche does not make any change > > > > on the stacktrace. > > > > Let me update the series without those. > > > > > > Oops, Andrii, can you also test the kernel without this patch? > > > (you don't need to drop patch 6-8) > > > > Hi Masami, > > > > Dropping this patch and leaving all the other in place breaks stack > > traces from kretprobes for BPF. I double checked with and without this > > patch. Without this patch we are back to having broken stack traces. I > > see either > > > > kretprobe_trampoline+0x0 > > > > or > > > > ftrace_trampoline+0xc8 > > kretprobe_trampoline+0x0 Thanks for confirmation. > > > > Is there any problem if you leave this patch as is? > > Hm, I must be missing something then. The patch is probably fine to > keep, we just may need to improve the commit log so that it makes sense > to me. Yeah, I need to update the commit message so that this will help the stacktrace from kretprobe's pt_regs, which will be used in bpf. Thank you! > > Which unwinder are you using (CONFIG_UNWINDER_*)? > > -- > Josh > -- Masami Hiramatsu