From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com ([192.55.52.115]:56835 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbeEBX60 (ORCPT ); Wed, 2 May 2018 19:58:26 -0400 Subject: Re: [PATCH] pkeys: Introduce PKEY_ALLOC_SIGNALINHERIT and change signal semantics References: <20180502132751.05B9F401F3041@oldenburg.str.redhat.com> <248faadb-e484-806f-1485-c34a72a9ca0b@intel.com> <822a28c9-5405-68c2-11bf-0c282887466d@redhat.com> <57459C6F-C8BA-4E2D-99BA-64F35C11FC05@amacapital.net> <6286ba0a-7e09-b4ec-e31f-bd091f5940ff@redhat.com> <2BE03B9A-B1E0-4707-8705-203F88B62A1C@amacapital.net> From: Dave Hansen Message-ID: Date: Wed, 2 May 2018 16:58:25 -0700 MIME-Version: 1.0 In-Reply-To: <2BE03B9A-B1E0-4707-8705-203F88B62A1C@amacapital.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andy Lutomirski Cc: Andy Lutomirski , Florian Weimer , Linux-MM , Linux API , linux-x86_64@vger.kernel.org, linux-arch , X86 ML , linuxram@us.ibm.com On 05/02/2018 04:32 PM, Andy Lutomirski wrote: >> But, where do those come from in this scenario? I'm not getting >> the secondary mechanism is that *makes* them unsafe. > pkey_alloc() itself. If someone tries to allocate a key with a given > default mode, unless there’s already a key that already had that > value in all threads or pkey_alloc() needs to asynchronously create > such a key. I think you are saying: If a thread calls pkey_alloc(), all threads should, by default, implicitly get access. That broadcast-to-other-threads is the thing that the current architecture doesn't do. In this situation, CPU threads have to go opt-out of getting access to data protected with a given, allocated key. Right? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id 65D9D6B000A for ; Wed, 2 May 2018 19:58:27 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id b25so14064333pfn.10 for ; Wed, 02 May 2018 16:58:27 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com. [192.55.52.136]) by mx.google.com with ESMTPS id x25si13168757pfj.347.2018.05.02.16.58.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 16:58:26 -0700 (PDT) Subject: Re: [PATCH] pkeys: Introduce PKEY_ALLOC_SIGNALINHERIT and change signal semantics References: <20180502132751.05B9F401F3041@oldenburg.str.redhat.com> <248faadb-e484-806f-1485-c34a72a9ca0b@intel.com> <822a28c9-5405-68c2-11bf-0c282887466d@redhat.com> <57459C6F-C8BA-4E2D-99BA-64F35C11FC05@amacapital.net> <6286ba0a-7e09-b4ec-e31f-bd091f5940ff@redhat.com> <2BE03B9A-B1E0-4707-8705-203F88B62A1C@amacapital.net> From: Dave Hansen Message-ID: Date: Wed, 2 May 2018 16:58:25 -0700 MIME-Version: 1.0 In-Reply-To: <2BE03B9A-B1E0-4707-8705-203F88B62A1C@amacapital.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: Andy Lutomirski Cc: Andy Lutomirski , Florian Weimer , Linux-MM , Linux API , linux-x86_64@vger.kernel.org, linux-arch , X86 ML , linuxram@us.ibm.com On 05/02/2018 04:32 PM, Andy Lutomirski wrote: >> But, where do those come from in this scenario? I'm not getting >> the secondary mechanism is that *makes* them unsafe. > pkey_alloc() itself. If someone tries to allocate a key with a given > default mode, unless therea??s already a key that already had that > value in all threads or pkey_alloc() needs to asynchronously create > such a key. I think you are saying: If a thread calls pkey_alloc(), all threads should, by default, implicitly get access. That broadcast-to-other-threads is the thing that the current architecture doesn't do. In this situation, CPU threads have to go opt-out of getting access to data protected with a given, allocated key. Right?