public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Mao Han <han_mao@c-sky.com>
Cc: c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com,
	 GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v4 06/13] C-SKY: Linux ABI
Date: Thu, 13 Sep 2018 08:46:00 -0000	[thread overview]
Message-ID: <CAK8P3a2rsmEN3ZL9nP_NPV-rc_XUnF1857jjW=T8yFQEbuqvLQ@mail.gmail.com> (raw)
In-Reply-To: <20180913081721.GB4004@vmh-VirtualBox>

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

  reply	other threads:[~2018-09-13  8:46 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12  2:56 [PATCH v4 00/13] port C-SKY to glibc Mao Han
     [not found] ` <cover.1536720821.git.han_mao@c-sky.com>
2018-09-12  2:56   ` [PATCH v4 02/13] C-SKY: TLS support Mao Han
2018-09-12  2:56   ` [PATCH v4 03/13] C-SKY: Math support Mao Han
2018-09-17 21:49     ` Joseph Myers
2018-09-18  6:05       ` Mao Han
2018-09-12  2:56   ` [PATCH v4 01/13] C-SKY: ABI related code Mao Han
2018-09-12  4:16     ` H.J. Lu
2018-09-12  7:07       ` Mao Han
2018-09-12  8:23         ` Florian Weimer
2018-09-12  9:06           ` Mao Han
2018-09-29  1:46           ` Palmer Dabbelt
2018-09-30  9:04             ` Manuel A. Fernandez Montecelo
2018-10-01  8:18             ` Richard W.M. Jones
2018-09-17 21:46     ` Joseph Myers
2018-09-18  6:09       ` Mao Han
2018-09-12  2:56   ` [PATCH v4 05/13] C-SKY: Linux Syscall Interface Mao Han
2018-09-12  2:57   ` [PATCH v4 09/13] C-SKY: Add dynamic relocations to elf.h Mao Han
2018-09-12  2:57   ` [PATCH v4 11/13] C-SKY: Add ABI definitions in config.h.in Mao Han
2018-09-12  2:57   ` [PATCH v4 12/13] C-SKY: Add build-many-glibcs.py support Mao Han
2018-09-12  2:57   ` [PATCH v4 06/13] C-SKY: Linux ABI Mao Han
2018-09-12 13:40     ` Arnd Bergmann
2018-09-12 14:21       ` Joseph Myers
2018-09-12 15:34         ` Arnd Bergmann
2018-09-12 21:28           ` struct elf_prstatus and Y2038 (was: Re: [PATCH v4 06/13] C-SKY: Linux ABI) Florian Weimer
2018-09-13 10:48             ` Arnd Bergmann
2018-09-13 10:56               ` struct elf_prstatus and Y2038 Florian Weimer
2018-09-13  8:17       ` [PATCH v4 06/13] C-SKY: Linux ABI Mao Han
2018-09-13  8:46         ` Arnd Bergmann [this message]
2018-09-13 15:32           ` [gnu-csky] " Joseph Myers
2018-09-13 16:35             ` Joseph Myers
2018-09-13 20:47               ` Arnd Bergmann
2018-09-13 20:59                 ` Joseph Myers
2018-09-13 21:32                   ` Arnd Bergmann
2018-09-13 22:57                     ` Joseph Myers
2018-09-13 20:31             ` Arnd Bergmann
2018-09-13 20:49               ` Joseph Myers
2018-09-13 21:38                 ` Arnd Bergmann
2018-09-12  2:57   ` [PATCH v4 13/13] C-SKY: Skeleton documentation Mao Han
2018-09-12  2:57   ` [PATCH v4 08/13] C-SKY: Linux Startup and Dynamic Loading Code Mao Han
2018-09-12  3:05   ` [PATCH v4 10/13] C-SKY: Build Infastructure Mao Han
2018-09-17 21:52     ` Joseph Myers
2018-09-18  6:02       ` Mao Han
2018-09-12  3:05   ` [PATCH v4 04/13] C-SKY: NPTL support and Atomic Mao Han
2018-09-12  3:05   ` [PATCH v4 07/13] C-SKY: ABI Lists Mao Han
2018-09-12  6:51     ` Andreas Schwab
2018-09-12  7:12       ` Mao Han
2018-09-12 12:35       ` Joseph Myers
2018-09-12 13:46         ` Andreas Schwab
2018-09-12 15:19           ` Joseph Myers
2018-09-13  8:23         ` Mao Han
2018-09-12  3:05 ` [PATCH 1/1] Update config.guess and config.sub to current versions Mao Han
2018-09-12 12:31 ` [PATCH v4 00/13] port C-SKY to glibc Joseph Myers
2018-09-13  8:14   ` Mao Han
2018-09-13 12:36     ` Joseph Myers
2018-09-18  6:22       ` Mao Han
2018-09-18  7:18         ` Mao Han
2018-09-18 11:43           ` Joseph Myers

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='CAK8P3a2rsmEN3ZL9nP_NPV-rc_XUnF1857jjW=T8yFQEbuqvLQ@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=c-sky_gcc_upstream@c-sky.com \
    --cc=gnu-csky@mentor.com \
    --cc=han_mao@c-sky.com \
    --cc=libc-alpha@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).