Linux debuggers
 help / color / mirror / Atom feed
From: Maxim Khmelevskii <max@linux.ibm.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: dwarves@vger.kernel.org, linux-debuggers@vger.kernel.org,
	Alan Maguire <alan.maguire@oracle.com>,
	Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH dwarves v1 0/2] Support in-memory return values for s390
Date: Sun, 22 Nov 2026 22:06:18 +0100	[thread overview]
Message-ID: <20261122210636.2896891-4-max@linux.ibm.com> (raw)

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.

Add test for in-memory return values.

The change affects only s390.

Maxim Khmelevskii (2):
  dwarf_loader: Support in-memory return values for s390
  tests: Add test for in-memory return values

 dwarf_loader.c         |  84 +++++++++++++++++++++++-------
 dwarves.h              |   1 +
 tests/ret_in_memory.sh | 113 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 180 insertions(+), 18 deletions(-)
 create mode 100755 tests/ret_in_memory.sh

-- 
2.56.0


             reply	other threads:[~2026-11-22 21:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 21:06 Maxim Khmelevskii [this message]
2026-11-22 21:06 ` [PATCH dwarves v1 1/2] dwarf_loader: Support in-memory return values for s390 Maxim Khmelevskii
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=20261122210636.2896891-4-max@linux.ibm.com \
    --to=max@linux.ibm.com \
    --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 \
    /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