From patchwork Tue Jul 4 19:53:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 107011 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1360927qge; Tue, 4 Jul 2017 12:54:20 -0700 (PDT) X-Received: by 10.99.141.76 with SMTP id z73mr17271469pgd.40.1499198060877; Tue, 04 Jul 2017 12:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499198060; cv=none; d=google.com; s=arc-20160816; b=REJm8R7T51PcW5rAistFdxBpKQXIn4bbcwzYrKdYk8TPakSJLiNlZnrfhvs0Ax4sDR Rw5QlX5E7OtflCVPOfpnTa/lZg5KiO49qu0UE+/tUoxagoMdQeRG2ncGsiB/5+z8TJJd scf+HrgQ/KIcxzTDopkMiDh+gA4HjC3xNpaefM7GzII8rUpqmd+/9tbV4i04OL0ogeYd CHXKawp2i7DF57a7StKfwagvSGWY3UwH92/Nt+AvztFq1Aj2lVFLqxL7+eXEJAShM9z3 8yjiJcssrD6kY3UrTbsw7fHYCB1BVsE6S5QT6bo2snw3udS/WLlewdOv6JHnFZUn+j+B mabQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:delivered-to:sender:list-help :list-post:list-archive:list-subscribe:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=12h9ciwQpQ3g4Flgd77a1cEiXPFCzxq0g5IafwNRa8w=; b=pKDc4DngJ4cuxurj87gWG+oHFXEmiL/15S6eCKZ6mWzEl65tm1t6xQLQWM6rTMDGYa nWhBmXXa9pFUNrJg5BPmts6wlOthh+aV8JtmD2IVmcuaoikuDop19nxJXS8um+bZZ1Ev 6bSJ2fcyw9YpubUvLhT45K31JIgd959ZqhI/E9pVvQEr9a9vreJFKF3Y8jX2RhAsdzbC 0vCzwqnOBjXASONMogmWjFPZnVQV+z7FXZWuaGV9fWulhw3m63oNdXTzBXULs2+Jqx9J u5dJfp7+qMbhArm/TTYt0VmEZnbv5GJmDG2h6l2ZIdK19e0EpKckxncoAnnNRdd8zvOW 6EiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.b=hnb8AH6V; spf=pass (google.com: domain of libc-alpha-return-81661-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-81661-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l63si6815761plb.494.2017.07.04.12.54.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 12:54:20 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-81661-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.b=hnb8AH6V; spf=pass (google.com: domain of libc-alpha-return-81661-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-81661-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=FNVeJCExc82j0kFPjb6PtkdWV27u+nr7epioN4iGnxmmOIvUiYOI0 uEYbWkKsdzze+JfEXxWhqGBHBdoZyYtWleMF6pVAa+EjoZoZ8s0I1lIfm51OQX3B pXw6KGoGjcFgsdFmUGIpF5IyTsNaHDntuCqC8aeTGE8CTMI20uzyNs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=RKM9/EHbTITAevb7xiY8CeT312M=; b=hnb8AH6Vr2o/iWdtqIvHbRsIHAdF XMK9Djl9FCaoeWXwyvzZkeQou0d+k/5PY6RmHHctS/IU7AImPYDK1wvWnlqGU2A/ vk5kIoEaAa0cH0lnsr7S2O8muo3/hvWAR2Gmf5LTkVYORDq6C90bGybbA4VBgFef TpY17yIwFYm5A28= Received: (qmail 72878 invoked by alias); 4 Jul 2017 19:54:06 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 72865 invoked by uid 89); 4 Jul 2017 19:54:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=pause, consolidation X-HELO: mail-qk0-f175.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=12h9ciwQpQ3g4Flgd77a1cEiXPFCzxq0g5IafwNRa8w=; b=neEXoDt5z3bniMflNvrg2PvQz3LHgIW7b2q1i/UHnuGeuJSykqRXHta2Icz+sBi4DL IVYQrJK1mef/vEZwc9GHbrjBIPZr6lZ5fpmEmBrpcuAby1ng03BL0TrxCiCH9O8ZTNhl e4OFOdY18s5KMnF7s8FmWRF8/jMm7DjU7u29ngtlcbq9IKs5n3eFkBUY7OuTw9oiRPAm lj5fXLrvUUvNLLyScQM1vgozadU1I1zZ4c2leCn41jbf/lGdrFZCoW6SuUS3sl0ZbvsM yalFONNk2UeF3YxFnS+CRmBuEHZ57W+pF+taM4Ai4AjFB0axA8IwvvWx7xsHqs4A8g9n o+eg== X-Gm-Message-State: AKS2vOwANYBffGgu6lhqDDRuwljT4VjY1U+5V0iXMfUYV/ohBo2xFOHw 8wW+4oRr1sms+HqU8rqCMg== X-Received: by 10.55.195.6 with SMTP id a6mr50890886qkj.114.1499198042078; Tue, 04 Jul 2017 12:54:02 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 00/14] Remove sysdep-cancel assembly macro Date: Tue, 4 Jul 2017 16:53:40 -0300 Message-Id: <1499198034-5837-1-git-send-email-adhemerval.zanella@linaro.org> - I refactored how internal non cancellable syscalls are implemented within glibc. On Linux which support cancellation instead of C prepocessor macros, proper function prototypes and implementation are used. This allows targets that requires specific handling of 64 bits arguments, such as x32, to use the correct kernel abi. -- This patchset finishes my previous work of Linux syscall consolidation and refactor to finally remove the requeriment of sysdeps-cancel.h assembly macros for cancellable syscalls. All ports now uses the SYSCALL_CANCEL macros with C implementation which in turn calls INLINE_SYSCALL macros. Besides simplify the curent code requirement, it also simplify possible future ports to require only the C bindings and the direct assembly one for syscalls.list autogeneration (another possible work for future would be to use C generate binding to simplify even further the syscall requirements). I checked with a build for mostly supported architecture: aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabhi, i686-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu, mips{64,64n32}-linux-gnu, nios2-linux-gnu, powerpc{64,64le}-linux-gnu, s390{x}-linux-gnu, sh4-linux-gnu{-soft}, tile{pro,gx}-linux-gnu{-32}, sparc{v9,64}-linux-gnu, and x86_64-linux-gnu. I also run a full make check on real hardware on aarch64-linux-gnu, arm-linux-gnueabihf, i686-linux-gnu, powerpc{64le}-linux-gnu, sparc{v9,64}-linux-gnu, and x86_64-linux-gnu{-x32}. Adhemerval Zanella (14): Consolidate non cancellable open call Consolidate non cancellable read call Consolidate non cancellable write call Consolidate non cancellable openat call Consolidate non cancellable close call Consolidate non cancellable writev call Consolidate non cancellable fcntl call Consolidate non cancellable waitpid call Consolidate non cancellable pause call Consolidate non cancellable nanosleep call Remove non cancellable sigsuspend definition Fix {INLINE,INTERNAL}_SYSCALL macros for x32 Remove p{read,write}{v} and fallocate from x86 auto-generation list Remove cancellation support for syscall generation ChangeLog | 462 +++++++++++++++++++++ catgets/open_catalog.c | 8 +- csu/check_fds.c | 2 +- gmon/gmon.c | 22 +- iconv/gconv_cache.c | 6 +- intl/loadmsgcat.c | 6 +- io/ftw.c | 8 +- libio/fileops.c | 12 +- libio/iopopen.c | 4 +- locale/loadarchive.c | 10 +- locale/loadlocale.c | 12 +- login/utmp_file.c | 30 +- misc/daemon.c | 6 +- nptl/pthread_mutex_lock.c | 2 +- nptl/pthread_mutex_timedlock.c | 2 +- nscd/nscd_getai.c | 2 +- nscd/nscd_getgr_r.c | 2 +- nscd/nscd_gethst_r.c | 2 +- nscd/nscd_getpw_r.c | 2 +- nscd/nscd_getserv_r.c | 2 +- nscd/nscd_helper.c | 4 +- nscd/nscd_initgroups.c | 2 +- nscd/nscd_netgroup.c | 4 +- nss/nss_db/db-open.c | 4 +- resolv/herror.c | 2 +- resolv/res-close.c | 4 +- stdio-common/psiginfo.c | 2 +- sunrpc/pm_getmaps.c | 2 +- sysdeps/generic/not-cancel.h | 40 +- sysdeps/mach/hurd/opendir.c | 4 +- sysdeps/posix/closedir.c | 2 +- sysdeps/posix/getaddrinfo.c | 4 +- sysdeps/posix/getcwd.c | 8 +- sysdeps/posix/libc_fatal.c | 2 +- sysdeps/posix/opendir.c | 12 +- sysdeps/posix/spawni.c | 10 +- sysdeps/unix/make-syscalls.sh | 4 - sysdeps/unix/syscall-template.S | 7 +- sysdeps/unix/sysv/linux/Versions | 2 + sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h | 87 +--- sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h | 131 +----- sysdeps/unix/sysv/linux/arm/sysdep-cancel.h | 197 +-------- sysdeps/unix/sysv/linux/check_native.c | 2 +- sysdeps/unix/sysv/linux/check_pf.c | 2 +- sysdeps/unix/sysv/linux/close.c | 8 + sysdeps/unix/sysv/linux/fips-private.h | 6 +- sysdeps/unix/sysv/linux/gethostid.c | 12 +- sysdeps/unix/sysv/linux/getloadavg.c | 6 +- sysdeps/unix/sysv/linux/getlogin_r.c | 6 +- sysdeps/unix/sysv/linux/getsysstats.c | 16 +- sysdeps/unix/sysv/linux/grantpt.c | 6 +- sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h | 236 +---------- sysdeps/unix/sysv/linux/i386/smp.h | 6 +- sysdeps/unix/sysv/linux/i386/sysdep-cancel.h | 119 +----- sysdeps/unix/sysv/linux/ia64/has_cpuclock.c | 6 +- sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h | 194 +-------- sysdeps/unix/sysv/linux/if_index.c | 6 +- sysdeps/unix/sysv/linux/libc_fatal.c | 10 +- sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h | 108 +---- sysdeps/unix/sysv/linux/malloc-sysdep.h | 8 +- sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h | 116 +----- .../unix/sysv/linux/mips/mips64/sysdep-cancel.h | 249 ----------- sysdeps/unix/sysv/linux/mips/sysdep-cancel.h | 159 +------ sysdeps/unix/sysv/linux/mq_notify.c | 2 +- sysdeps/unix/sysv/linux/nanosleep.c | 9 + sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h | 110 +---- sysdeps/unix/sysv/linux/not-cancel.h | 118 +++--- sysdeps/unix/sysv/linux/open.c | 18 + sysdeps/unix/sysv/linux/open64.c | 35 +- sysdeps/unix/sysv/linux/openat.c | 16 + sysdeps/unix/sysv/linux/openat64.c | 32 +- sysdeps/unix/sysv/linux/pause.c | 14 +- sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c | 2 +- .../sysv/linux/powerpc/powerpc32/sysdep-cancel.h | 118 ------ .../sysv/linux/powerpc/powerpc64/sysdep-cancel.h | 147 ------- sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h | 38 ++ sysdeps/unix/sysv/linux/pthread_getname.c | 6 +- sysdeps/unix/sysv/linux/pthread_setname.c | 6 +- sysdeps/unix/sysv/linux/read.c | 8 + .../unix/sysv/linux/s390/s390-32/sysdep-cancel.h | 105 +---- .../unix/sysv/linux/s390/s390-64/sysdep-cancel.h | 109 +---- sysdeps/unix/sysv/linux/sh/sysdep-cancel.h | 136 +----- .../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h | 111 ----- .../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h | 109 ----- sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 38 ++ sysdeps/unix/sysv/linux/spawni.c | 8 +- sysdeps/unix/sysv/linux/sysconf.c | 6 +- sysdeps/unix/sysv/linux/tile/sysdep-cancel.h | 123 +----- sysdeps/unix/sysv/linux/waitpid.c | 15 +- sysdeps/unix/sysv/linux/write.c | 8 + sysdeps/unix/sysv/linux/x86_64/syscalls.list | 4 - sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h | 62 +-- sysdeps/unix/sysv/linux/x86_64/sysdep.h | 251 ++++++----- sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list | 1 - sysdeps/unix/sysv/linux/x86_64/x32/times.c | 24 +- 95 files changed, 1129 insertions(+), 3077 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h create mode 100644 sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h -- 2.7.4