Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3151600imm; Sun, 14 Oct 2018 12:54:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV62e5iG7bxroAvC7zbQp579ln1OdboqovfNm4evImPhLZssrpfe1iGEtDb6QrWK/DdMlSCnj X-Received: by 2002:a63:6445:: with SMTP id y66-v6mr13685362pgb.443.1539546856843; Sun, 14 Oct 2018 12:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539546856; cv=none; d=google.com; s=arc-20160816; b=knmsJPtpZyuf4NS8jl19lARDnbjrL/3NYYrwiQ5tO3fHuCB9JydHLuhAsb/6NIYHQs 3BlYROvjApFjOf8OqXGKtDDIoUuX7Lmbj3CtqIFIp8LTZ+g3uF1tp+iNtExsJm6fIa4m yzl1b2WSMPE/xpe22sPz14a46l42jpRCcpV3R7mAh7U9/QzmpVmE6esc4Z/2EAn4h4iV SCei25SwKKLNKBqjJJyPAM+1WpRUo9Y6sZVtEL76ljrC3QIEEca6Kz5kSByh3S+S0u++ gz/504/oiZqkHwruKLFUKb9oNHMhRPQVqpujzRPzqKv/QunIaZzq/W6LoGWGx2G0gfb4 r9Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=doFYNN6dg8ppo+j0Zk07aanLk9qlmCb+R+JOhgmPces=; b=fCKtpHuUIfjQ8yEME8e4nj5nI742FAgYyxN1s2YlZzR3jD5VRgduC62orN7qrAEJly 8/5G25BR6oGZcEXo82ug+RNRt/9BmI/r4ENzhlzd6i81qmfI2whgtxzCTzAdrcP58wct mB+FNExYdjOZSwvQ3AZx2bwykrsMrMQpLGZsPPVmyZPA3WmAwn7VnH8Mt3gvLRkWaHpP G5C2ALvWV9UZrEXPvmgt7/QoQy5f1Cuxs4g3sOI6PYuWNnEPkCF2q7IW+UC5IvfDsSIC dGVPonFOVBglR99+I16/tNydBcrq1enVoSxvJXHOlQccPwAad/PKWZjW0i8P7syjg+3j 5Cvw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2-v6si7982823plr.153.2018.10.14.12.54.01; Sun, 14 Oct 2018 12:54: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726702AbeJODfq (ORCPT + 99 others); Sun, 14 Oct 2018 23:35:46 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:39704 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726375AbeJODfq (ORCPT ); Sun, 14 Oct 2018 23:35:46 -0400 Received: by mail-qt1-f194.google.com with SMTP id e22-v6so19303629qto.6; Sun, 14 Oct 2018 12:53:39 -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=doFYNN6dg8ppo+j0Zk07aanLk9qlmCb+R+JOhgmPces=; b=NOV0Ty2gUpYYkPOO1jS3ibCLHiiF+w7roqw5JM2WIr1E7tpHcKEICssxGljUIHlNMW 1QmFytEeVbLiq6Okag4H1vNKiYRd5pGJeseB9Usd24DH6WMBL+/uEoOIZg0rDhgaZSUV vjK+t4flDMSvYG9Qz9KOtrU1I2lDaC+O72lMXDsIGjfgwbK8mE61ZoXSJ7Z/dy7hXc8a za4OAz66PkjhGrAA+Y+UPMR7mR7UXVlFaFhNVtDYu4BOUJ6WQ67mYf0n4LRIgnvLpScu +Opxm9UQNE5mUkemIBfc5FUS8+NN8VoAvtb2S2mAAJD2GRCaMomGFca8F0+6kGS/aW+Y 8EvQ== X-Gm-Message-State: ABuFfoiTcbcFTlJ8IEjJEqv3e8LFRacP8zQ0oUvE3GVaRpS0Kk2NF4YT BhASoqdb3AwPHTL0y3OQE7MAFBkVgv449T1e/iU= X-Received: by 2002:ac8:2bf0:: with SMTP id n45-v6mr13913853qtn.152.1539546818882; Sun, 14 Oct 2018 12:53:38 -0700 (PDT) MIME-Version: 1.0 References: <20180516081910.10067-1-ynorov@caviumnetworks.com> <20180724173957.GA22106@yury-thinkpad> <20181010141017.GA2881@asgard.redhat.com> <7aac1a08-8948-1a04-cbd3-fbc6a53f9ff0@arm.com> <20181013020731.GD21972@asgard.redhat.com> In-Reply-To: <20181013020731.GD21972@asgard.redhat.com> From: Arnd Bergmann Date: Sun, 14 Oct 2018 21:53:22 +0200 Message-ID: Subject: Re: [PATCH v9 00/24] ILP32 for ARM64 To: Eugene Syromiatnikov Cc: Szabolcs Nagy , Yury Norov , nd@arm.com, Catalin Marinas , Linux ARM , Linux Kernel Mailing List , "open list:DOCUMENTATION" , linux-arch , Linux API , Adam Borowski , Alexander Graf , Alexey Klimov , Andreas Schwab , Andrew Pinski , Bamvor Zhangjian , Chris Metcalf , Christoph Muellner , Dave Martin , David Miller , Florian Weimer , Geert Uytterhoeven , Heiko Carstens , James Hogan , James Morse , Joseph Myers , Lin Yongting , "Manuel A. Fernandez Montecelo" , Mark Brown , Martin Schwidefsky , Maxim Kuvyrkov , Nathan Lynch , Philipp Tomsich , Prasun Kapoor , Ramana Radhakrishnan , Steve Ellcey , Pavel Machek , Palmer Dabbelt , Wookey Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 13, 2018 at 4:07 AM Eugene Syromiatnikov wrote: > > 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. I have no idea why you think this is a problem specific to aarch64-ilp32: If we want to be able to debug 64-bit tasks from a 32-bit task on any architecture that has compat mode, we should solve it once and extend the ptrace interface to allow it on *all* of them. We certainly don't need /more/ special cases for the x32 hack, there should really be fewer of them. Arnd