From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796485860; b=YDuxNlaWqVZx95Jj0mbbtzRS9TUPD7QVgbXhJMQULFbid9meNdWWR4NUPlXsUp/I3Ybr 69HZh8TDdOgjF0REuwR+TbJpGAXrMFx438yuFN6JTGc06zRkStZB2jSetJOMl1hrRMunE AHUBB8TTIHiHwViUEegf3N+rhNIoSD75W5g4pfveO0jUrUUs2SS/Pnuy7MvXG5WLyBnbc ZfV7HxoeHCBDSLLyhgT61LclmvkIlSKGfZZnIlR0b5Ptk5zwe/UltaYLYv8Xtl28X9XFM OEc9wGV9Lep8Y66J47vBxiHlzFyHnKQjOi4fTfW01eLRkw8U1nv68TF4g4O0O+Vkduw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796485860; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent:To: Cc:References:Subject:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=7f1RMgHD+CuoUqpjg3Ef5Cng19pNd1JGogv4gaiM/PU=; b=ZeKsvzVQsM9FQ6gk8Z2JXwP8OtuTIpI7274kxdbMh8iYLdQVHoBcxBgvG77lYEy89Ekr ku3G03sr8BtS1Z72CneZrqIYisp8Oc37a/8eVTw2B5qXaKMbGkWMLuOvrOsdhMNAYmdRp KJvxehNLv+8AlmQidglzr4YAoZGtU8N2Xju3WMfa2AMM1SbAjkbpuheicpkCySZWK+9sw 9uWo6ptd0nFDUf6gtqvFQSiXhOamHKYNXNTJ1uIPsMpJiYcqWWHON84wxtr6/7chv3diB SpGAjUGdOAZbCOudI7iGSi12qLLoWik24oY4CnpP424UgQeybpGcHpb0DN3WPr2wdLA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="TC04nrQ/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D23B606A322; Sat, 5 Dec 2026 15:51:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TC04nrQ/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D3D51F0092B; Sat, 5 Dec 2026 15:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796485859; bh=7f1RMgHD+CuoUqpjg3Ef5Cng19pNd1JGogv4gaiM/PU=; h=Date:To:Cc:References:Subject:From:In-Reply-To; b=TC04nrQ/w1Jq58oLH2xRgcUPrItEGFIZnmdQj8HpoeJChqvx/Fi+1IPOz80Tvxe5P VqyLETGM9yPjOXyLYxCAGtZAzgqoARVipwd8FLdeJ9sxESBomMnCn/818DenjJdlpU BqOLfg78Y+ghkpuzM/LkzmTGHxJhx7pzReWD5RCNTRA91YbGsYN+9pzkFeq35s+6yD IqvZMjDQBwfEee+6i5v9RVAQuqFR5Xle+kVH6+eesQH6Amua+WpndB39mH+p0HK3PL B+TEPfg2WvJiCHUahhfdUAgXjebSkRGcRByd8eiS9b4xxvjbGgILEpvK0tGB1IYBv8 dLJe8Pv7a4G6Q== Message-ID: <82856b19-e0b4-4f96-aea1-118172d36528@kernel.org> Date: Sat, 5 Dec 2026 15:50:56 +0000 X-Mailing-List: linux-debuggers@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: max@linux.ibm.com Cc: acme@kernel.org, alan.maguire@oracle.com, dwarves@vger.kernel.org, iii@linux.ibm.com, linux-debuggers@vger.kernel.org References: <20261122210636.2896891-5-max@linux.ibm.com> Subject: Re: [PATCH dwarves v1 1/2] dwarf_loader: Support in-memory return values for s390 Content-Language: en-GB From: Alan Maguire In-Reply-To: <20261122210636.2896891-5-max@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > The s390 ABI returns any aggregate and scalars larger than 8 bytes, such > as __int128, in a return value buffer allocated by the caller. > This buffer's address is treated like a "hidden argument" and passed > by the caller in %r2. The function's first parameter is passed in %r3. > > Without this change pahole skips such functions and with "--verbose" > prints a message like this: > > : skipping BTF encoding of function due to unexpected register usage for parameter > > Set the first parameter register index (reg_idx) to the proper value. > Move function's return type resolution before parameters > are analyzed, because the analysis depends on the return type. > > Although param_loc_supported is not set for s390, calculate > the reg_idx in function__match_clang_parameter_locations in case > the flag is enabled in the future. > > The change affects only s390. > > Signed-off-by: Maxim Khmelevskii > Reviewed-by: Ilya Leoshkevich Thanks for these changes! AI review flagged an issue that vector and complex types weren't handled and suggested this as a fix: --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -4131,9 +4131,18 @@ static bool tag__is_aggregate(const struct tag *type) static bool s390x__ret_in_memory(const struct tag *type, const struct cu *cu) { + /* Vector ABI: vectors of up to 16 bytes are returned in %v24. */ + if (tag__is_vector(type)) + return tag__size(type, cu) > 16; + if (tag__is_aggregate(type)) return true; + /* Complex types are always returned in memory. */ + if (tag__is_base_type(type, cu) && + tag__base_type(type)->float_type == BT_FP_CMPLX) + return true; + return tag__size(type, cu) > 8; } Given that the changes you have fix all other cases, I'd be happy to deal with that as a followup (if it's even needed, these aren't types we're going to run into in the kernel much), but just wanted to check in case you did want to roll it in for completeness.