public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Zack Weinberg" <zack@owlfolio.org>
To: "GNU libc development" <libc-alpha@sourceware.org>
Subject: Re: [PATCH v1 1/2] x86: Implement sched_yield syscall for x86 only.
Date: Thu, 08 Jun 2023 13:44:01 -0700	[thread overview]
Message-ID: <652146a2-4be1-42c6-8052-ad28319bb70a@app.fastmail.com> (raw)
In-Reply-To: <CAFUsyfJCrV8iHAPh0G22tkHOGJTJpJSctq5KQYJ8d+hHz15Kug@mail.gmail.com>



On Thu, Jun 8, 2023, at 1:38 PM, Noah Goldstein via Libc-alpha wrote:
> On Thu, Jun 8, 2023 at 3:23 PM Zack Weinberg via Libc-alpha
> <libc-alpha@sourceware.org> wrote:
>>
>> On Thu, Jun 8, 2023, at 12:53 PM, Noah Goldstein via Libc-alpha wrote:
>> > On Thu, Jun 8, 2023 at 2:41 PM Florian Weimer <fw@deneb.enyo.de> wrote:
>> >>
>> >> * Zack Weinberg via Libc-alpha:
>> >>
>> >> > If these registers are all call-clobbered then maybe it makes sense
>> >> > to do this unconditionally in the syscall entry path, kernel
>> >> > side.
>> >>
>> >> This is not a backwards-compatible change and probably breaks glibc
>> >> itself because the asm constraints clearly indicate that vector
>> >> registers are NOT clobbered.
>> >
>> > we only need a few select functions.
>>
>> If the vector regs aren't call clobbered (and I really mean *call* clobbered here, not syscall clobbered) then this isn't a safe change *at all*, ne?
>>
>> I see why compatibility precludes doing this kernel-side, but then it seems to me the proper place is in the syscall stub macros.
>>
> We are taking advantage of the fact that call ABI clobbers all
> vectors. macro doesn't imply any clobbers.

OK, so then why *not* alter the syscall stub macros to do this uniformly for all syscalls, or for all but a handful of things which are unlikely to cause a context switch and the extra cost of the clear instruction itself is significant (e.g. get*id, sigprocmask).

zw

  reply	other threads:[~2023-06-08 20:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08  9:00 Noah Goldstein
2023-06-08  9:00 ` [PATCH v1 2/2] x86: Implement clock_nanosleep{_time64} " Noah Goldstein
2023-06-08 10:13 ` [PATCH v1 1/2] x86: Implement sched_yield " Gabriel Ravier
2023-06-08 17:43   ` Noah Goldstein
2023-06-08 11:43 ` Florian Weimer
2023-06-08 12:08   ` Adhemerval Zanella Netto
2023-06-08 17:39     ` Noah Goldstein
2023-06-08 18:26       ` Zack Weinberg
2023-06-08 19:41         ` Florian Weimer
2023-06-08 19:53           ` Noah Goldstein
2023-06-08 20:22             ` Zack Weinberg
2023-06-08 20:38               ` Noah Goldstein
2023-06-08 20:44                 ` Zack Weinberg [this message]
2023-06-08 21:06                   ` Noah Goldstein
2023-06-08 21:25                     ` Florian Weimer
2023-06-09  5:59                       ` Zack Weinberg
2023-06-10  1:11                         ` Noah Goldstein
2023-06-10  2:07                           ` Gabriel Ravier
2023-06-10  4:59                             ` Noah Goldstein

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=652146a2-4be1-42c6-8052-ad28319bb70a@app.fastmail.com \
    --to=zack@owlfolio.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).