Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1441515imm; Fri, 12 Oct 2018 19:09:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV62FJq7xy6/6nPlZn9goQyNgHtZdwEk0pxtGZM5R7fw203RK7ApeVNUmY/8L5p7yz6wDrk53 X-Received: by 2002:a17:902:8690:: with SMTP id g16-v6mr7878771plo.302.1539396556934; Fri, 12 Oct 2018 19:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539396556; cv=none; d=google.com; s=arc-20160816; b=rRHvtkQG7BQp8asllDpwrHCCuaTEupXNdc7ZCEREzigQ8GLn+5QO1m+HGEilxMKQYV wOagMpc5qJ5DTZRFOSmvC7mnSADwLv4y7Ptgl/CYCewRauxGx1JAaGHylfamCXtxnzQN L53QFaSx2Xf15a+c3+Qorbi+v5pP4s1aa4IdtbXXO/d+mFk8CSCci1xMyJyqZ17wYRLi 9d+0DtDaITU4e143rAeHunuwGfvwe0e2U89CbAwpghh9f4R8+t2zl0bSB0h+KKFaQh4g QVSM4PDLfxxFiyXBSF4qQkV4l31Gb7xNjYP1+E1VJMyylxf6MJm9eOR4mW7/7+6m5CD2 tI/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Te+6GF7VigKIH7Mc7jqrdCI62+GasGmm+VoTzxsg3uc=; b=fe5tWIDT3qSUmNJ9551CwS5dcHGWQ5xX+nIS1/5VBufh7/ZgKNzB0Xe4fvMcRtztO+ rI7dqCFBCRhnPpLcZ1baehmxirS91wp6SbShLiit4BFctqXY8Xo3WzCJcXToWzEB7HU1 GE3P2Kep2S/lzdmO0MGMzFQkFOXEp7gYsCp16az3c13S8PbmaUQLsuYt9WQ/5MDPvc4c qzP9XjRMDRGff7mhX9znXc3VSXDW+ib4d5KgoMravGo4mcsa8uyRtK9Svd38yKFAm2h/ oV85vC25VnBWOdnGNqDOr4m/vAODBHlYYLSx2Kf82r7cPqjBxcRF9asJcWoqH/93WllY Qc3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k123-v6si3345954pfc.150.2018.10.12.19.09.01; Fri, 12 Oct 2018 19:09:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727155AbeJMJmh (ORCPT + 99 others); Sat, 13 Oct 2018 05:42:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42716 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbeJMJmg (ORCPT ); Sat, 13 Oct 2018 05:42:36 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 676FB300188D; Sat, 13 Oct 2018 02:07:21 +0000 (UTC) Received: from asgard.redhat.com (ovpn-200-28.brq.redhat.com [10.40.200.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9841D1C935; Sat, 13 Oct 2018 02:07:09 +0000 (UTC) Date: Sat, 13 Oct 2018 04:07:31 +0200 From: Eugene Syromiatnikov To: Szabolcs Nagy Cc: Yury Norov , nd@arm.com, Catalin Marinas , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Adam Borowski , Alexander Graf , Alexey Klimov , Andreas Schwab , Andrew Pinski , Bamvor Zhangjian , Chris Metcalf , Christoph Muellner , Dave Martin , "David S . Miller" , Florian Weimer , Geert Uytterhoeven , Heiko Carstens , James Hogan , James Morse , Joseph Myers , Lin Yongting , Manuel Montezelo , Mark Brown , Martin Schwidefsky , Maxim Kuvyrkov , Nathan_Lynch , Philipp Tomsich , Prasun Kapoor , Ramana Radhakrishnan , Steve Ellcey , Pavel Machek , Palmer Dabbelt , Wookey Subject: Re: [PATCH v9 00/24] ILP32 for ARM64 Message-ID: <20181013020731.GD21972@asgard.redhat.com> References: <20180516081910.10067-1-ynorov@caviumnetworks.com> <20180724173957.GA22106@yury-thinkpad> <20181010141017.GA2881@asgard.redhat.com> <7aac1a08-8948-1a04-cbd3-fbc6a53f9ff0@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7aac1a08-8948-1a04-cbd3-fbc6a53f9ff0@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 13 Oct 2018 02:07:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote: > On 10/10/18 15:10, Eugene Syromiatnikov wrote: > > * What's the reasoning behind capping syscall arguments to 32 bit? x32 > > and MIPS N32 do not have such a restriction (and do not need special > > wrappers for syscalls that pass 64-bit values as a result, except > > when they do, as it is the case for preadv2 on x32); moreover, that > > would lead to insurmountable difficulties for AArch64 ILP32 tracers > > that try to trace LP64 tracees, as it would be impossible to pass > > 64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE. > > but that's necessarily the case for all ilp32 abis: > the userspace syscall function receives 32bit > arguments so even if the kernel abi takes 64bit > args you cannot use that from c code. (the libc > does not even know which args should be sign or > zero extended.) glibc's syscall() prototype has kernel_ulong_t as its arguments (more specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it should also have kernel_long_t as its return type instead of long, but that's another story), so it works perfectly fine in case of x32. > process_vm_readv/writev is limited by the ilp32 > iovec struct, not by the syscall arguments. Right, on x32/N32 this issue is worked around by the usage of the respective x86_64/N64 call, and it looks like another thing that is impossible with AArch64 ilp32. > ptrace is specified to take void* addr argument, > and void* is 32bit on all ilp32 targets. > so again on the c language level there is no > way around the 32bit limitation. Which is an issue.