From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796308939; b=CQeRQCeUdoPh/P/GqAt+4BnPOebckMTLznRN/t3h/fusKEyPxi1w4R098ImRAoiW0Keu JfJ1JwT4GtPBUdHPvMoDG5Q1fIa0eJgoNLf1hQqF+7JiIIAeX0dPyWyyPpOmfbITYNkAy bod5STM0Aco3SK92ZieM67Q3DThbSQ6U0C0xq01wcQ5Y9S9rOYgJpDi1Ek5/uGbS7fe1X SoKaQ6EfttYKM6gCnOzM3IxJojhzz2ihg84hcgD8z5E88fS52jmNQvOzM/0gAAZsG/+97 YmDFALasubzMZc3Hx+UTbz211PUao9m12qpERTbLD8a6avOnrlztmP+yDSSppSU+ZsQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796308939; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:X-Google-Original-From:Date:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=B7daROZFgvZiIrD6grSXP69NCEyTx5NAtFYAiBy51BE=; b=Yc569Sprz+XPHnJI5hHfbiSTiagiDFDk6KoiaeYED7H+7gPUn2ki0furji3WPcVBmMmQ qDS2KRtPjy1f6YBsiLnaKd9HxAZdbK/WY68YCJuLSbo72FB8sotRfqVxdDrQcpaW30iAv CtdK5OOm1OgibKTyrSANwrXWuZ4xQruJM6eX9Hb9ESahniC8HjgaXUwEqqiqg7wmwzxDI qKJWPXik/LWMhCFtQ5gsHdJ9k3sXj9e6YI055r6EPuW+d4rEf7puZA9jhSBzoLS8YimoY ePsKWKB9FkHIbvV/womb+CGmXQ5cKazu5aoruKJXUjNs6OGCPxbTGeMbY7lsr5GHiAg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=odQSlOO5; arc=none smtp.remote-ip=209.85.128.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E80F9606A32C for ; Thu, 3 Dec 2026 14:42:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E80F9606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=odQSlOO5 Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4bba60271d7so80453515e9.2 for ; Thu, 03 Dec 2026 06:42:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796308937; x=1796913737; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:date:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=B7daROZFgvZiIrD6grSXP69NCEyTx5NAtFYAiBy51BE=; b=odQSlOO5/S+0LGPtJa4JSvlZrG+reGHj3s9QHBCeOIv3j2gm62U3jdZEYeNBHDQDT9 Gg4mpXpe7+BTn0QAljfBlG3TU7YoTJiKKXHn4hIvIcHdUKB0My0rEuWPR8wl4kLB1SuH YJjC062meMKYu/OM3hWJP6bJlMIBU84S8iLBgKkIYCDy7dXkqcfSi8jPH04iwbiUQMfF Cl6s8n9Kf0J1mpTFabJU5AD7Fi7paET/z8UXk12B4uaAEieQtg/fed3pu3PpJMhOM0wP PbtcGCNqYOrVhTg+M5DnHpzI43W9PHJk/jzLZ3RkRz/1FfZ/3a+97qZe0+nKeTMmCx9H hM1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796308937; x=1796913737; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=B7daROZFgvZiIrD6grSXP69NCEyTx5NAtFYAiBy51BE=; b=27pTPcfJYJk7h7WWN1HWs5L7OFB4w+hc4ZIEyGOMLKi7FhB107ymL+hHMX9yh3S7l7 SdFBEgc/CqU26M7JGq9vwboEWPygWTFao5qytqr0BMYk8I8o6dMd/rU2jpESjnc5VmYJ BXeGJ5agLwUEaFaKrbS3nOWiXdT6S0ysX8YVo2p5+MGFnT/PSXf23tEndTq3LJZyA6x6 Pk936bniksK2pGsEbcdPx8GnGbOih3P1sdayiYHX19O8j4HnhbB4/rPDa2DAAaixTtz3 Dg585VdXEEuA2LQNThzi57kAGwM4QIF98okKcv7SkCyJOYvt/Bf6r/bmAQ5lZcpeoKVk N5OQ== X-Forwarded-Encrypted: i=1; AL+hErEWjd0foiK/tyWHD3W/nFXVgJcIVFMqdveHmY04URnAJkispbmcVcrtg27/THG6YkMR22uhROshVsD14yQ=@vger.kernel.org X-Gm-Message-State: APuU4Z+ER+xrawnm1iZoqokWFP0KSjq0H6cxkNRz1WaoDxYh/Nu6yUUd Jpm9Q8weox9FSH3ghNsWI7Fsxy69gONuHyuGAC/IjrB89Yv/dLgLRfv3 X-Gm-Gg: AZFdTZezgUlkMN+iKtHK8JQb07PcFtOxzwrZWx96eEKvg6+TlOlAKvAwaSvFN2TTxe2 pHvqBXcOVKarEzkJtrwzRxy+BXzKMd1nZ0itwpDjnAZ17y+zgyoURhETKZOL895L1fPuaVwVYqA GL6cNPFqNbrMjrSC/XztLCy8BNj5ccpjJAyubzkPbRVfF60fEUp3poaNTidLQz8d9zZNIMRiH5O OW0bRyQX3ZTviEeFF05FIip2H//mj4KnT0GPme7583WKqNTdZePoYp32xebBNcKAvAFedKdF6/q pFjXiMZbpXb8Q55WhR3TqXpg1YN+XJjnKntD0Qw9Zf24yHetXbbAdnHdsQ85OGOjn+2XTDOecbY sXxwipVW6FoGskWPp0YE4MbezH1uMdgbkG97qGaFQB2fquRepl/QkWM2xFQvNz+LpEwg5chmd19 RogUF7QON5KQmY0fkApy4cUxE2krD1/N8rAWUHklaLkK0hUf2VDukETFLZNIvGW2xpU6NAaUucv pInpGcrrDzzgX/m+I2VXf35C/FHMeJwwpwrDvOFh2fr4220UQ0bZKDYiSHyk6WwPSfLEhk36oVZ X-Received: by 2002:a05:600c:848d:b0:4bb:6687:5386 with SMTP id 5b1f17b1804b1-4bb8880c7f1mr905781005e9.19.1796308937157; Thu, 03 Dec 2026 06:42:17 -0800 (PST) Received: from krava ([2a02:8308:a00c:e200::25dc]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb906635c7sm824549455e9.2.2026.12.03.06.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 06:42:16 -0800 (PST) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Thu, 3 Dec 2026 15:42:14 +0100 To: Alexei Starovoitov Cc: Daniel Borkmann , Andrii Nakryiko , Masami Hiramatsu , bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Song Liu , Yonghong Song , Quentin Monnet , Alan Maguire Subject: Re: [PATCH RFC bpf-next 15/31] bpf: Add get_func_arg[_cnt] support for kprobe multi functions Message-ID: References: <20261202123035.10335-1-jolsa@kernel.org> <20261202123035.10335-16-jolsa@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Dec 03, 2026 at 01:53:11AM +0000, Alexei Starovoitov wrote: > On Wed, Dec 02, 2026 at 04:30 AM Jiri Olsa wrote: > > + cnt = kprobe_multi_entry_args_cnt(run_ctx); > > + if (cnt < 0) > > + return cnt; > > + if (n >= cnt) > > + return -EINVAL; > > + *value = ftrace_regs_get_argument(run_ctx->fregs, n); > > cnt is the number of args, but n selects a register. > They differ when a struct takes two registers. sockptr_t has 16 bytes: > > sk_setsockopt(sk, level, optname, sockptr_t optval, optlen) > rdi rsi rdx rcx:r8 r9 > > n fentry entry, this patch inlined, patch 16 > - ----------- ----------------- ----------------- > 3 optval, rcx optval, rcx -EOPNOTSUPP > 4 optval, r8 optval, r8 optlen > 5 optlen -EINVAL -EINVAL > > optlen can't be read at the entry. > The same prog gets a different arg for n == 4 at an inlined instance. > Should n mean the same as in fentry? > right, it should.. helpers go away with the addrs[] change, but the arg specs have the same problem, user space would need its own copy of bpf_jit_place_args with the arch tables to get the slots right hum, I need to check more, but I wonder if we should keep the bpf_get_func_arg helpers in the kernel after all.. it's a lot of complicated code for user space tracer, while kernel can reuse what fentry already has thanks, jirka