From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by sourceware.org (Postfix) with ESMTPS id 5E2B1385BF81 for ; Thu, 16 Apr 2020 12:53:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5E2B1385BF81 Received: by mail-il1-x141.google.com with SMTP id z12so6726221ilb.10 for ; Thu, 16 Apr 2020 05:53:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aayTfdPkB03OBxMVoa6o1y0bFPUUkwcGJFWLMYb3pgI=; b=Hv65snt3XgP0gRF0Dcp4Aj0aAI7GxumIS3E3ovhj4ozJncPXyGEQdZU+avo4M+pfix 4R+bncKUCQAEQUk7Z/0lpozw2U6jrEtxXQW+/XVKwMr810mBQVgP138pAGydqENjUt+s zUyWCN/K22qjStWgQu8/KKkoJclC92oSGwT68cHzKL3R5KsqbH3X0b09XKcXt6KuJGH2 fEKTax9Y0s0b6VxLaVdrHjK/+3qKVrOXQuzMwrCqNYuUryPBjqyBCaO39K5Y6EPacW+i XPwxO+G7KtMTrHReX6fjHz/Ywb5e5qjUsHTSjeiFK0BgrsKwKtzyStHNADHUtAvZwMSz V4iA== X-Gm-Message-State: AGi0PuZWtkZITF/viEWgs/CkNo247wd+7RAF4fra7J5Zo7aycHFAHpfI hWv2L2adDbSGySmIdW7Dsm3gcSWkC11G0MQcg0o02Tkg X-Google-Smtp-Source: APiQypKxi8M28ZsDuBMhogordlQ/d/b78sq/JgMFvz1EiN1SZDp1YuFDpCDDjZRIM05L4fxstM1ULPXAwT/r7sl5/Ho= X-Received: by 2002:a92:d5c2:: with SMTP id d2mr9813213ilq.213.1587041603688; Thu, 16 Apr 2020 05:53:23 -0700 (PDT) MIME-Version: 1.0 References: <20200413175117.170042-1-hjl.tools@gmail.com> In-Reply-To: <20200413175117.170042-1-hjl.tools@gmail.com> From: "H.J. Lu" Date: Thu, 16 Apr 2020 05:52:47 -0700 Message-ID: Subject: PING: V2 [PATCH 0/2] x32: Properly pass long to syscall [BZ #25810] To: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2020 12:53:25 -0000 On Mon, Apr 13, 2020 at 10:51 AM H.J. Lu wrote: > > X32 has 32-bit long and pointer with 64-bit off_t. Since x32 psABI > requires that pointers passed in registers must be zero-extended to > 64bit, x32 can share many syscall interfaces with LP64. When a LP64 > syscall with long and unsigned long arguments is used for x32, these > arguments must be properly extended to 64-bit. Otherwise if the upper > 32 bits of the register have undefined value, such a syscall will be > rejected by kernel. > > For syscalls implemented in assembly codes, 'U' is added to syscall > signature key letters for unsigned long. SYSCALL_ULONG_ARG_1 and > SYSCALL_ULONG_ARG_2 are passed to syscall-template.S for the first > and the second unsigned long arguments if PSEUDOS_HAVE_4_ARGS is > defined. They are used by x32 to zero-extend 32-bit arguments to > 64 bits. > > Tested on i386, x86-64 and x32 as well as with build-many-glibcs.py. > > OK for master branch? > > H.J. Lu (2): > Add SYSCALL_ULONG_ARG_[12] to pass long to syscall [BZ #25810] > Add a syscall test for [BZ #25810] > > misc/Makefile | 2 +- > misc/tst-syscalls.c | 146 ++++++++++++++++++++ > sysdeps/unix/make-syscalls.sh | 88 ++++++++++++ > sysdeps/unix/syscall-template.S | 43 +++++- > sysdeps/unix/syscalls.list | 6 +- > sysdeps/unix/sysv/linux/syscalls.list | 14 +- > sysdeps/unix/sysv/linux/x86_64/sysdep.h | 70 ++++++++-- > sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h | 20 ++- > 8 files changed, 360 insertions(+), 29 deletions(-) > create mode 100644 misc/tst-syscalls.c > PING: https://sourceware.org/pipermail/libc-alpha/2020-April/112758.html -- H.J.