Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756061AbYAYPay (ORCPT ); Fri, 25 Jan 2008 10:30:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751542AbYAYPao (ORCPT ); Fri, 25 Jan 2008 10:30:44 -0500 Received: from mx2.mail.elte.hu ([157.181.151.9]:41156 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751101AbYAYPan (ORCPT ); Fri, 25 Jan 2008 10:30:43 -0500 Date: Fri, 25 Jan 2008 16:30:32 +0100 From: Ingo Molnar To: Jeremy Fitzhardinge Cc: Harvey Harrison , Linux Kernel Mailing List , Andi Kleen Subject: Re: [PATCH UPDATE] x86: ignore spurious faults Message-ID: <20080125153032.GE11846@elte.hu> References: <4797D64D.1060105@goop.org> <1201133916.16972.124.camel@brick> <4797DBA0.5020909@goop.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4797DBA0.5020909@goop.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1203 Lines: 27 * Jeremy Fitzhardinge wrote: > When changing a kernel page from RO->RW, it's OK to leave stale TLB > entries around, since doing a global flush is expensive and they pose > no security problem. They can, however, generate a spurious fault, > which we should catch and simply return from (which will have the > side-effect of reloading the TLB to the current PTE). > > This can occur when running under Xen, because it frequently changes > kernel pages from RW->RO->RW to implement Xen's pagetable semantics. > It could also occur when using CONFIG_DEBUG_PAGEALLOC, since it avoids > doing a global TLB flush after changing page permissions. thanks, applied. it would be nice to expose this ability of the architecture to the core Linux kernel mprotect code as well, and let it skip on a TLB flush when doing a RO->RW transition. It could speed up valgrind and the other mprotect() users i guess? [and UML too perhaps] Ingo -- 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/