On Mon, Jun 20, 2011 at 7:40 AM, Jeff Law <l...@redhat.com> wrote: > >>> Peter, do you think it is safe to assume upper 32bits are zero in >>> user space for x32? Kernel isn't a problem since pointer is 64bit >>> in kernel and we don't pass pointers on stack to kernel. >> >> As I have already stated, if we *cannot* require pointers to be >> zero-extended on entry to the kernel, we're going to have to have >> special entry points for all the x32 system calls except the ones that >> don't take pointers.asdfasfd > BTW (and feel free to respond off-list), what's the rationale behind > zero-extending values in x32 from 32 bits to 64 bits rather than the > more traditional sign-extending? >
Since hardware zero-extends 32-bit result to 64-bit in the destination general-purpose register, we can load addresses into 32bit (ptr_mode) register and use the full 64bit (Pmode) register without any additional instructions. As far as the processor is concerned, x32 process is the same as x86-64 process. The only difference is x32 won't go over 4GB. -- H.J.