From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Scott Parish" Subject: [patch] clear ctxt->flags before getdomaininfo Date: Sun, 19 Jun 2005 00:10:57 +0000 Message-ID: <20050619001057.GI2912@us.ibm.com> References: <7F740D512C7C1046AB53446D37200173044B32BB@scsmsx402.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="f+W+jCU1fRNres8c" Return-path: Content-Disposition: inline In-Reply-To: <7F740D512C7C1046AB53446D37200173044B32BB@scsmsx402.amr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Nakajima, Jun" Cc: Xen-devel@lists.xensource.com, Scott Parish List-Id: xen-devel@lists.xenproject.org --f+W+jCU1fRNres8c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jun 18, 2005 at 04:48:23PM -0700, Nakajima, Jun wrote: > I think you need to set VGCF_IN_KERNEL for x86_64 domains in > xc_linux_build.c for initialization. > > For example, we are setting VGCF_VMX_GUEST in the builder > (libxc/xc_vmx_build.c) like > ctxt->flags = VGCF_VMX_GUEST; I like the attached patch a little better, but if i'm mistaken about how getdomaininfo is suppose to work, then yes, what you're suggesting is the right thing to do. Also attached is fixes for formatting nits. sRp -- Scott Parish Signed-off-by: srparish@us.ibm.com --f+W+jCU1fRNres8c Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ctxt-flags.diff" --- old-xen-build/tools/libxc/xc_linux_build.c 2005-06-09 21:15:17.000000000 +0000 +++ new-xen-build/tools/libxc/xc_linux_build.c 2005-06-19 00:45:58.000000000 +0000 @@ -486,6 +482,8 @@ int xc_linux_build(int xc_handle, return 1; } + ctxt->flags = 0; + op.cmd = DOM0_GETDOMAININFO; op.u.getdomaininfo.domain = (domid_t)domid; if ( (do_dom0_op(xc_handle, &op) < 0) || @@ -527,8 +525,6 @@ int xc_linux_build(int xc_handle, if ( image != NULL ) free(image); - ctxt->flags = 0; - /* * Initial register values: * DS,ES,FS,GS = FLAT_KERNEL_DS --f+W+jCU1fRNres8c Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xc_linux_build.diff" --- old-xen-build/tools/libxc/xc_linux_build.c 2005-06-09 21:15:17.000000000 +0000 +++ new-xen-build/tools/libxc/xc_linux_build.c 2005-06-19 00:45:58.000000000 +0000 @@ -145,8 +145,7 @@ static int setup_guest(int xc_handle, if ( (((v_end - dsi.v_start + ((1<> L2_PAGETABLE_SHIFT) + 1) <= nr_pt_pages ) break; -#endif -#if defined(__x86_64__) +#elif defined(__x86_64__) #define NR(_l,_h,_s) \ (((((_h) + ((1UL<<(_s))-1)) & ~((1UL<<(_s))-1)) - \ ((_l) & ~((1UL<<(_s))-1))) >> (_s)) @@ -263,8 +262,7 @@ static int setup_guest(int xc_handle, } munmap(vl1tab, PAGE_SIZE); munmap(vl2tab, PAGE_SIZE); -#endif -#if defined(__x86_64__) +#elif defined(__x86_64__) #define alloc_pt(ltab, vltab) \ ltab = page_array[ppt_alloc++] << PAGE_SHIFT; \ @@ -288,7 +286,7 @@ static int setup_guest(int xc_handle, if ( (vl4tab = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, l4tab >> PAGE_SHIFT)) == NULL ) - goto error_out; + goto error_out; memset(vl4tab, 0, PAGE_SIZE); vl4e = &vl4tab[l4_table_offset(dsi.v_start)]; @@ -296,34 +294,33 @@ static int setup_guest(int xc_handle, { if ( !((unsigned long)vl1e & (PAGE_SIZE-1)) ) { - alloc_pt(l1tab, vl1tab); + alloc_pt(l1tab, vl1tab); - if ( !((unsigned long)vl2e & (PAGE_SIZE-1)) ) - { - alloc_pt(l2tab, vl2tab); - if ( !((unsigned long)vl3e & (PAGE_SIZE-1)) ) - { - alloc_pt(l3tab, vl3tab); - vl3e = &vl3tab[l3_table_offset(dsi.v_start + (count<= ((vpt_start-dsi.v_start)>>PAGE_SHIFT)) && (count < ((vpt_end -dsi.v_start)>>PAGE_SHIFT)) ) { - *vl1e &= ~_PAGE_RW; + *vl1e &= ~_PAGE_RW; } - vl1e++; + vl1e++; } munmap(vl1tab, PAGE_SIZE); @@ -364,11 +361,10 @@ static int setup_guest(int xc_handle, */ if ( pin_table(xc_handle, MMUEXT_PIN_L2_TABLE, l2tab>>PAGE_SHIFT, dom) ) goto error_out; -#endif -#if defined(__x86_64__) +#elif defined(__x86_64__) /* - * Pin down l4tab addr as page dir page - causes hypervisor to provide + * Pin down l4tab addr as page dir page - causes hypervisor to provide * correct protection for the page */ if ( pin_table(xc_handle, MMUEXT_PIN_L4_TABLE, l4tab>>PAGE_SHIFT, dom) ) --f+W+jCU1fRNres8c Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --f+W+jCU1fRNres8c--