Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762717AbYAYI4t (ORCPT ); Fri, 25 Jan 2008 03:56:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756311AbYAYI4e (ORCPT ); Fri, 25 Jan 2008 03:56:34 -0500 Received: from mta2.cl.cam.ac.uk ([128.232.0.14]:52502 "EHLO mta2.cl.cam.ac.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753944AbYAYI4d (ORCPT ); Fri, 25 Jan 2008 03:56:33 -0500 X-Greylist: delayed 4792 seconds by postgrey-1.27 at vger.kernel.org; Fri, 25 Jan 2008 03:56:33 EST User-Agent: Microsoft-Entourage/11.3.6.070618 Date: Fri, 25 Jan 2008 07:36:42 +0000 Subject: Re: [PATCH UPDATE] x86: ignore spurious faults From: Keir Fraser To: Jeremy Fitzhardinge , Nick Piggin CC: Matt Mackall , Harvey Harrison , Ingo Molnar , Linux Kernel Mailing List , Andi Kleen , Jan Beulich Message-ID: Thread-Topic: [PATCH UPDATE] x86: ignore spurious faults Thread-Index: AchfJQc+RasJYssYEdyw+AAWy6hiGQ== In-Reply-To: <47992CB2.8050606@goop.org> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1096 Lines: 26 On 25/1/08 00:26, "Jeremy Fitzhardinge" wrote: >> I (obviously) don't know exactly how the TLB works in x86, but I >> thought that on a miss, the CPU walks the pagetables first before >> faulting? Maybe that's not the case if there is an RO entry >> actually in the TLB? >> > > My understanding is that it will fault immediately if there's a TLB > entry, and rewalk the tables on return from the fault before restarting > the instruction, so there's no need for an explicit TLB flush. The TLB > doesn't have a notion of negative cache entries, so any entry represents > a present page of some variety. Yes, write access with a r/o TLB entry causes the TLB entry to be flushed and an immediate #PF with no page walk. This is a hardware optimisation for copy-on-write demand faults. Both Intel and AMD implement it. -- Keir -- 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/