Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751638AbbEGTk1 (ORCPT ); Thu, 7 May 2015 15:40:27 -0400 Received: from www.sr71.net ([198.145.64.142]:36442 "EHLO blackbird.sr71.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751118AbbEGTk0 (ORCPT ); Thu, 7 May 2015 15:40:26 -0400 Message-ID: <554BBFA8.3010607@sr71.net> Date: Thu, 07 May 2015 12:40:24 -0700 From: Dave Hansen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Ingo Molnar , One Thousand Gnomes CC: linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 00/12] [RFC] x86: Memory Protection Keys References: <20150507174132.34AF8FAF@viggo.jf.intel.com> <20150507175707.GA22172@gmail.com> <554BAA68.6000508@sr71.net> <20150507201843.0ccf0938@lxorguk.ukuu.org.uk> <20150507192619.GA23338@gmail.com> In-Reply-To: <20150507192619.GA23338@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1304 Lines: 28 On 05/07/2015 12:26 PM, Ingo Molnar wrote: > The Valgrind usecase looks somewhat legit, albeit not necessarily for > multithreaded apps: there you generally really want protection changes > to be globally visible, such as publishing the effects of free() or > malloc(). I guess we could theoretically have an IPC of some kind that voluntarily broadcasts changes so that we can be guaranteed that other threads see it. > Also, will apps/libraries bother if it's not a standard API and if it > only runs on very fresh CPUs? It's always a problem with new CPU features. I've thought a bit about trying to "emulate" the feature on older CPUs using good ol' mprotect() so that we could have an API that folks can use _today_, but that would get magically fast on future CPUs. But, the problem with that is the thread-local aspect. mprotect() is fundamentally process-wide and protection keys right are fundamentally thread-local. Those things are going to be hard to reconcile unless we do something slightly extreme like having per-thread page tables. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/