* [patch] clear ctxt->flags before getdomaininfo
2005-06-18 23:48 [patch] monitor_table is getting set to 0 for domux86_64 Nakajima, Jun
@ 2005-06-19 0:10 ` Scott Parish
0 siblings, 0 replies; 2+ messages in thread
From: Scott Parish @ 2005-06-19 0:10 UTC (permalink / raw)
To: Nakajima, Jun; +Cc: Xen-devel, Scott Parish
[-- Attachment #1: Type: text/plain, Size: 566 bytes --]
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
[-- Attachment #2: ctxt-flags.diff --]
[-- Type: text/plain, Size: 610 bytes --]
--- 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
[-- Attachment #3: xc_linux_build.diff --]
[-- Type: text/plain, Size: 3604 bytes --]
--- 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)) >>
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<<PAGE_SHIFT))];
- *vl4e = l3tab | L4_PROT;
- vl4e++;
- }
- vl2e = &vl2tab[l2_table_offset(dsi.v_start + (count<<PAGE_SHIFT))];
- *vl3e = l2tab | L3_PROT;
- vl3e++;
- }
+ 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<<PAGE_SHIFT))];
+ *vl4e++ = l3tab | L4_PROT;
+ }
+ vl2e = &vl2tab[l2_table_offset(dsi.v_start +
+ (count<<PAGE_SHIFT))];
+ *vl3e++ = l2tab | L3_PROT;
+ }
vl1e = &vl1tab[l1_table_offset(dsi.v_start + (count<<PAGE_SHIFT))];
- *vl2e = l1tab | L2_PROT;
- vl2e++;
+ *vl2e++ = l1tab | L2_PROT;
}
*vl1e = (page_array[count] << PAGE_SHIFT) | L1_PROT;
if ( (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) )
[-- Attachment #4: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread