* RE: [patch] monitor_table is getting set to 0 for domux86_64
@ 2005-06-18 23:48 Nakajima, Jun
2005-06-19 0:10 ` [patch] clear ctxt->flags before getdomaininfo Scott Parish
0 siblings, 1 reply; 2+ messages in thread
From: Nakajima, Jun @ 2005-06-18 23:48 UTC (permalink / raw)
To: Scott Parish; +Cc: Xen-devel
Scott Parish wrote:
> On Sat, Jun 18, 2005 at 07:49:11PM +0000, Scott Parish wrote:
>
>> While the attached patch takes care of the problem, and i don't
>> understand everything i know about TF_kernel_mode and
>> guest_table_user, so likely a better solution is in order. If
>> somebody wouldn't mind saying a few words about either of these, i'd
>> appreciate it.
>
> I retract said patch--after understanding more of what i knew about
> TF_kernel_mode, and looking into the syscall problem, it seems clear
> that the problem is that TF_kernel_mode isn't set.
>
> So now the question is, why is TF_kernel_mode is getting cleared by
> arch_set_info_guest()? (or why isn't VGCF_IN_KERNEL set?)
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;
>
> sRp
Jun
---
Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 2+ messages in thread
* [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
end of thread, other threads:[~2005-06-19 0:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-18 23:48 [patch] monitor_table is getting set to 0 for domux86_64 Nakajima, Jun
2005-06-19 0:10 ` [patch] clear ctxt->flags before getdomaininfo Scott Parish
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.