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 8A319C9832A for ; Fri, 25 Sep 2026 22:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KEG57+HpcgmV1+0pBM60oCDu9/+MVHQ+zzU4piGVwXA=; b=Aa7vczSH0mTYW3 YL2ZDJVSGyZ5VV8NZum5uvz14rSggz5CBBcTSXVnhAF5eg/O/ADuZSKVRXptCxV2oZYF/WudnqS7L UHjHtjPvbEiPoMJoRlksyG06CO8nbvcFBsGDyBq6qbq0SsmArpW6tUsN8i2DJyWl6hCVCKjiHUco7 ZmGt8HvIYTQ/leClSMQwTpwnLyhzCRhnfnqueIafrafj/BoAB7Eho/hjVMFYn6M0qohyTP3euuEwx TT+g2+iP7AHNvI3v7uNRLEi7SJtZtwksHI+0qWueWOXq9YCAbx1GZGRblJv3Qle4Xg7X+Rsq7NQKo UKmXbmYm9dZGHypy5EpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xAEGT-0000000EYiY-1cMs; Fri, 25 Sep 2026 22:19:33 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xAEGR-0000000EYhz-2MLv; Fri, 25 Sep 2026 22:19:31 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id A6E9D60136; Fri, 25 Sep 2026 22:19:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBFD91F00893; Fri, 25 Sep 2026 22:19:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1790374770; bh=Ub6l+gGnhbpnVJSf1sECQFZws1/JGSNU3EBgSX0gJT0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=PQxXz8Bqrp5fZyfGD0+JAGV/Kt9gf1keLvC0fg5oDg0FbTEbVJGuxWGMfLX4a64tp AWVr2a0nGnUzgI0wEPXnVpyWA2bs9xiS75lcfbRaZsj6SsbeBpDWwM2a1brofqNtc/ PMVzMywMMPqnL/kNGdSX9F63rKLKf3sNQoadBGdYyIoJVHaFD9o2FxX3/eeZttbdAW inqLQvas8M54Ltq6wI4sRbZF3B+T/RIAJD3NcO6l0rUleguc0EzcHCV7vzFkNvo/WV yh0CnZKvY/rQthUclqO6rQJbXjy8+yJDamlNxOKl56QmZxkkB7YCoqP8hpwRiy5WMz 6mMauv2SHxwSg== Date: Fri, 25 Sep 2026 23:19:21 +0100 From: Nathan Chancellor To: Nick Desaulniers Cc: Andy Lutomirski , Thomas Gleixner , Theodore Ts'o , "Jason A. Donenfeld" , Vincenzo Frascino , Bill Wendling , Justin Stitt , Catalin Marinas , Will Deacon , Mark Rutland , Huacai Chen , WANG Xuerui , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v2] random: vDSO: Avoid call to memset() when zeroing reserved in __cvdso_getrandom_data() Message-ID: <20260925221921.GA2296912@ax162> References: <20260925-vdso-getrandom-avoid-memset-llvm-24-v2-1-ce640f872393@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Sep 25, 2026 at 03:00:46PM -0700, Nick Desaulniers wrote: > > > > +static inline void *memset_inline(void *dst, int value, size_t size) > > > > +{ > > > > + char *d = dst; > > > > + > > > > + while (size--) > > > > + *d++ = value; > > > > + > > > > + return d; > > > > +} > > > > > > Does this work? > > > https://godbolt.org/z/Tx6EaGMfb > > > > Hmmm...possibly. > > https://godbolt.org/z/ec9rzd9Yf > > I don't get it... > > Just keep it under 2 pages, it will be fine: > https://godbolt.org/z/qqoMqfxev Yeah, it might be worth a comment that this is only safe for small values of size so it should not be blindly copied elsewhere (although I guess if it is, the outlined version exists in the majority of other places). -- Cheers, Nathan _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv