From: Mark Williamson Subject: Re: Xeno Linux never pins L1 tables ? Date: Tue, 16 Oct 2007 16:29:06 +0100 Message-ID: <200710161629.07209.mark.williamson@cl.cam.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Keir Fraser , Satya List-Id: xen-devel@lists.xenproject.org > I'm developing my own 32-bit (no PAE) paravirtualized kernel for xen with > Mini-OS as a starting point. I am currently working on process page table > support (equivalent of arch/i386/mm/pgtable-xen.c) and mostly following > Linux for the moment. I noticed that linux-2.6.18-xen never pins an L1 > table (a pte), yet __pgd_pin() walks the page directory and gives up write > access on the kernel mappings of pte pages and only pins the pgd page. How > do set_pte() and set_pte_at() macros work if they are writing directly to > the page table entires ? do we fault in the kernel to handle this ?! Xen catches the faults on writing to pagetables. In more recent versions of Xen, it traps each write and emulates it. In older versions, it will unhook the pagetable temporarily, allowing the guest to write directly to it. There's an explicit pagetable update API for guests to batch changes to pagetables rather than using trap-and-emulate if there is a large group of changes to be made. Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel!