This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4 06/13] C-SKY: Linux ABI


On Thu, Sep 13, 2018 at 10:17 AM Mao Han <han_mao@c-sky.com> wrote:
>
> On Wed, Sep 12, 2018 at 03:40:35PM +0200, Arnd Bergmann wrote:
> > On Wed, Sep 12, 2018 at 4:58 AM Mao Han <han_mao@c-sky.com> wrote:
> > >
> > > Linux-specific code that is required for maintaining ABI compatibility.
> > > This doesn't contain the actual system call interface.
> > >  sysdeps/unix/sysv/linux/csky/sys/user.h           |  60 +++
> > >  sysdeps/unix/sysv/linux/csky/sysdep.h             | 534 ++++++++++++++++++++++
> >
> > I'm surprised to see copies of bits/shm.h, bits/mman.h and sys/procfs.h.
> > Since the kernel port just uses the generic interfaces that all other
> > architectures used in the past decade, shouldn't the glibc defaults
> > match be enough here?

>
> We have SHMLBA defined to __getpagesize () << 2 in the linux port not
> __getpagesize () in the generic version in glibc. So an arch specific
> bits/shm.h seems needed.

Right, that makes sense.You need that for aliasing virtually indexed
caches, correct?

In the kernel, I'd probably try to change the generic file to allow an
architecture specific override, but I don't know what
the policy for this is in glibc.

> The generic sys/procfs.h in glibc define pr_uid/pr_gid as 'unsigned short',
> we have __kernel_uid_t define as "unsigned int"  in linux/include/uapi/
> asm-generic/posix_types.h. So I need an arch specific sys/procfs.h
> with pr_uid/pr_gid define as "unsigned int".

This sounds like something that should be improved in glibc, by
changing the default to the common case, and letting the less
common ones override it.

Here is what I see in glibc:

sysdeps/unix/sysv/linux/aarch64/sys/procfs.h:    unsigned int pr_uid;
sysdeps/unix/sysv/linux/alpha/sys/procfs.h:    unsigned int pr_uid;
sysdeps/unix/sysv/linux/arm/sys/procfs.h:    unsigned short int pr_uid;
sysdeps/unix/sysv/linux/hppa/sys/procfs.h:    unsigned int pr_uid;
sysdeps/unix/sysv/linux/ia64/sys/procfs.h:    unsigned int pr_uid;
sysdeps/unix/sysv/linux/m68k/sys/procfs.h:    unsigned short int pr_uid;
sysdeps/unix/sysv/linux/microblaze/sys/procfs.h:    unsigned short int pr_uid;
sysdeps/unix/sysv/linux/mips/sys/procfs.h:    long pr_uid;
sysdeps/unix/sysv/linux/nios2/sys/procfs.h:    unsigned short int pr_uid;
sysdeps/unix/sysv/linux/powerpc/sys/procfs.h:    __uid_t pr_uid;  # __U32_TYPE
sysdeps/unix/sysv/linux/riscv/sys/procfs.h:    long int pr_uid;
sysdeps/unix/sysv/linux/s390/sys/procfs.h:    unsigned int pr_uid;  # s390-64
sysdeps/unix/sysv/linux/s390/sys/procfs.h:    unsigned short int
pr_uid; # s390-32
sysdeps/unix/sysv/linux/sh/sys/procfs.h:    unsigned short int pr_uid;
sysdeps/unix/sysv/linux/sparc/sys/procfs.h:    unsigned int pr_uid;  # sparc64
sysdeps/unix/sysv/linux/sparc/sys/procfs.h:    unsigned short int
pr_uid; # sparc32
sysdeps/unix/sysv/linux/x86/sys/procfs.h:    unsigned short int pr_uid; # i386
sysdeps/unix/sysv/linux/x86/sys/procfs.h:    unsigned int pr_uid; # x86-64
sysdeps/unix/sysv/linux/sys/procfs.h:    unsigned short int pr_uid; #
everything else

and what we have in the kernel:

arch/arm/include/uapi/asm/posix_types.h:typedef unsigned short
 __kernel_uid_t;
arch/m68k/include/uapi/asm/posix_types.h:typedef unsigned short __kernel_uid_t;
arch/s390/include/uapi/asm/posix_types.h:typedef unsigned short
__kernel_uid_t; # s390-32
arch/s390/include/uapi/asm/posix_types.h:typedef unsigned int
__kernel_uid_t; # s390-64
arch/sh/include/uapi/asm/posix_types_32.h:typedef unsigned short
 __kernel_uid_t;
arch/sparc/include/uapi/asm/posix_types.h:typedef unsigned short
  __kernel_uid_t; # sparc32
arch/x86/include/uapi/asm/posix_types_32.h:typedef unsigned short
 __kernel_uid_t; # i386
include/uapi/asm-generic/posix_types.h:typedef unsigned int
__kernel_uid_t; # everything else

>From what I can tell, mips64, riscv64, nios2, and microblaze are all wrong, and
the generic default would be wrong as well if picked up by anything else (but
nothing seems to use it).

        Arnd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]