From: Alan Maguire <almagui@kernel.org>
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
Subject: Re: [PATCH dwarves v1 1/2] dwarf_loader: Support in-memory return values for s390
Date: Sat, 5 Dec 2026 15:50:56 +0000 [thread overview]
Message-ID: <82856b19-e0b4-4f96-aea1-118172d36528@kernel.org> (raw)
In-Reply-To: <20261122210636.2896891-5-max@linux.ibm.com>
> 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:
>
> <function> : 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 <max@linux.ibm.com>
> Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
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.
next prev parent reply other threads:[~2026-12-05 15:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 21:06 [PATCH dwarves v1 0/2] Support in-memory return values for s390 Maxim Khmelevskii
2026-11-22 21:06 ` [PATCH dwarves v1 1/2] dwarf_loader: " Maxim Khmelevskii
2026-12-05 15:50 ` Alan Maguire [this message]
2026-11-22 21:06 ` [PATCH dwarves v1 2/2] tests: Add test for in-memory return values Maxim Khmelevskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=82856b19-e0b4-4f96-aea1-118172d36528@kernel.org \
--to=almagui@kernel.org \
--cc=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=dwarves@vger.kernel.org \
--cc=iii@linux.ibm.com \
--cc=linux-debuggers@vger.kernel.org \
--cc=max@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox