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-ia64-devel

Re: [Xen-devel] [PATCH] xc_map_foreign_pages(), a convenient alternative

To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xc_map_foreign_pages(), a convenient alternative to xc_map_foreign_batch()
From: Markus Armbruster <armbru@xxxxxxxxxx>
Date: Mon, 10 Sep 2007 16:13:46 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 10 Sep 2007 07:14:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070910020300.GA12975%yamahata@xxxxxxxxxxxxx> (Isaku Yamahata's message of "Mon\, 10 Sep 2007 11\:03\:00 +0900")
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: <C2FDE025.1517A%Keir.Fraser@xxxxxxxxxxxx> <87hcm9cbmh.fsf@xxxxxxxxxxxxxxxxx> <20070910020300.GA12975%yamahata@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)
Isaku Yamahata <yamahata@xxxxxxxxxxxxx> writes:

> On Wed, Sep 05, 2007 at 06:36:54PM +0200, Markus Armbruster wrote:
>> The patch converts only those uses of xc_map_foreign_batch() to
>> xc_map_foreign_pages() where I'm 100% sure it's safe.  For the others,
>> I'd rather have a second opinion from somebody familiar with the code.
>> 
>> Discussion of uses:
> ...
>> * main() in tools/ioemu/vl.c, in __ia64__ code
>> 
>>   Doesn't test for mapping failure.  Likely candidate for
>>   xc_map_foreign_pages().
>
> This can't be replaced because some pages, e.g. VGA area [0xA0000, 0xC0000),
> can't be mapped.

Is it okay not to check for success?

>> * copy_from_GFW_to_nvram() in tools/libxc/ia64/xc_ia64_hvm_build.c
>> 
>>   Doesn't test for mapping failure.  Likely candidate for
>>   xc_map_foreign_pages(), but I have no way to test it.
>
> This can be replaced with xc_map_foreign_pages()
> This change will go through xen-ia64-devel.hg.
> I'll send the patch to xen-ia64-devel.

Thanks!

>> * xc_core_arch_map_p2m() in tools/libxc/xc_core_x86.c
>> 
>>   This maps a two level page directory: first a a page of pfns for the
>>   page directory (live_p2m_frame_list_list), using that pages of pfns
>>   for the pages themselves (live_p2m_frame_list), and using that the
>>   actual pages.
>> 
>>   Doesn't test for mapping failure.  Likely candidate for
>>   xc_map_foreign_pages().
>
> This can be replaced with xc_map_foreign_pages().

Obvious patch for that:

diff -r 9071521d4864 tools/libxc/xc_core_x86.c
--- a/tools/libxc/xc_core_x86.c Fri Sep 07 11:39:10 2007 +0100
+++ b/tools/libxc/xc_core_x86.c Mon Sep 10 15:26:26 2007 +0200
@@ -86,7 +86,7 @@ xc_core_arch_map_p2m(int xc_handle, xc_d
     }
 
     live_p2m_frame_list =
-        xc_map_foreign_batch(xc_handle, dom, PROT_READ,
+        xc_map_foreign_pages(xc_handle, dom, PROT_READ,
                              live_p2m_frame_list_list,
                              P2M_FLL_ENTRIES);
 
@@ -96,7 +96,7 @@ xc_core_arch_map_p2m(int xc_handle, xc_d
         goto out;
     }
 
-    *live_p2m = xc_map_foreign_batch(xc_handle, dom, PROT_READ,
+    *live_p2m = xc_map_foreign_pages(xc_handle, dom, PROT_READ,
                                     live_p2m_frame_list,
                                     P2M_FL_ENTRIES);
 

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

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