public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH v2 0/5] linux: Avoid va_list for generic syscall wrappers if possible
Date: Wed, 5 Apr 2023 11:04:16 -0300	[thread overview]
Message-ID: <45d5946a-1269-3d7f-08ca-6fe7c0fdfa68@linaro.org> (raw)
In-Reply-To: <PAWPR08MB89822CB484CCE39EFD7FFD4183909@PAWPR08MB8982.eurprd08.prod.outlook.com>



On 05/04/23 10:19, Wilco Dijkstra via Libc-alpha wrote:
> Hi,
> 
>> Maybe we can use a custom C implementation (like RISC-V) as well.  But
>> strictly speaking the RISC-V syscall.c is invoking undefined behavior
>> (like my proposal) so I agree with assembly here.
> 
> How does assembly code not invoke the exact same undefined behaviour?
> In both cases you rely on variable arguments being passed in the same
> way as integer args - this is true in many ABIs. The goal is to avoid introducing
> unnecessary assembly and use generic implementations where possible.
> 
> So if that C version works as well as assembler on LoongArch and assuming
> that bare syscall() performance is essential, then why not use it?

After this discussion, it seems that RISCV implementation is essentially
broken and it would be better to either provide a arch-specific assembly
implementation and/or use the generic C one and fix the code generation
issue.


  reply	other threads:[~2023-04-05 14:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 13:19 Wilco Dijkstra
2023-04-05 14:04 ` Adhemerval Zanella Netto [this message]
2023-04-07  7:31 ` caiyinyu
  -- strict thread matches above, loose matches on Subject: below --
2023-04-04 10:12 Wilco Dijkstra
2023-03-25 14:08 Xi Ruoyao
2023-03-27 14:04 ` Carlos O'Donell
2023-03-27 14:44   ` Xi Ruoyao
2023-03-27 14:45   ` Xi Ruoyao
2023-03-27 14:51     ` Xi Ruoyao
2023-04-04  1:25     ` caiyinyu
2023-04-04 12:12       ` Xi Ruoyao

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=45d5946a-1269-3d7f-08ca-6fe7c0fdfa68@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).