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/
Home Products Support Community News


[Xen-devel] Re: /dev/mem and /dev/kmem

To: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Subject: [Xen-devel] Re: /dev/mem and /dev/kmem
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Wed, 21 Mar 2007 16:33:27 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 21 Mar 2007 09:32:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <D470B4E54465E3469E2ABBC5AFAC390F9E133C@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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
Thread-index: AcdroM7likPLbLeXQOqVy+WGNgAmBgAE5k7gAAiPr2k=
Thread-topic: /dev/mem and /dev/kmem
User-agent: Microsoft-Entourage/
On 21/3/07 12:35, "Tian, Kevin" <kevin.tian@xxxxxxxxx> wrote:

> So how about applications which simply use /dev/mem to map
> normal domain memory? Seems this breaks compatibility
> in user level though desired for above Xserver case... Or such
> case is rare?

This case seems not to occur in practise (no complaints so far and our
/dev/mem has had this limitation since day one). This is perhaps not
surprising: really not much good can come out of direct grokking of
kernel-maintained memory without the kernel's knowledge.

> BTW, I didn't find code to protect Xen to be mapped in this path,
> like in get_page_from_l1e(). Could you help pointing out?

Not sure how you mean. Only pages that explicitly are owned by a domain and
have a non-zero refcount can have get_page() succeed on them. So random
Xen-owned pages are safe.

 -- Keir

Xen-devel mailing list

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