Message ID | 20240815133357.35829-1-xry111@xry111.site |
---|---|
Headers | show |
Series | LoongArch: Implement getrandom() in vDSO | expand |
Hi Xi, Thanks for posting this! That's very nice to see. I'm currently traveling without my laptop (actually in Yunnan, China!), so I'll be able to take a look at this for real starting the 26th, as right now I'm just on my cellphone using lore+mutt. One thing I wanted to ask, though, is - doesn't LoongArch have 32 8-byte registers? Shouldn't that be enough to implement ChaCha without spilling and without using LSX? Jason
On Thu, 2024-08-15 at 14:04 +0000, Jason A. Donenfeld wrote: > Hi Xi, > > Thanks for posting this! That's very nice to see. > > I'm currently traveling without my laptop (actually in Yunnan, China!), Have fun! > so I'll be able to take a look at this for real starting the 26th, as > right now I'm just on my cellphone using lore+mutt. > > One thing I wanted to ask, though, is - doesn't LoongArch have 32 8-byte > registers? Shouldn't that be enough to implement ChaCha without spilling > and without using LSX? I'll work on it but I need to ask a question (it may be stupid because I know a little about security) before starting to code: Is "stack-less" meaning simply "don't spill any sensitive data onto the stack," or more strictly "stack shouldn't be used at all"? For example, is it OK to save all the callee-saved registers in the function prologue onto the stack, and restore them in the epilogue?
On Thu, 2024-08-15 at 14:04 +0000, Jason A. Donenfeld wrote: > Thanks for posting this! That's very nice to see. > > I'm currently traveling without my laptop (actually in Yunnan, China!), > so I'll be able to take a look at this for real starting the 26th, as > right now I'm just on my cellphone using lore+mutt. Hi Jason, When you start the reviewing I guess you can check out the powerpc implementation first and add me into the Cc of your reply. There seems something useful to me in the powerpc implementation (avoiding memset, adding __arch_get_k_vdso_data so I wouldn't need the inline asm trick for the _vdso_rng_data symbol, and the selftest support).
On Mon, Aug 26, 2024 at 02:32:05PM +0800, Xi Ruoyao wrote: > On Thu, 2024-08-15 at 14:04 +0000, Jason A. Donenfeld wrote: > > Thanks for posting this! That's very nice to see. > > > > I'm currently traveling without my laptop (actually in Yunnan, China!), > > so I'll be able to take a look at this for real starting the 26th, as > > right now I'm just on my cellphone using lore+mutt. > > Hi Jason, > > When you start the reviewing I guess you can check out the powerpc > implementation first and add me into the Cc of your reply. There seems > something useful to me in the powerpc implementation (avoiding memset, > adding __arch_get_k_vdso_data so I wouldn't need the inline asm trick > for the _vdso_rng_data symbol, and the selftest support). Indeed, I just committed a bit of those fixups to the random.git tree, if you want to base your work on that for the time being: https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git/log/