Re: [PATCH v3 1/3] LoongArch: vDSO: Wire up getrandom() vDSO implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2024-08-19 at 13:03 +0000, Jason A. Donenfeld wrote:
> > > The compiler (GCC 14.2) calls memset() for initializing a "large" struct
> > > in a cold path of the generic vDSO getrandom() code.  There seems no way
> > > to prevent it from calling memset(), and it's a cold path so the
> > > performance does not matter, so just provide a naive memset()
> > > implementation for vDSO.
> > Why x86 doesn't need to provide a naive memset()?

I'm not sure.  Maybe it's because x86_64 has SSE2 enabled so by default
the maximum buffer length to inline memset is larger.

> It looks like others are running into this when porting to ppc and
> arm64, so I'll probably refactor the code to avoid needing it in the
> first place. I'll chime in here when that's done.

Yes, I've seen the PPC guys hacking the code to avoid memset.

BTW I've also seen "vDSO getrandom isn't supported on 32-bit platforms"
in the PPC discussion.  Is there any plan to support it in the future? 
If not I'll only select VDSO_GETRANDOM if CONFIG_64BIT, and then the
assembly code can be slightly simplified.

-- 
Xi Ruoyao <xry111@xxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux