From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 9D9177FD; Fri, 6 Jun 2025 07:46:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749195969; cv=none; b=eivzPudLjAH+J1MKnD8/S1ehzccLES+whzAZb6gjUWAyi0+D5mE/gN8AgVAfPxWtiUf7GyQIarifMksYyrwLNIWGLnZTuSk7bNWirPDmclr/7/vKFIT4Ko6lP4yANvDR4v0Y8P8iR14dhVXY+HdjwT94N+rMmAOZQNPUMVIfVtg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749195969; c=relaxed/simple; bh=IEkQc1BcGqv1X56aDpUHvaulzc1YvNTUmrX5u2YHMKA=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=mnYLa+95DkpOdHLKhfU0gjbNmOhw+2BH+mn440O7GY6Yy9QxWDLdiIvJeZelH4ERZbbP+qfwkC1mwEM33/xNZNWKsynYEBum80scZZCDrymm62cJfJ9KHSm0PY/soe8VXWgn9Pigty6DVhJO+PxliRV/CRk6v/i63Eg3MOGGoyQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=FbcBo+GO; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="FbcBo+GO" Received: by mail.gandi.net (Postfix) with ESMTPSA id 3B90F442AE; Fri, 6 Jun 2025 07:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1749195958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2+a4tmR/A6ANRwQiGU6A/fzxxPhMQUHBWtsMGAxzq3M=; b=FbcBo+GO49Gf4nun+ACzzLWBd7hkcSEKiitgBAVSvqrZiijkTwKBI0uSbwLisokMQt1oD+ qDpcmFva4f3cqTdmgZTVwjY61/BXc4vuqQM3UzFLSJA5BHlVsHBzlkMa9vTg4KcETJp+sN yJ66JPB2utPtj9hgCyWKd57/wxZ5BfRrnZsHixXZxwynbcCfBEycAPgZefFV2OAm0YTuas 03uBMg5uX+ZbI/KYG2jwsizN8uEb5UQkZOnTwidlDSIdxRgZlDTKmOukYH8rdpD319jPgf pGQzZuy3BZ0YrMvdehF+RGesgL2H5RIPdqFTxOZoAKNvQrWWKZLxSK8NJxAAGQ== Precedence: bulk X-Mailing-List: dwarves@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 06 Jun 2025 09:45:51 +0200 Message-Id: Cc: "Ihor Solodrai" , "Andrii Nakryiko" , "Alexei Starovoitov" , "Daniel Borkmann" , "John Fastabend" , "Andrii Nakryiko" , "Martin KaFai Lau" , "Eduard Zingerman" , "Song Liu" , "Yonghong Song" , "KP Singh" , "Stanislav Fomichev" , "Hao Luo" , "Jiri Olsa" , "Puranjay Mohan" , "Xu Kuohai" , "Catalin Marinas" , "Will Deacon" , "Mykola Lysenko" , "Shuah Khan" , "Maxime Coquelin" , "Alexandre Torgue" , "Florent Revest" , "Bastien Curutchet" , , "Thomas Petazzoni" , "bpf" , "LKML" , "linux-arm-kernel" , "open list:KERNEL SELFTEST FRAMEWORK" , , Subject: Re: [Question] attributes encoding in BTF From: =?utf-8?q?Alexis_Lothor=C3=A9?= To: "Alexei Starovoitov" X-Mailer: aerc 0.20.1-0-g2ecb8770224a References: <20250411-many_args_arm64-v1-0-0a32fe72339e@bootlin.com> <20250411-many_args_arm64-v1-1-0a32fe72339e@bootlin.com> <9a2ba0ad-b34d-42f8-89a6-d9a44f007bdc@linux.dev> In-Reply-To: X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdegjeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpegggfgtfffkvefuhffvofhfjgesthhqredtredtjeenucfhrhhomheptehlvgigihhsucfnohhthhhorhoruceorghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelkeehiefhfeehvefhtdegueelkeehffffffeuvdekkeekuddvueeguefgieeukeenucffohhmrghinhepsghoohhtlhhinhdrtghomhenucfkphepvdduvddruddthedrudehtddrvdehvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvuddvrddutdehrdduhedtrddvhedvpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepfeefpdhrtghpthhtoheprghlvgigvghirdhsthgrrhhovhhoihhtohhvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepihhhohhrrdhsohhlohgurhgriheslhhinhhugidruggvvhdprhgtphhtthhopegrnhgurhhiihdrnhgrkhhrhihikhhosehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghstheskhgvrhhnvghlrdhorhhgpdhrt ghpthhtohepuggrnhhivghlsehiohhgvggrrhgsohigrdhnvghtpdhrtghpthhtohepjhhohhhnrdhfrghsthgrsggvnhgusehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghnughrihhisehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrghrthhinhdrlhgruheslhhinhhugidruggvvh X-GND-Sasl: alexis.lothore@bootlin.com Hi Alexei, On Thu Jun 5, 2025 at 6:09 PM CEST, Alexei Starovoitov wrote: > On Thu, Jun 5, 2025 at 12:35=E2=80=AFAM Alexis Lothor=C3=A9 > wrote: >> >> Hi Ihor, >> >> On Wed Jun 4, 2025 at 7:31 PM CEST, Ihor Solodrai wrote: >> > On 6/4/25 2:02 AM, Alexis Lothor=C3=83=C2=A9 wrote: [...] >> Thanks for the details ! I have missed this possibility, as I have been >> assuming that DWARF info was exposing the needed info. I'll take a look = at >> it, but if those attributes can not be represented by DWARF, I'll have t= o >> find another way of getting those packing/alignment modifications on dat= a >> type (eg: re-use/share btf__align_of from libbpf, as suggested by Andrii= , >> but it may not able to cover all cases). > > Not sure all the trouble is worth it. > I feel it's a corner case. Something we don't need to fix. TBH I don't own any specific use case really needing this handling, so if it does not feel worth the trouble, I'm fine with not trying to support this. My effort is rather motivated by the goal of aligning the ARM64 features with other platform, and so of getting rid of tools/testing/selftests/bpf/DENYLIST.aarch64. For the record, this effort also showed that the same kind of issue affects other platforms already supporting many args + structs passed by value ([1]= ) - structs alignment with specific alignment constraints are not specifically handled (eg: a struct with an __int128 as a top-level member, leading to a 16 byte alignment requirement) - packing and custom alignment is not handled >From there, I could do two different things: 1. do nothing, keep ARM64 as-is with the current version which has been recently merged: ARM64 then denies attachment to any function trying to pass a struct by value on stack. We keep the tracing_struct tests denied for ARM64. Other platforms still allow to attach such functions, but may be parsing wrongly arguments in those specific cases. 2. add the constraint applied on ARM64 (refusing attachment when structs ar= e passed through stack) to other JIT compilers. Then update the tracing_struct test to ensure this specific case is properly denied on all platforms to avoid risking reading wrongly arguments passed through stack when structs or large types are involved. I tend to think 2. is better, but let me know if you have a different opinion here. Thanks, Alexis --=20 Alexis Lothor=C3=A9, Bootlin Embedded Linux and Kernel engineering https://bootlin.com