From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-f198.google.com (mail-it1-f198.google.com [209.85.166.198]) by kanga.kvack.org (Postfix) with ESMTP id C7C486B0007 for ; Wed, 10 Oct 2018 10:09:27 -0400 (EDT) Received: by mail-it1-f198.google.com with SMTP id n132-v6so5627558itn.2 for ; Wed, 10 Oct 2018 07:09:27 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id n11-v6sor8515138iop.37.2018.10.10.07.09.26 for (Google Transport Security); Wed, 10 Oct 2018 07:09:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20181003173256.GG12998@arrakis.emea.arm.com> References: <47a464307d4df3c0cb65f88d1fe83f9a741dd74b.1538485901.git.andreyknvl@google.com> <20181003173256.GG12998@arrakis.emea.arm.com> From: Andrey Konovalov Date: Wed, 10 Oct 2018 16:09:25 +0200 Message-ID: Subject: Re: [PATCH v7 7/8] arm64: update Documentation/arm64/tagged-pointers.txt Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Catalin Marinas Cc: Will Deacon , Mark Rutland , Robin Murphy , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Linux ARM , "open list:DOCUMENTATION" , Linux Memory Management List , linux-arch , "open list:KERNEL SELFTEST FRAMEWORK" , LKML , Chintan Pandya , Jacob Bramley , Ruben Ayrapetyan , Lee Smith , Kostya Serebryany , Dmitry Vyukov , Ramana Radhakrishnan , Luc Van Oostenryck , Evgeniy Stepanov On Wed, Oct 3, 2018 at 7:32 PM, Catalin Marinas wrote: > On Tue, Oct 02, 2018 at 03:12:42PM +0200, Andrey Konovalov wrote: >> diff --git a/Documentation/arm64/tagged-pointers.txt b/Documentation/arm64/tagged-pointers.txt >> index a25a99e82bb1..ae877d185fdb 100644 >> --- a/Documentation/arm64/tagged-pointers.txt >> +++ b/Documentation/arm64/tagged-pointers.txt >> @@ -17,13 +17,21 @@ this byte for application use. >> Passing tagged addresses to the kernel >> -------------------------------------- >> >> -All interpretation of userspace memory addresses by the kernel assumes >> -an address tag of 0x00. >> +Some initial work for supporting non-zero address tags passed to the >> +kernel has been done. As of now, the kernel supports tags in: > > With my maintainer hat on, the above statement leads me to think this > new ABI is work in progress, so not yet suitable for upstream. OK, I think we can just say "The kernel supports tags in:" here. Will do in v8. > > Also, how is user space supposed to know that it can now pass tagged > pointers into the kernel? An ABI change (or relaxation), needs to be > advertised by the kernel, usually via a new HWCAP bit (e.g. HWCAP_TBI). > Once we have a HWCAP bit in place, we need to be pretty clear about > which syscalls can and cannot cope with tagged pointers. The "as of now" > implies potential further relaxation which, again, would need to be > advertised to user in some (additional) way. How exactly should I do that? Something like this [1]? Or is it only for hardware specific things and for this patchset I need to do something else? [1] https://github.com/torvalds/linux/commit/7206dc93a58fb76421c4411eefa3c003337bcb2d > >> -This includes, but is not limited to, addresses found in: >> + - user fault addresses > > While the kernel currently supports this in some way (by clearing the > tag exception entry, el0_da), the above implies (at least to me) that > sigcontext.fault_address would contain the tagged address. That's not > the case (unless I missed it in your patches). I'll update the doc to reflect this in v8. > >> - - pointer arguments to system calls, including pointers in structures >> - passed to system calls, >> + - pointer arguments (including pointers in structures), which don't >> + describe virtual memory ranges, passed to system calls > > I think we need to be more precise here... In what way? > >> +All other interpretations of userspace memory addresses by the kernel >> +assume an address tag of 0x00. This includes, but is not limited to, >> +addresses found in: >> + >> + - pointer arguments (including pointers in structures), which describe >> + virtual memory ranges, passed to memory system calls (mmap, mprotect, >> + etc.) > > ...and probably a full list here. Will add a full list in v8.