WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Mapping page table pages read-only

To: xen-devel list <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Mapping page table pages read-only
From: Simon Kagstrom <simon.kagstrom@xxxxxx>
Date: Tue, 02 May 2006 11:40:28 +0200
Delivery-date: Tue, 02 May 2006 02:40:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <87veso94hu.wl%simon.kagstrom@xxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <87veso94hu.wl%simon.kagstrom@xxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Wanderlust/2.15.2 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.4 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)
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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>