All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "Adhemerval Zanella Netto" <adhemerval.zanella@linaro.org>,
	"Alejandro Colomar" <alx@kernel.org>,
	"Thomas Weißschuh" <thomas@t-8ch.de>,
	util-linux@vger.kernel.org, "Xi Ruoyao" <xry111@xry111.site>,
	"GNU C Library" <libc-alpha@sourceware.org>
Subject: Re: [PATCH] x32: Switch back to assembly syscall wrapper for prctl
Date: Sun, 07 Dec 2025 10:41:31 +0100	[thread overview]
Message-ID: <lhuh5u2aat0.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CAMe9rOpqX9cdhvMneHnfvJFG8ixJsdAyd6iK8mh_Th1Lpv4ahQ@mail.gmail.com> (H. J. Lu's message of "Sun, 7 Dec 2025 11:52:08 +0800")

* H. J. Lu:

> On Thu, Dec 4, 2025 at 10:06 PM Adhemerval Zanella Netto
> <adhemerval.zanella@linaro.org> wrote:
>>
>> The x32 and or1k (which also uses similar implementation) does seems broken
>> without checking the 'option' argument to see which arg we can va_arg.
>>
>> The problem is adding this logic on libc will add some forward-compatibility
>> that we try to avoid (newer kernel prctl additions might now work correctly).
>>
>> I am not sure why we haven't switch x32 back to the assembly wrappers
>> with 6a04404521ac4119ae36827eeb288ea84eee7cf6 fix (BZ#29770).  H.J, can
>> use remove the x32 C version (and also or1k as well)?
>
> Since the variadic prctl function takes at most 5 integer arguments which
> are passed in the same integer registers on x32 as the function with 5
> integer arguments, we can safely use assembly syscall wrapper for prctl
> for x32.

The C implementation clears the upper 32 bits of registers.  Does the
assembler wrapper do the same?

Thanks,
Florian


  reply	other threads:[~2025-12-07  9:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-01  9:31 [PATCH v1] Call prctl(2) with long integers, specify 5 arguments, and avoid casts Alejandro Colomar
2024-06-01 11:05 ` Thomas Weißschuh
2024-06-01 12:23   ` Alejandro Colomar
2024-06-01 19:32     ` Alejandro Colomar
2025-12-04 14:06     ` Adhemerval Zanella Netto
2025-12-07  3:52       ` [PATCH] x32: Switch back to assembly syscall wrapper for prctl H.J. Lu
2025-12-07  9:41         ` Florian Weimer [this message]
2025-12-08  1:48           ` [PATCH v2] x32: Implement prctl in assembly H.J. Lu
2025-12-08  8:10             ` Florian Weimer
2025-12-08  9:01               ` H.J. Lu
2025-12-08  9:09                 ` Florian Weimer
2025-12-08 11:47                   ` Adhemerval Zanella Netto
2025-12-08 14:25                     ` Florian Weimer
2025-12-08 22:41                       ` [PATCH v3] " H.J. Lu
2025-12-07 12:34         ` [PATCH] x32: Switch back to assembly syscall wrapper for prctl Alejandro Colomar
2024-06-06  7:21 ` [PATCH v1] Call prctl(2) with long integers, specify 5 arguments, and avoid casts Karel Zak
2025-12-03 20:50 ` [PATCH v2 0/1] Call prctl(2) with signed long integers, " Alejandro Colomar
2025-12-03 20:50   ` [PATCH v2 1/1] " Alejandro Colomar
2025-12-03 21:01   ` [PATCH v2 0/1] " Alejandro Colomar
2025-12-03 22:12     ` Thomas Weißschuh
2025-12-03 22:36       ` Alejandro Colomar

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=lhuh5u2aat0.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alx@kernel.org \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=thomas@t-8ch.de \
    --cc=util-linux@vger.kernel.org \
    --cc=xry111@xry111.site \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.