From: Leendert van Doorn Subject: [PATCH] tools/libxc/xc_vmx_build.c broken Date: Sat, 02 Apr 2005 01:20:12 -0500 Message-ID: <20050402062012.4B87E106B@huxley.watson.ibm.com> Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org xc_vmx_build pins the level 2 page table too early so that subsequent maps (like those in zap_mmio_ranges) fail and consequently xc_vmx_build fails. To solve this, this patch pins the l2pt at the end of the function when all memory initializations are finalized. Signed-off-by: Leendert van Doorn --- tools/libxc/xc_vmx_build.c.orig 2005-04-02 01:08:28.000000000 -0500 +++ tools/libxc/xc_vmx_build.c 2005-04-02 01:09:45.000000000 -0500 @@ -329,13 +329,6 @@ munmap(vl1tab, PAGE_SIZE); munmap(vl2tab, PAGE_SIZE); - /* - * Pin down l2tab addr as page dir page - causes hypervisor to provide - * correct protection for the page - */ - if ( pin_table(xc_handle, MMUEXT_PIN_L2_TABLE, l2tab>>PAGE_SHIFT, dom) ) - goto error_out; - if ((boot_paramsp = xc_map_foreign_range( xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, page_array[(vboot_params_start-dsi.v_start)>>PAGE_SHIFT])) == 0) @@ -428,6 +421,13 @@ shared_info->vcpu_data[i].evtchn_upcall_mask = 1; munmap(shared_info, PAGE_SIZE); + /* + * Pin down l2tab addr as page dir page - causes hypervisor to provide + * correct protection for the page + */ + if ( pin_table(xc_handle, MMUEXT_PIN_L2_TABLE, l2tab>>PAGE_SHIFT, dom) ) + goto error_out; + /* Send the page update requests down to the hypervisor. */ if ( finish_mmu_updates(xc_handle, mmu) ) goto error_out;