Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1067708imm; Wed, 10 Oct 2018 08:39:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV61HHldyxuVeH0MGEHzIwrcCDLaoVymUOZ+/hhy74fodEUPurl0bdlvkaYgMk4TG1Ld3o0OK X-Received: by 2002:a62:1b45:: with SMTP id b66-v6mr35221787pfb.94.1539185964591; Wed, 10 Oct 2018 08:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539185964; cv=none; d=google.com; s=arc-20160816; b=oGwOKWKbuctkIkSA6t6XKPmbDh9i4yF8AM5efOlsCZxBh8m9OPrFQRbSWKYPRCfGMB fxBj4H6tBXPkei2LF+OIzE45sp+GhwywX4OpuGDhN0Cb1N+UtPj/p9+M3Dr7wncJVAOk 2anlYWjzwc6rGt50hsvEO0isWGDQ+n+NeZlu8oR8ksCeAv7UEywe0N70xtp/5Sw4ROUN lCPTMJOhKC8no/Qw0soBiBDNnSxi5Mo27QvMZHVpcFxJ72sJcPYSE3Ad6S+kt0uNMbjA hcu7BdT3xDWB/F7xZFgPp2HK9yOj6xED2HZGulUr0v3M8hEeZeVXMWT51lLxaRfFr47x mSfQ== 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=Yt/1eYAe+vFKufBSvnJJtTA2UtQy1fQNGNIZtYkIvzE=; b=HbsdOLDO738cSeBBUu6evYDio4WpYnH3iQY061efHR7k1dxrabbjRcZ6eHc/SYgPF/ DCoPzX+y4LgSI24A659s3boIV2QlrGpMKo4kcMXVSV+IcdXdjaMLalbqheiro6vNJpPO BPiM+GGAf4oyXjKGDgaG3AkXQ4OEJnA818ZwAsHBq5hTT9s0PJEqIQElzxt7jbJKw18S 7pxqN6Jvf3GAoyulZzhbKKNO7773l8mlgNWBhCZd0jbvTFhh3nYV7TMG4oWd1up4oXBJ wL5Pjtbo1ljQ3lKRweBhOduOqKTFwZRn+BMO95if7zzFa6e9pZdaIYwfbpi/VxrGKaug OWyg== 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 f65-v6si26124562pff.276.2018.10.10.08.39.09; Wed, 10 Oct 2018 08:39:24 -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 S1726810AbeJJW7s (ORCPT + 99 others); Wed, 10 Oct 2018 18:59:48 -0400 Received: from foss.arm.com ([217.140.101.70]:54260 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726503AbeJJW7s (ORCPT ); Wed, 10 Oct 2018 18:59:48 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 032F6ED1; Wed, 10 Oct 2018 08:37:05 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.80]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2E57E3F5B3; Wed, 10 Oct 2018 08:36:59 -0700 (PDT) Date: Wed, 10 Oct 2018 16:36:56 +0100 From: Catalin Marinas To: Eugene Syromiatnikov Cc: Yury Norov , 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 , Szabolcs Nagy , Pavel Machek , Palmer Dabbelt , Wookey Subject: Re: [PATCH v9 00/24] ILP32 for ARM64 Message-ID: <20181010153655.GA212880@arrakis.emea.arm.com> References: <20180516081910.10067-1-ynorov@caviumnetworks.com> <20180724173957.GA22106@yury-thinkpad> <20181010141017.GA2881@asgard.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181010141017.GA2881@asgard.redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 04:10:21PM +0200, Eugene Syromiatnikov wrote: > I have some questions regarding AArch64 ILP32 implementation for which I > failed to find an answer myself: > * How ptrace() tracer is supposed to distinguish between ILP32 and LP64 > tracees? For MIPS N32 and x32 this is possible based on syscall > number, but for AArch64 ILP32 I do not see such a sign. There's also > ARM_ip is employed for signalling entering/exiting, I wonder whether > it's possible to employ it also for signalling tracee's personality. With the current implementation, I don't think you can distinguish. From the kernel perspective, the register set is the same. What is the use-case for this? We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't think of a name now but probably not PER* as this implies PER_LINUX_... which is independent from TIF_32BIT_*). > * 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. We've attempted in earlier versions to allow a mix of 32 and 64-bit register values from ILP32 but it got pretty complicated. The entry code would need to know which registers need zeroing of the top 32-bit and the generic unistd.h wrapper hacks were not very nice. Some past discussions: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1211716.html -- Catalin