Thread (100 messages) 100 messages, 26 authors, 4h ago

Re: [PATCH 2/3] vmsplice: make vmsplice a trivial wrapper for preadv2/pwritev2

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2026-06-04 21:43:14
Also in: linux-api, linux-fsdevel, linux-mm, linux-patches, lkml

On Thu, 4 Jun 2026 at 14:32, David Laight [off-list ref] wrote:
I think riscv might sign extend 32bit values in 64bit registers.
x86 and arm both zero extend.
That's different.

x86 really doesn't *care*. If the caller zero-extends or leaves high
bits set randomly, according to the x86 ABI that's perfectly fine: the
callee will only care about the low 32 bits. So the high bits are
simply not relevant for the ABI.

The Powerpc ABI makes the the sign extension part of the calling conventions.

So if a caller doesn't sign extend a 32-bit value, the result is
random behavior - if you pass some function an 'int' argument, the
function may end up looking at bit 63 to see if it's negative (except
IBM calls it "bit 0" because they have to be different from everybody
else)

            Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help