NetBSD-Bugs archive

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

Re: port-amd64/54052: bump STACK_ALIGNBYTES for COMPAT_LINUX



The following reply was made to PR port-amd64/54052; it has been noted by GNATS.

From: Rin Okuyama <rokuyama.rk%gmail.com@localhost>
To: Joerg Sonnenberger <joerg%bec.de@localhost>, gnats-bugs%NetBSD.org@localhost
Cc: port-amd64-maintainer%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost
Subject: Re: port-amd64/54052: bump STACK_ALIGNBYTES for COMPAT_LINUX
Date: Tue, 12 Mar 2019 07:20:28 +0900

 On 2019/03/12 5:15, Joerg Sonnenberger wrote:
 > On Mon, Mar 11, 2019 at 05:50:00AM +0000, rokuyama.rk%gmail.com@localhost wrote:
 >>> Fix:
 >> Index: sys/arch/amd64/include/param.h
 >> ===================================================================
 >> RCS file: /home/netbsd/src/sys/arch/amd64/include/param.h,v
 >> retrieving revision 1.29
 >> diff -p -u -r1.29 param.h
 >> --- sys/arch/amd64/include/param.h	11 Feb 2019 14:59:32 -0000	1.29
 >> +++ sys/arch/amd64/include/param.h	10 Mar 2019 13:12:11 -0000
 >> @@ -23,6 +23,8 @@
 >>   
 >>   #define ALIGNED_POINTER(p,t)	1
 >>   
 >> +#define STACK_ALIGNBYTES	(16 - 1)	/* COMPAT_LINUX */
 >> +
 >>   #define ALIGNBYTES32		(sizeof(int) - 1)
 >>   #define ALIGN32(p)		(((u_long)(p) + ALIGNBYTES32) &~ALIGNBYTES32)
 >>   
 >>
 > 
 > I'm puzzled by this patch. Stack alignment should already be 16 Bytes on
 > AMD64.
 
 Since we don't currently define STACK_ALIGNBYTES for amd64,
 it falls back to __ALIGNBYTES = (8 - 1):
 
 src/sys/sys/param.h
 https://nxr.netbsd.org/xref/src/sys/sys/param.h#227
 ...
     227  #ifndef STACK_ALIGNBYTES
     228  #define STACK_ALIGNBYTES        __ALIGNBYTES
     229  #endif
 ...
 
 src/sys/arch/amd64/include/cdefs.h
 https://nxr.netbsd.org/xref/src/sys/arch/amd64/include/cdefs.h#6
 ...
       6  #define __ALIGNBYTES            (sizeof(long) - 1)
 ...
 
 Do you mean this violates x86_64 System V ABI?
 
 Thanks,
 rin
 


Home | Main Index | Thread Index | Old Index