linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Naveen N Rao <naveen@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	Shuah Khan <shuah@kernel.org>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-kselftest@vger.kernel.org, llvm@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-trace-kernel@vger.kernel.org,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	Xi Ruoyao <xry111@xry111.site>
Subject: Re: [PATCH v4 5/5] powerpc/vdso: Wire up getrandom() vDSO implementation on PPC64
Date: Mon, 2 Sep 2024 15:12:47 +0200	[thread overview]
Message-ID: <bdf1a515-b3d0-471d-89ee-989ae0d63202@csgroup.eu> (raw)
In-Reply-To: <ZtWyeuCfzZ66fVsg@zx2c4.com>



Le 02/09/2024 à 14:41, Jason A. Donenfeld a écrit :
> On Mon, Sep 02, 2024 at 02:04:42PM +0200, Christophe Leroy wrote:
>>   SYM_FUNC_START(__arch_chacha20_blocks_nostack)
>>   #ifdef __powerpc64__
>> -	blr
>> +	std	r5, -216(r1)
>> +
>> +	std	r14, -144(r1)
>> +	std	r15, -136(r1)
>> +	std	r16, -128(r1)
>> +	std	r17, -120(r1)
>> +	std	r18, -112(r1)
>> +	std	r19, -104(r1)
>> +	std	r20, -96(r1)
>> +	std	r21, -88(r1)
>> +	std	r22, -80(r1)
>> +	std	r23, -72(r1)
>> +	std	r24, -64(r1)
>> +	std	r25, -56(r1)
>> +	std	r26, -48(r1)
>> +	std	r27, -40(r1)
>> +	std	r28, -32(r1)
>> +	std	r29, -24(r1)
>> +	std	r30, -16(r1)
>> +	std	r31, -8(r1)
>>   #else
>>   	stwu	r1, -96(r1)
>>   	stw	r5, 20(r1)
>> +#ifdef __BIG_ENDIAN__
>>   	stmw	r14, 24(r1)
>> +#else
>> +	stw	r14, 24(r1)
>> +	stw	r15, 28(r1)
>> +	stw	r16, 32(r1)
>> +	stw	r17, 36(r1)
>> +	stw	r18, 40(r1)
>> +	stw	r19, 44(r1)
>> +	stw	r20, 48(r1)
>> +	stw	r21, 52(r1)
>> +	stw	r22, 56(r1)
>> +	stw	r23, 60(r1)
>> +	stw	r24, 64(r1)
>> +	stw	r25, 68(r1)
>> +	stw	r26, 72(r1)
>> +	stw	r27, 76(r1)
>> +	stw	r28, 80(r1)
>> +	stw	r29, 84(r1)
>> +	stw	r30, 88(r1)
>> +	stw	r31, 92(r1)
>> +#endif
>> +#endif
> 
> This confuses me. Why are you adding code to the !__powerpc64__ branch
> in this commit? (Also, why does stmw not work on LE?)

That's for the VDSO32 ie running 32 bits binaries on a 64 bits kernel.

"Programming Environments Manual for 32-Bit Implementations of the 
PowerPC™ Architecture" say: In some implementations operating with 
little-endian byte order, execution of an lmw or stmw instruction
causes the system alignment error handler to be invoked

And GCC doesn't like it either:

tools/arch/powerpc/vdso/vgetrandom-chacha.S:84: Error: `stmw' invalid 
when little-endian


  reply	other threads:[~2024-09-02 13:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02 12:04 [PATCH v4 0/5] Wire up getrandom() vDSO implementation on powerpc Christophe Leroy
2024-09-02 12:04 ` [PATCH v4 1/5] mm: Define VM_DROPPABLE for powerpc/32 Christophe Leroy
2024-09-02 12:04 ` [PATCH v4 2/5] powerpc/vdso32: Add crtsavres Christophe Leroy
2024-09-02 12:04 ` [PATCH v4 3/5] powerpc/vdso: Refactor CFLAGS for CVDSO build Christophe Leroy
2024-09-02 12:04 ` [PATCH v4 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on PPC32 Christophe Leroy
2024-09-02 12:34   ` Jason A. Donenfeld
2024-09-02 13:07     ` Christophe Leroy
2024-09-02 12:04 ` [PATCH v4 5/5] powerpc/vdso: Wire up getrandom() vDSO implementation on PPC64 Christophe Leroy
2024-09-02 12:41   ` Jason A. Donenfeld
2024-09-02 13:12     ` Christophe Leroy [this message]
2024-09-02 14:00       ` Jason A. Donenfeld
2024-09-02 14:16         ` Christophe Leroy
2024-09-02 14:19           ` Jason A. Donenfeld
2024-09-02 14:27             ` Christophe Leroy
2024-09-02 14:37               ` Jason A. Donenfeld

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=bdf1a515-b3d0-471d-89ee-989ae0d63202@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=Jason@zx2c4.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=justinstitt@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=llvm@lists.linux.dev \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=morbo@google.com \
    --cc=mpe@ellerman.id.au \
    --cc=nathan@kernel.org \
    --cc=naveen@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=npiggin@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=shuah@kernel.org \
    --cc=xry111@xry111.site \
    /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