From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113757 invoked by alias); 4 Nov 2016 17:03:22 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 113710 invoked by uid 89); 4 Nov 2016 17:03:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-vk0-f53.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=h2uTsyRK6BZOYWZMsxBhV0RtlxDiszgAE3ne+2y0/5I=; b=dp4yFHphCcOjnsfNxxBj9VqIHkdzXaf19w8CkWTLz3YFswafjVfinjgE8JxkwaTnRY hadheqf0efkDV+Pw1EnxrBwGGSz+/WhvAzTcyi9tj8639IHhAbc+l/fj0olonmm0OfPp a1IhmOQFHhVQXE5B5ZFzaFGr+0dSkjD6/Sv5WQ7GhEJPV/Us4+3wXmAM5ZLDwlvJJilu D70pqI+NwzQb270UjTLl6PgeCAzWYiFrVgMmadED245cSKgjSCGCOJBhGol3l2Lf1ZwD YdBwzgeD8IJSV1c8r4vkhh4pcF7EL3pxoF/3fEyqUJnIwaFJAq2FINO0api7XsrFD+dD wQ+Q== X-Gm-Message-State: ABUngvcV3nYRQPPYLoWE3bh+1umSpldZDyLGQMVHIqIBrmPeXF0NzKQGrznfwv6PXqLZpyF+ X-Received: by 10.31.73.71 with SMTP id w68mr10356346vka.13.1478278989724; Fri, 04 Nov 2016 10:03:09 -0700 (PDT) Subject: Re: [PATCH v2 02/16] Consolidate Linux msgctl implementation To: Yury Norov References: <1478114813-3526-1-git-send-email-adhemerval.zanella@linaro.org> <1478114813-3526-3-git-send-email-adhemerval.zanella@linaro.org> <20161104153321.GA1271@yury-N73SV> Cc: libc-alpha@sourceware.org From: Adhemerval Zanella Message-ID: Date: Fri, 04 Nov 2016 17:03:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161104153321.GA1271@yury-N73SV> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00185.txt.bz2 On 04/11/2016 13:33, Yury Norov wrote: > On Wed, Nov 02, 2016 at 05:26:39PM -0200, Adhemerval Zanella wrote: >> Changes from previous version: >> >> - Use __ASSUME_SYSVIPC_SYSCALL instead of __NR_syscall to issue the >> wired syscall or the ipc one. >> >> -- >> >> This patch consolidates the msgctl Linux implementation in only >> one default file, sysdeps/unix/sysv/linux/msgctl.c. If tries to use >> the direct syscall if it is supported, otherwise will use the old ipc >> multiplex mechanism. >> >> The patch also simplify header inclusion and reorganize internal >> compat symbol to be built only if old ipc is defined. >> >> Checked on x86_64, i686, powerpc64le, aarch64, and armhf. >> >> * sysdeps/unix/sysv/linux/alpha/msgctl.c: Remove file. >> * sysdeps/unix/sysv/linux/arm/msgctl.c: Likewise. >> * sysdeps/unix/sysv/linux/microblaze/msgctl.c: Likewise. >> * sysdeps/unix/sysv/linux/mips/mips64/msgctl.c: Use default >> implementation. >> * sysdeps/unix/sysv/linux/msgctl.c (__new_msgctl): Use msgctl syscall >> if defined. >> --- >> ChangeLog | 8 ++++++ >> sysdeps/unix/sysv/linux/alpha/msgctl.c | 1 - >> sysdeps/unix/sysv/linux/arm/msgctl.c | 33 ---------------------- >> sysdeps/unix/sysv/linux/microblaze/msgctl.c | 1 - >> sysdeps/unix/sysv/linux/mips/mips64/msgctl.c | 17 ++--------- >> sysdeps/unix/sysv/linux/msgctl.c | 42 +++++++++++++--------------- >> 6 files changed, 30 insertions(+), 72 deletions(-) >> delete mode 100644 sysdeps/unix/sysv/linux/alpha/msgctl.c >> delete mode 100644 sysdeps/unix/sysv/linux/arm/msgctl.c >> delete mode 100644 sysdeps/unix/sysv/linux/microblaze/msgctl.c > > Hi Adhemerval, > > I'm testing your series with aarch64/ilp32 + LTP, and see regressions: > msgctl01 FAIL 1 > msgctl06 FAIL 1 > msgsnd01 FAIL 1 > semctl01 FAIL 1 > semctl07 FAIL 1 > semget01 FAIL 1 > shmat01 FAIL 1 > shmctl01 FAIL 1 > shmget01 FAIL 1 > > Regarding msgctl. objdump for libc.so shows that syscall is generated > from stub in sysdeps/unix/sysv/linux/generic/syscalls.list. > 000d0e80 : > #else > > /* This is a "normal" system call stub: if there is an error, > it returns -1 and sets errno. */ > > T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) > d0e80: d2801768 mov x8, #0xbb > // #187 > d0e84: d4000001 svc #0x0 > d0e88: b13ffc1f cmn x0, #0xfff > d0e8c: 54000042 b.cs d0e94 > > ret > d0e90: d65f03c0 ret > T_PSEUDO_END (SYSCALL_SYMBOL) > d0e94: 17fd194b b > 173c0 <__GI___syscall_error> > d0e98: d503201f nop > d0e9c: d503201f nop > > For aarch64/ilp32 to drop custom implementation, we need > to force __IPC_64, and so remove stubs for msgctl, semctl and shmctl > to let glibc find proper implementation under sysv/linux. > > The minimal fix for my regression is below. Though, I'm not sure that it's > complete, and that it will not affect other ports. BTW, grepping for > msgctl in syscalls.list files shows that they has outdated comment > which should be fixed in this series too - in arm, microblaze and mips64 ports. > > # Semaphore and shm system calls. msgctl, shmctl, and semctl have C > # wrappers (to set __IPC_64). > > Yury. > > diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list > index 5993ab4..459892d 100644 > --- a/sysdeps/unix/sysv/linux/generic/syscalls.list > +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list > @@ -2,15 +2,12 @@ > > # SysV APIs > msgget - msgget i:ii __msgget msgget > -msgctl - msgctl i:iip __msgctl msgctl > msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv > msgsnd - msgsnd Ci:ibni __msgsnd msgsnd > semget - semget i:iii __semget semget > -semctl - semctl i:iiii __semctl semctl > semtimedop - semtimedop i:ipip semtimedop > semop - semop i:ipi __semop semop > shmget - shmget i:iii __shmget shmget > -shmctl - shmctl i:iip __shmctl shmctl > shmat - shmat i:ipi __shmat shmat > shmdt - shmdt i:s __shmdt shmdt Yes, auto-generation syscall won't add the __IPC_64 required for some architectures. And that's why I have added in default implementation, since kernel will just ignore for architecture that do not require it. And I think by removing them from generic syscalls.list seems reasonable, since for some architecture. I will change my local branch accordingly.