From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Weimer Subject: Re: [RFC PATCH] getcpu_cache system call: caching current CPU number (x86) Date: Tue, 21 Jul 2015 09:55:38 +0200 Message-ID: <55ADFAFA.7050504@redhat.com> References: <5CDDBDF2D36D9F43B9F5E99003F6A0D48D5F5DA0@PRN-MBX02-1.TheFacebook.com> <549319255.383.1437070088597.JavaMail.zimbra@efficios.com> <20150717232836.GA13604@domone> <55ACB2DC.5010503@redhat.com> <55AD14A4.6030101@redhat.com> <20150720200753.GA22333@cloud> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150720200753.GA22333@cloud> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org, Andy Lutomirski Cc: Ben Maurer , Ingo Molnar , libc-alpha , linux-api , Andrew Morton , =?UTF-8?B?T25kxZllaiBCw61sa2E=?= , rostedt , Linus Torvalds , Mathieu Desnoyers , "Paul E. McKenney" , Lai Jiangshan , Paul Turner , Andrew Hunter , Peter Zijlstra List-Id: linux-api@vger.kernel.org On 07/20/2015 10:07 PM, josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org wrote: > On Mon, Jul 20, 2015 at 10:41:09AM -0700, Andy Lutomirski wrote: >> On Mon, Jul 20, 2015 at 8:32 AM, Florian Weimer wrote: >>> On 07/20/2015 05:31 PM, Andy Lutomirski wrote: >>>> On Jul 20, 2015 1:35 AM, "Florian Weimer" wrote: >>>>> >>>>> On 07/18/2015 01:33 AM, Andy Lutomirski wrote: >>>>> >>>>>> I think the API should be "set gsbase to x + y*(cpu number)". On >>>>>> x86_64, userspace just allocates a big swath of virtual space and >>>>>> populates it as needed. >>>>> >>>>> This will break WINE and similar applications which use %gs today. >>>> >>>> Presumably WINE could just opt not to use this facility, just like >>>> WINE will have to opt out of whatever the enterprise people who want >>>> WRGSBASE were thinking of doing with it. >>> >>> How is this possible if it's process-global attribute and glibc or some >>> library in the process starts using it? >>> >> >> glibc will have to expose a way to turn it off, I guess. (ELF flag?) > > Or a way to turn it on. How is this supposed to work? Who should turn it on? It totally breaks encapsulation. We don't need any additional problems like that. -- Florian Weimer / Red Hat Product Security