linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	Theodore Ts'o <tytso@mit.edu>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Eric Biggers <ebiggers@kernel.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: Re: [PATCH v3] aarch64: vdso: Wire up getrandom() vDSO implementation
Date: Mon, 2 Sep 2024 16:41:28 +0200	[thread overview]
Message-ID: <ZtXOmHYuTI9DQGij@zx2c4.com> (raw)
In-Reply-To: <ZtXMT3qSFgneeZb9@J2N7QTR9R3>

On Mon, Sep 02, 2024 at 03:31:43PM +0100, Mark Rutland wrote:
> ssize_t __kernel_getrandom(void *buffer, size_t len, unsigned int flags,
> 			   void *opaque_state, size_t opaque_len)
> {
> 	if (alternative_has_cap_likely(ARM64_HAS_FPSIMD)) {
> 		return __cvdso_getrandom(buffer, len, flags,
> 					 opaque_state, opaque_len);
> 	}
> 
> 	if (unlikely(opaque_len == ~0UL && !buffer && !len && !flags))
> 		return -ENOSYS;
> 	
> 	return getrandom_syscall(buffer, len, flags);
> }
> 
> ... though the conditions for returning -ENOSYS look very odd to me; why
> do we care about fast-pathing that specific case rather than forwarding
> that to the kernel, and does __cvdso_getrandom() handle that correctly?

Adhemerval's code here is fine and correct. The opaque_len==~0UL thing
is a special vDSO case for getting the param struct back, not something
related to the kernel. See __cvdso_getrandom_data() for details.


  reply	other threads:[~2024-09-02 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02 12:52 [PATCH v3] aarch64: vdso: Wire up getrandom() vDSO implementation Adhemerval Zanella
2024-09-02 14:31 ` Mark Rutland
2024-09-02 14:41   ` Jason A. Donenfeld [this message]
2024-09-02 15:05     ` Mark Rutland

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=ZtXOmHYuTI9DQGij@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=ebiggers@kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=tglx@linutronix.de \
    --cc=tytso@mit.edu \
    --cc=will@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;
as well as URLs for NNTP newsgroup(s).