From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92420CA0ED3 for ; Mon, 2 Sep 2024 14:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3yUcMtLgoLG9tzCuXt+yY+rp6XTZocqr3Yjofx3Z2Ag=; b=Okwe1Dx+pJ92jjfJDtPO5Ic1JI Q0Pf7ckTdIziZH3hkT1jrZajZn//bd9AqPspI8GxSvkMfQbDr7AppW2F5ViJXJJ4x1LTJFKimcm2B aSMVrkaAo5SHmc6wRlQCpgbiML/llN7ilVE74KmQAs2nWEratNACjQyl4SHvs+bRXw8GS1K/wOB3E m+Bef/C5VfGi1xPsvsKVndsRmgcRQjO3MidRfiwuScTZcX++M0u3UKaFvqvK9e6Prpj2h6byqB4o8 LMB6XgN1exwSn2Ff5bhqLJTKl6x8RXNzhDxA9TA+lvCgmz0YoVILIL30cAdAw5513a6w/HtgCuFZB rzW8+Cqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl8GF-0000000EiOe-3n1v; Mon, 02 Sep 2024 14:42:31 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl8FL-0000000EiEY-2qgR for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 14:41:37 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 873D05C5684; Mon, 2 Sep 2024 14:41:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F411C4CEC2; Mon, 2 Sep 2024 14:41:33 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="oC+MStkb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1725288092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3yUcMtLgoLG9tzCuXt+yY+rp6XTZocqr3Yjofx3Z2Ag=; b=oC+MStkbWG8SIsGeZ0TJLGzYBxRZjy7xt6yjTvTgKTB8gciUKdBNYK5k5k0aaKqVC4tdRR hnv0w0qJDCdhpX1yUiZeuGINbWbJxSGAuUeAmFmUCJPpB9si5u3zQL2vCkwkAcPkm+8hex 4MD3RQ74UKyWrrbJpiLM02HOD6skMt4= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id fd46b2e8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 2 Sep 2024 14:41:31 +0000 (UTC) Date: Mon, 2 Sep 2024 16:41:28 +0200 From: "Jason A. Donenfeld" To: Mark Rutland Cc: Adhemerval Zanella , Theodore Ts'o , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Catalin Marinas , Will Deacon , Thomas Gleixner , Eric Biggers , Christophe Leroy Subject: Re: [PATCH v3] aarch64: vdso: Wire up getrandom() vDSO implementation Message-ID: References: <20240902125312.3934-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_074135_789691_C8F12A49 X-CRM114-Status: GOOD ( 13.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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.