From: Goswin von Brederlow Subject: Re: update_va_mapping() question Date: Tue, 25 Sep 2007 13:06:01 +0200 Message-ID: <87641zatt2.fsf@informatik.uni-tuebingen.de> References: <87bqbryizj.fsf@informatik.uni-tuebingen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <87bqbryizj.fsf@informatik.uni-tuebingen.de> (Goswin von Brederlow's message of "Mon, 24 Sep 2007 21:13:36 +0200") List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Goswin von Brederlow Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Goswin von Brederlow writes: > Secondly is there an opposite call not mentioned in the interface or > could we make one? Something like > > /* Return the currently installed PTE that maps virtual address va. */ > uint64_t get_va_mapping(unsigned long va) > > Unmapped entries could give 0 or encode the level at which the lookup > failed in some unused bits. > > Or more generaly a > > /* mmu_read(): Read page table entries > * @req[i].ptr : machine address to read > * @req[i].val : on return value of that entry > * @count : size of req[] > * @success_count: number of entries read > */ > mmu_read(mmu_update_t *req, int count, int *success_count) > > MfG > Goswin I've been thinking about this a bit more and come to the conclusion that this wouldn't be too helpfull. Usualy you would have to know the result of the first mmu_read for the second and couldn't do a multi request call. E.g. when folloing the page tables down the tree. Instead something like this would be more suited i think: /* follow_va_mapping(): Return page table entries * @va : virtual address to follow * @entries[4] : on return page table entries for va * returns the number of page tables followed or error */ int follow_va_mapping(unsigned long va, pte_t entries[4]); That way a page fault handler (or others) could read out all 4 page table entries required for an address in one go without having to map page tables and without knowing their virtual addresses. Thoughts? MfG Goswin