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


Re: [Xen-devel] [PATCH] Fix mem.c so that X Windows can restart

To: "Donald D. Dugger" <donald.d.dugger@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Fix mem.c so that X Windows can restart
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Thu, 25 May 2006 21:52:07 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Jun Nakajima <jun.nakajima@xxxxxxxxx>
Delivery-date: Thu, 25 May 2006 13:57:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060525193254.GA3419@xxxxxxxxxxxxxxxxxxxx>
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: <20060525193254.GA3419@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

On 25 May 2006, at 20:32, Donald D. Dugger wrote:

This patch fixes the problem where you cannot start X Windows on Dom0 after you have created an HVM guest. The problem is that X uses `mmap' to map
1 page at physical address 0 with read/write permission.  Before an HVM
guest is created this check at around line 1496 of `mm.c':

        if ( unlikely((x & (PGT_type_mask|PGT_va_mask)) != type) )

causes the offending code from this patch to be bypassed and X's `mmap'
call works. After an HVM guest is created the check at 1496 of `mm.c' is now true and the code from this patch is executed, causing the `mmap' call to
erroneously fail.

This is totally bogus. That test (line 1496) should *never* be true for pages that are not type PGT_l*_page_table. I think some HVM code is indexing frame_table with a zero frame number and then fiddling with fields in that very first page_info structure. That's very bad -- in fact it's tempting to add some assertions about page 0 to be tested at various suitable moments to prevent this sort of bad behaviour.

 -- Keir

Xen-devel mailing list

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