Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1047108lqs; Fri, 14 Jun 2024 13:07:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBZC64DwhyJq5Prnfh3WfqDazGSohSrV29WKUSy9t+coOI22w4J1uE1eKvbajq6R6KJFsbm87itL/At5pNBxfa0vc/xaIJx6w18hqJbg== X-Google-Smtp-Source: AGHT+IH2AMD+o/Mu4Bt55rpYsfTKVq8kMIkaJDdsjzjj1x38QzAsyR/5GiRF5NT51Czvrk5bidMV X-Received: by 2002:a05:6808:1144:b0:3d3:5b25:e6b2 with SMTP id 5614622812f47-3d35b25f366mr1179437b6e.21.1718395663331; Fri, 14 Jun 2024 13:07:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718395663; cv=pass; d=google.com; s=arc-20160816; b=EpX0Sj/NeOxPsykc5hABne1C8w1scfunf8qBluB3gFCq8BLQGXl5UHnoR0ywVmEvTB mTc3A3rmNzF0V+VgvOSG1MZ3iF/UED2qWSzgGEY2DMpoD/H40iEeF4oW9wes0+yHSNL7 dJDlR8V2yhQlywix8is4kMcVAzM3PCRuFid2vltFnX+S+ynBrrTnIzbvRX/gKsM0K+z0 TiILtYPAv/QlOiVfH475hkU2BCd/SW0kWTCz8qVR69tmdN5mGMutuT+oXzv7B0XdK0/L eA5YhOm1ry85k6/gi8DxSvRRaVUNh5d5422mkii7/OFMeHVYS8bu+74ymQBc3f/vtB1j 6hDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8Yjs/ediObIN6nC8sVL9qgnNz/UKyIMKv1WyiB0wgJw=; fh=7AkS8VtRdyTBheh0JkJgm8QcJSXR9I7n2CwOCj+6gxg=; b=Jb5SmuXLpuybydvC6hrHnUgh5cIfhA2+Ci7Hlmo1KuZV++ZWDdKTrt1Kv3orB+Lxl8 QnBJ1c445HYcfUaLE8r114/pXkaZdQ2EuNMa9EybgjniABZuztx3Ju3YOkgtifDHAvXw xIq/JJnFzmIGe+lTaFTLZTx5UpG38FE0WCQ/DKOFcZGHMknhZzfSiDxNN1W1yqB5+Ep3 TJGU8a06P5L1Q1qLBS7ntHc2JdL0UVUblM7FfGY2fg4ybVP/M8O4HcoXwj+tH3eJR1bI 0AzzeLZ9yMHGwWZ2e9pEMIa71x6QO6mKtfG75UynGWz/f1aBRsanPiIEhnbZgvCHJ5d4 8g3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UZhA5TST; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-798aac9caf7si486962885a.133.2024.06.14.13.07.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 13:07:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UZhA5TST; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0E93E1C22984 for ; Fri, 14 Jun 2024 20:07:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 094B41A3BBC; Fri, 14 Jun 2024 20:07:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UZhA5TST" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16B11383; Fri, 14 Jun 2024 20:07:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718395653; cv=none; b=CkQ9fJkbB0cfZI3hIyMTwUEsT+43SN+bWni3jHCp3YV9TTSGSoLH0VyhfcDXsoXX/QfTar8/98mxnGkgE3PMyADRtEjM+rmwVgqeG8CEuWDqsMeZC2weR0OMIGRVNhsDKezcQJTDWM1FC5Q7/DbVRbb9U9bm3FB4+HdC9U9D3L8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718395653; c=relaxed/simple; bh=TLgK8xBlI7oOA+HqaXRUGCcZgq0Lk85TpQM6TQ5u5vE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gH2zv9FnV2CS9yEHimQSpjZCi4QouJkRkEFf14VOucO/3xDEwah7pZrH+d7xmoPoPTQm+P0Ya2r0dyOAJflLXEEufJIrVbQb050NxtKUTYmVWOULVtrf7mg87b+ZhQCvNlM6HIc7ROMY/6ohQZUXe9lzF/isD77tOG6znSROO4g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UZhA5TST; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 286B3C2BD10; Fri, 14 Jun 2024 20:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718395652; bh=TLgK8xBlI7oOA+HqaXRUGCcZgq0Lk85TpQM6TQ5u5vE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UZhA5TSTgrFRJ9dD/QT1sJgzGt5IJQ3Hcb3774r5mwGZYvh/ncQlMr12G/49O+ype woKnX70Axer069t3Z9L5exZ4HcTk/JxiG0Eb8RGIOGIsEtlmcW2eAMaHh4fjyMSkWb q6wBuNUF0k8Z/k+R0lQaFNhZ+37igEYeTZJcUR6xOC8Bdl2VqDl3GM+ptzECnNRb0I iKLXF6C9qJQDnwCgpsAGlTHRyfsP5gK2JP5rtTGYiq2raFrsq2vMMWWOJcMVxnE2wD dgQW2njMxCFVpGMA8A/dXKzSja2vd0kgSJTTX+4fmQimKe1AdetaN2pC8zpqLDuVev +f/LKzF10mpgw== Date: Fri, 14 Jun 2024 13:07:29 -0700 From: Nathan Chancellor To: Jiri Olsa Cc: Steven Rostedt , Masami Hiramatsu , Oleg Nesterov , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org, x86@kernel.org, bpf@vger.kernel.org, Song Liu , Yonghong Song , John Fastabend , Peter Zijlstra , Thomas Gleixner , "Borislav Petkov (AMD)" , Ingo Molnar , Andy Lutomirski , "Edgecombe, Rick P" , Deepak Gupta , Huacai Chen , loongarch@lists.linux.dev Subject: Re: [PATCHv8 bpf-next 3/9] uprobe: Add uretprobe syscall to speed up return probe Message-ID: <20240614200729.GA1585004@thelio-3990X> References: <20240611112158.40795-1-jolsa@kernel.org> <20240611112158.40795-4-jolsa@kernel.org> <20240614174822.GA1185149@thelio-3990X> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jun 14, 2024 at 09:26:59PM +0200, Jiri Olsa wrote: > On Fri, Jun 14, 2024 at 10:48:22AM -0700, Nathan Chancellor wrote: > > Hi Jiri, > > > > On Tue, Jun 11, 2024 at 01:21:52PM +0200, Jiri Olsa wrote: > > > Adding uretprobe syscall instead of trap to speed up return probe. > > ... > > > diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c > > > index 2c83ba776fc7..2816e65729ac 100644 > > > --- a/kernel/events/uprobes.c > > > +++ b/kernel/events/uprobes.c > > > @@ -1474,11 +1474,20 @@ static int xol_add_vma(struct mm_struct *mm, struct xol_area *area) > > > return ret; > > > } > > > > > > +void * __weak arch_uprobe_trampoline(unsigned long *psize) > > > +{ > > > + static uprobe_opcode_t insn = UPROBE_SWBP_INSN; > > > > This change as commit ff474a78cef5 ("uprobe: Add uretprobe syscall to > > speed up return probe") in -next causes the following build error for > > ARCH=loongarch allmodconfig: > > > > In file included from include/linux/uprobes.h:49, > > from include/linux/mm_types.h:16, > > from include/linux/mmzone.h:22, > > from include/linux/gfp.h:7, > > from include/linux/xarray.h:16, > > from include/linux/list_lru.h:14, > > from include/linux/fs.h:13, > > from include/linux/highmem.h:5, > > from kernel/events/uprobes.c:13: > > kernel/events/uprobes.c: In function 'arch_uprobe_trampoline': > > arch/loongarch/include/asm/uprobes.h:12:33: error: initializer element is not constant > > 12 | #define UPROBE_SWBP_INSN larch_insn_gen_break(BRK_UPROBE_BP) > > | ^~~~~~~~~~~~~~~~~~~~ > > kernel/events/uprobes.c:1479:39: note: in expansion of macro 'UPROBE_SWBP_INSN' > > 1479 | static uprobe_opcode_t insn = UPROBE_SWBP_INSN; > > reproduced, could you please try the change below Yeah, that fixes the issue for me. Tested-by: Nathan Chancellor # build > --- > diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c > index 2816e65729ac..6986bd993702 100644 > --- a/kernel/events/uprobes.c > +++ b/kernel/events/uprobes.c > @@ -1476,8 +1476,9 @@ static int xol_add_vma(struct mm_struct *mm, struct xol_area *area) > > void * __weak arch_uprobe_trampoline(unsigned long *psize) > { > - static uprobe_opcode_t insn = UPROBE_SWBP_INSN; > + static uprobe_opcode_t insn; > > + insn = insn ?: UPROBE_SWBP_INSN; > *psize = UPROBE_SWBP_INSN_SIZE; > return &insn; > }