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

[Xen-devel] WP flag in CR0, setting

To: xen-devel list <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] WP flag in CR0, setting
From: Simon Kagstrom <simon.kagstrom@xxxxxx>
Date: Wed, 14 Jun 2006 14:52:09 +0200
Delivery-date: Wed, 14 Jun 2006 05:51:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Wanderlust/2.15.2 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/21.4 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI)
Hello!

I have a slight problem in my guest port with the WP bit in CR0. The
original kernel maps certain kernel pages to user-mode read-only and
relies on the kernel being able to modify these despite the read-only
bit being set in the pages. This in turn requires that the WP bit is
unset in CR0.


Unfortunately, Xen doesn't allow the WP bit to be zeroed because Xen
wants to share pages read-only with the guest OS. I'm taking this up
because

  a) I would like to know if I've understood the reason for this
  limitation

  b) I'd like to discuss if the restriction could be lifted

First, from browsing the Xen code, it seems that the only pages being
shared read-only with the guest is the phys-to-machine translation
table. Is this true, or is it needed for something else as well?


To allow WP being unset, maybe something like the following could be
done. As long as WP is unchanged everything works as it does now. When the
WP bit is set,

  - A copy is made of the pages mapped read-only and one of the copies
    is kept in the Xen-protected area

  - On updates to the phys-to-machine pages, Xen updates both copies
    but only uses the "private" for it's own use

  - If the guest overwrites something in the "public" area, it will
    only suffer by itself.

The problem I see with this approach is that the space needed for the
phys-to-machine pages doubles if WP is set. Comments?

// Simon

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

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