From: Markus Armbruster Subject: Re: [PATCH] xc_map_foreign_pages(), a convenient alternative to xc_map_foreign_batch() Date: Mon, 10 Sep 2007 16:13:46 +0200 Message-ID: <87tzq2621x.fsf@pike.pond.sub.org> References: <87hcm9cbmh.fsf@pike.pond.sub.org> <20070910020300.GA12975%yamahata@valinux.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <20070910020300.GA12975%yamahata@valinux.co.jp> (Isaku Yamahata's message of "Mon\, 10 Sep 2007 11\:03\:00 +0900") List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Isaku Yamahata Cc: xen-devel@lists.xensource.com, xen-ia64-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Isaku Yamahata 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);