From: "Scott Parish" <srparish@us.ibm.com>
To: "Nakajima, Jun" <jun.nakajima@intel.com>
Cc: Xen-devel@lists.xensource.com, Scott Parish <srparish@us.ibm.com>
Subject: [patch] clear ctxt->flags before getdomaininfo
Date: Sun, 19 Jun 2005 00:10:57 +0000 [thread overview]
Message-ID: <20050619001057.GI2912@us.ibm.com> (raw)
In-Reply-To: <7F740D512C7C1046AB53446D37200173044B32BB@scsmsx402.amr.corp.intel.com>
[-- 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
prev parent reply other threads:[~2005-06-19 0:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050619001057.GI2912@us.ibm.com \
--to=srparish@us.ibm.com \
--cc=Xen-devel@lists.xensource.com \
--cc=jun.nakajima@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.