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] [patch] more correct pfn_valid()

To: "Scott Parish" <srparish@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [patch] more correct pfn_valid()
From: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>
Date: Wed, 18 May 2005 23:18:22 +0100
Delivery-date: Wed, 18 May 2005 22:17:53 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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: AcVb9aZ7Rlj1GNpbTJqBIcUW7A2ChAAANsGg
Thread-topic: [Xen-devel] [patch] more correct pfn_valid()
>    #define pfn_valid(_pfn)     ((_pfn) < max_page)
> 
> Since max_page is now above the out-of-range io, the 
> pfn_valid() returns "valid". And hence get_page() is called, 
> but returns an error given that the page count is zero ("not 
> allocated") which ultimately ends up that the ioremap() for 
> several device drivers fails with ENOMEM.
> 
> While attached patch fixes this problem (from empirical 
> evidence), there may be a better solution.

I think the best fix is to have the frame_table cover the whole of
physical ram, and then mark non-ram pages in the frame_table.

To save some memory, we could map the frame_table in virtual address
space, then use __get_user when reading from it (a fault indicates a
non-ram page too)

Best,
Ian

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