From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH 6/9] x86, pkeys: add pkey set/get syscalls Date: Wed, 13 Jul 2016 09:56:05 +0200 Message-ID: <20160713075550.GA515@gmail.com> References: <20160707144508.GZ11498@techsingularity.net> <577E924C.6010406@sr71.net> <20160708071810.GA27457@gmail.com> <577FD587.6050101@sr71.net> <20160709083715.GA29939@gmail.com> <5783AE8F.3@sr71.net> <5783BFB0.70203@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org To: Andy Lutomirski Cc: Dave Hansen , Thomas Gleixner , Dave Hansen , Al Viro , X86 ML , Hugh Dickins , Andrew Morton , Linux API , Mel Gorman , Linus Torvalds , linux-arch , "linux-mm@kvack.org" , Arnd Bergmann , Peter Zijlstra , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" List-Id: linux-arch.vger.kernel.org * Andy Lutomirski wrote: > > If we push a PKRU value into a thread between the rdpkru() and wrpkru(), we'll > > lose the content of that "push". I'm not sure there's any way to guarantee > > this with a user-controlled register. > > We could try to insist that user code uses some vsyscall helper that tracks > which bits are as-yet-unassigned. That's quite messy, though. Actually, if we turned the vDSO into something more like a minimal user-space library with the ability to run at process startup as well to prepare stuff then it's painful to get right only *once*, and there will be tons of other areas where a proper per thread data storage on the user-space side would be immensely useful! Thanks, Ingo -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com ([74.125.82.41]:36955 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751724AbcGMH41 (ORCPT ); Wed, 13 Jul 2016 03:56:27 -0400 Date: Wed, 13 Jul 2016 09:56:05 +0200 From: Ingo Molnar Subject: Re: [PATCH 6/9] x86, pkeys: add pkey set/get syscalls Message-ID: <20160713075550.GA515@gmail.com> References: <20160707144508.GZ11498@techsingularity.net> <577E924C.6010406@sr71.net> <20160708071810.GA27457@gmail.com> <577FD587.6050101@sr71.net> <20160709083715.GA29939@gmail.com> <5783AE8F.3@sr71.net> <5783BFB0.70203@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andy Lutomirski Cc: Dave Hansen , Thomas Gleixner , Dave Hansen , Al Viro , X86 ML , Hugh Dickins , Andrew Morton , Linux API , Mel Gorman , Linus Torvalds , linux-arch , "linux-mm@kvack.org" , Arnd Bergmann , Peter Zijlstra , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" Message-ID: <20160713075605.EWhfMCYRakZtmxlCbCXToSEfW8tgaLbwEi_O8mUChT8@z> * Andy Lutomirski wrote: > > If we push a PKRU value into a thread between the rdpkru() and wrpkru(), we'll > > lose the content of that "push". I'm not sure there's any way to guarantee > > this with a user-controlled register. > > We could try to insist that user code uses some vsyscall helper that tracks > which bits are as-yet-unassigned. That's quite messy, though. Actually, if we turned the vDSO into something more like a minimal user-space library with the ability to run at process startup as well to prepare stuff then it's painful to get right only *once*, and there will be tons of other areas where a proper per thread data storage on the user-space side would be immensely useful! Thanks, Ingo