From: Simon Kagstrom Subject: Re: Mapping page table pages read-only Date: Tue, 02 May 2006 11:40:28 +0200 Message-ID: <87u088933n.wl%simon.kagstrom@bth.se> References: <87veso94hu.wl%simon.kagstrom@bth.se> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <87veso94hu.wl%simon.kagstrom@bth.se> 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 list List-Id: xen-devel@lists.xenproject.org At Tue, 02 May 2006 11:10:21 +0200, Simon Kagstrom wrote: > > HYPERVISOR_update_va_mapping((unsigned long)page, > (pte_t){(unsigned long)phys_to_machine(page)}, > PRESENT); > > , being careful to only set bit 0 (PRESENT), which should make the > page read-only. If I do this, however, I get an access violation on > access of the page table page. Can anyone tell me what I do wrong > here? Oh dear. My fault. For reference, the error was that I placed the page flags in the update_va_mapping flags field, whereas they should be in actual entry, i.e., HYPERVISOR_update_va_mapping((unsigned long)page, (pte_t){(unsigned long)phys_to_machine(page) | FLAGS}, 0); works much better. On to the next problem! // Simon