Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5121997ybi; Tue, 28 May 2019 07:55:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxALbEJFShXGX/wazjit0fv4RosR/CJu+lJkc6W4bp0WXrouS7MoW6lQGx8uCMB6o/OSN29 X-Received: by 2002:a63:5726:: with SMTP id l38mr74310617pgb.344.1559055337562; Tue, 28 May 2019 07:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559055337; cv=none; d=google.com; s=arc-20160816; b=hGPFYredM9f/222ux15GoRqhqhtpv9LgPNYnM8lmlzRlXGjmjlPHpeNTc4lf148eL2 wGRAMQ48ncnQSiadOr8FavsC+SuHjNI7Xoyv3Lo2cUPotHg96Nvp5yio9BAEK+xnOMi9 0IiKtz/+Gak3YKeSTsH0MCqeuzWpMOgh4PmbgK7EqQqdWS1DxJIyLUxU3xzorykxk1nK Kfd2EsvphMsG2Jr7npn9TRH+nGfspUKCfHu3VQ2Qz1m8MrqeVoKpLIAgcIKLiKcBGOSv ke4lhbWDEZ9jqb5lqGIAqsYOnwlhj62NZCmu5pBIqdzo77G5+oql64hm20qn+6By5ERp NfVA== 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=8d74jFy6weW1l3n6RJracSmjeKOey4N+g70LbZoZ0uo=; b=TD8pTALHnI8NSX22DMNd6KiZaLxNMNpaD47oJE3X5xuSAxgTZUHWTsstSKFo5saXV3 7s3XXXou1Op2QbLS3MuxnWlOoKWV5udRMms3dSiPZTJY5FqZagvf4gy9S1/8v+EuELqn W1Fa9wej1GgfQ1qWnLnSH2oY6PkthcH6OZTapQyWGoH3ycSblN90/FyiePNyNQDazaXV W24nRoKI4sNfOELs7V1TU0ZNbx+Wkx5Z5XEr7MSCDlxrK+8/eYWfv61cx6yw0mrzOTnV R1MVLENxAppdk0m5jjOQ62HmLDtP5aciShh3//4zZMC2jF+kOgKl2v6QeGIWppJ9n7tB anxA== 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 90si22840034pla.323.2019.05.28.07.55.22; Tue, 28 May 2019 07:55:37 -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 S1726678AbfE1OyP (ORCPT + 99 others); Tue, 28 May 2019 10:54:15 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:58716 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726371AbfE1OyO (ORCPT ); Tue, 28 May 2019 10:54:14 -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 F18CC80D; Tue, 28 May 2019 07:54:13 -0700 (PDT) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 689083F5AF; Tue, 28 May 2019 07:54:13 -0700 (PDT) Date: Tue, 28 May 2019 15:54:11 +0100 From: Andrew Murray To: Catalin Marinas Cc: Andrey Konovalov , Mark Rutland , kvm@vger.kernel.org, Szabolcs Nagy , Will Deacon , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Felix Kuehling , Vincenzo Frascino , Jacob Bramley , Leon Romanovsky , linux-rdma@vger.kernel.org, amd-gfx@lists.freedesktop.org, Dmitry Vyukov , Dave Martin , Evgeniy Stepanov , linux-media@vger.kernel.org, Kevin Brodsky , Kees Cook , Ruben Ayrapetyan , Ramana Radhakrishnan , Alex Williamson , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Kostya Serebryany , Greg Kroah-Hartman , Yishai Hadas , linux-kernel@vger.kernel.org, Jens Wiklander , Lee Smith , Alexander Deucher , Andrew Morton , Robin Murphy , Christian Koenig , Luc Van Oostenryck Subject: Re: [PATCH v15 05/17] arms64: untag user pointers passed to memory syscalls Message-ID: <20190528145411.GA709@e119886-lin.cambridge.arm.com> References: <00eb4c63fefc054e2c8d626e8fedfca11d7c2600.1557160186.git.andreyknvl@google.com> <20190527143719.GA59948@MBP.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190527143719.GA59948@MBP.local> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 27, 2019 at 03:37:20PM +0100, Catalin Marinas wrote: > On Mon, May 06, 2019 at 06:30:51PM +0200, Andrey Konovalov wrote: > > This patch is a part of a series that extends arm64 kernel ABI to allow to > > pass tagged user pointers (with the top byte set to something else other > > than 0x00) as syscall arguments. > > > > This patch allows tagged pointers to be passed to the following memory > > syscalls: brk, get_mempolicy, madvise, mbind, mincore, mlock, mlock2, > > mmap, mmap_pgoff, mprotect, mremap, msync, munlock, munmap, > > remap_file_pages, shmat and shmdt. > > > > This is done by untagging pointers passed to these syscalls in the > > prologues of their handlers. > > > > Signed-off-by: Andrey Konovalov > > Actually, I don't think any of these wrappers get called (have you > tested this patch?). Following commit 4378a7d4be30 ("arm64: implement > syscall wrappers"), I think we have other macro names for overriding the > sys_* ones. What is the value in adding these wrappers? The untagged_addr macro is defined for all in linux/mm.h and these patches already use untagged_addr in generic code. Thus adding a few more untagged_addr in the generic syscall handlers (which turn to a nop for most) is surely better than adding wrappers? Even if other architectures implement untagged_addr in the future it would be more consistent if they untagged in the same places and thus not adding these wrappers enforces that. Thanks, Andrew Murray > > -- > Catalin > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel