From: Alejandro Colomar <alx.manpages@gmail.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-man@vger.kernel.org, Alejandro Colomar <alx@kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Boqun Feng <boqun.feng@gmail.com>, paulmck <paulmck@kernel.org>
Subject: Re: rseq(2) man page
Date: Tue, 10 Jan 2023 20:28:35 +0100 [thread overview]
Message-ID: <71ea2fa3-e593-e1ae-7abd-377bdf302d24@gmail.com> (raw)
In-Reply-To: <c21ca3d7-9095-5613-5953-7870d9a6c23f@efficios.com>
[-- Attachment #1.1: Type: text/plain, Size: 3637 bytes --]
On 1/10/23 17:54, Mathieu Desnoyers wrote:
[...]
[EFAULT / SEGV]
>
> OK, let's keep this for a separate discussion.
Sure.
[...]
>> I forgot; there's a new section: LIBRARY.
>>
>> It specifies the library in which the function is defined, or in the case of
>> syscalls, the wrapper (since we call it through syscall(2), it would be libc).
>
> OK. Similar to futex(2).
Yep.
>
>>
>> BTW, I wonder what librseq is. Is librseq something that users should care
>> about?
>
> Users are not required to use librseq to use the rseq system call,
> but it's very convenient to use this C-level API rather than have
> each user reimplement the per-architecture assembly code required to
> create the RSEQ critical sections.
>
> librseq did not have an official release yet, so that's mainly why I
> think it too early to refer to it in manual pages.
Okay; when you feel it's ready, you could document it like libkeyutils in keyctl(2).
>
>>
>>> .SH SYNOPSIS
>>> .nf
>>> .PP
>>> .BR "#include <linux/rseq.h>" \
>>> " /* Definition of " RSEQ_* " constants and rseq types */"
>>
>> The line above goes beyond column 80 in formatted output. That's a hard limit
>> for manual pages. If you add this page to the linux man-pages repo, and run
>> the linters, you'll see a warning about that. In case you're interested in
>> linting manual pages in the future, you can do something similar to what I do
>> in the man-pages[2]
>
> OK. I've used it, it's quite useful! I have fixed all warnings except for
> "mandoc: man2/rseq.2:5:12: WARNING: cannot parse date, using it verbatim: (date)"
> which I suspect is expected.
Uhh, I had that one explicitly silenced:
$ make lint-man-mandoc V=1
LINT (mandoc) tmp/lint/man2/perf_event_open.2.lint-man.mandoc.touch
! (mandoc -man -Tlint man2/perf_event_open.2 2>&1 \
| grep -v 'STYLE: lower case character in document title:' \
| grep -v 'UNSUPP: ignoring macro in table:' \
| grep -v 'WARNING: cannot parse date, using it verbatim: TH (date)' \
| grep -v 'WARNING: empty block: UR' \
||:; \
) \
| grep '.' >&2
touch tmp/lint/man2/perf_event_open.2.lint-man.mandoc.touch
For some reason you didn't have "TH" in the error message, which is why my grep
didn't discard it.
[...]
>>> .BI "int syscall(SYS_rseq, struct rseq *_Nullable " rseq ", uint32_t "
>>> rseq_len \
>>
>> What's the meaning for NULL? Does it have a valid sentinel meaning, or is it
>> an invalid address? If it's just interpreted as an invalid address (for which
>> from a user-space perspective a crash would be legitimate), then I'd remove
>> _Nullable.
>
> With the flags that are currently implemented (0 or RSEQ_FLAG_UNREGISTER),
> the rseq argument is not expected to be legitimately NULL (it would return
> -1, errno=EFAULT on registration, or -1, errno=EINVAL on unregister attempt).
>
> We may add new flags in the future which would not care about the rseq address
> (it could very well be null then). Do you recommend that we only add the
> _Nullable tag when this occurs ?
Yes; since it's what the user can pass, it makes sense to be as constrained as
possible. If it were some return that the user would have to inspect, it would
make sense to be cautious on the NULL side of things an use _Nullable
preventively, but for an input, non-null is preferred for now.
[...]
>
> Updated version based on your comments pushed into my repo, thanks!
Cool! I'll have a look.
Cheers,
Alex
>
> Mathieu
>
>
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-01-10 19:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-06 17:16 rseq(2) man page Mathieu Desnoyers
2023-01-06 17:22 ` Alejandro Colomar
2023-01-06 17:50 ` Alejandro Colomar
2023-01-06 20:57 ` Mathieu Desnoyers
2023-01-06 22:57 ` Alejandro Colomar
2023-01-10 16:54 ` Mathieu Desnoyers
2023-01-10 19:28 ` Alejandro Colomar [this message]
2023-01-10 19:57 ` Mathieu Desnoyers
2023-01-10 19:03 ` man page width limit and example indentation (was: rseq(2) man page) G. Branden Robinson
2023-01-10 20:29 ` Alejandro Colomar
2023-01-10 21:39 ` G. Branden Robinson
2023-01-10 23:30 ` Alejandro Colomar
2023-01-11 15:31 ` G. Branden Robinson
2023-01-11 15:39 ` G. Branden Robinson
2023-01-06 18:49 ` rseq(2) man page Mathieu Desnoyers
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=71ea2fa3-e593-e1ae-7abd-377bdf302d24@gmail.com \
--to=alx.manpages@gmail.com \
--cc=alx@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.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