All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] new domain builder fix to boot domU on IA64.
@ 2007-01-30 12:26 Isaku Yamahata
  2007-01-30 14:06 ` Gerd Hoffmann
  0 siblings, 1 reply; 7+ messages in thread
From: Isaku Yamahata @ 2007-01-30 12:26 UTC (permalink / raw)
  To: xen-devel; +Cc: xen-ia64-devel

[-- Attachment #1: Type: text/plain, Size: 59 bytes --]

new domain builder fix to boot domU on IA64.

-- 
yamahata

[-- Attachment #2: 13664_6e847ce8e4a3_domain_builder_ia64.patch --]
[-- Type: text/x-diff, Size: 4774 bytes --]

# HG changeset patch
# User yamahata@valinux.co.jp
# Date 1170159530 -32400
# Node ID 6e847ce8e4a38ccc0847a1fea54fa4189ebb73fa
# Parent  94c3db4748b2bf5867a1e3585c5edeb595875de2
new domain builder fix to boot domU on IA64.
PATCHNAME: domain_builder_ia64

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

diff -r 94c3db4748b2 -r 6e847ce8e4a3 tools/libxc/xc_dom_boot.c
--- a/tools/libxc/xc_dom_boot.c	Tue Jan 30 16:51:51 2007 +0900
+++ b/tools/libxc/xc_dom_boot.c	Tue Jan 30 21:18:50 2007 +0900
@@ -155,6 +155,12 @@ static int arch_setup_early(struct xc_do
 	rc = x86_shadow(dom->guest_xc, dom->guest_domid);
     }
     return rc;
+}
+
+static int arch_setup_middle(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
 }
 
 static int arch_setup_late(struct xc_dom_image *dom)
@@ -259,6 +265,12 @@ static int arch_setup_late(struct xc_dom
 
 static int arch_setup_early(struct xc_dom_image *dom)
 {
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_middle(struct xc_dom_image *dom)
+{
     DECLARE_DOMCTL;
     int rc;
 
@@ -268,16 +280,35 @@ static int arch_setup_early(struct xc_do
     domctl.cmd = XEN_DOMCTL_arch_setup;
     domctl.domain = dom->guest_domid;
     domctl.u.arch_setup.flags = 0;
+
+    /* dom->start_info_pfn should be initialized by alloc_magic_pages().
+     * However it is called later. So we initialize here.
+     */
+    dom->start_info_pfn = dom->total_pages - 3;
     domctl.u.arch_setup.bp = (dom->start_info_pfn << PAGE_SHIFT)
 	+ sizeof(start_info_t);
-    domctl.u.arch_setup.maxmem = dom->total_pages << PAGE_SHIFT;
+    /* 3 = start info page, xenstore page and console page */
+    domctl.u.arch_setup.maxmem = (dom->total_pages - 3) << PAGE_SHIFT;
     rc = do_domctl(dom->guest_xc, &domctl);
     return rc;
 }
 
 static int arch_setup_late(struct xc_dom_image *dom)
 {
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
+    shared_info_t *shared_info;
+
+    /* setup shared_info page */
+    xc_dom_printf("%s: shared_info: mfn 0x%" PRIpfn "\n",
+		  __FUNCTION__, dom->shared_info_mfn);
+    shared_info = xc_map_foreign_range(dom->guest_xc, dom->guest_domid,
+				       page_size,
+				       PROT_READ | PROT_WRITE,
+				       dom->shared_info_mfn);
+    if (NULL == shared_info)
+	return -1;
+    dom->arch_hooks->shared_info(dom, shared_info);
+    munmap(shared_info, page_size);
     return 0;
 }
 
@@ -287,6 +318,12 @@ static int arch_setup_late(struct xc_dom
 #elif defined(__powerpc64__)
 
 static int arch_setup_early(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_middle(struct xc_dom_image *dom)
 {
     xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
     return 0;
@@ -324,6 +361,12 @@ static int arch_setup_early(struct xc_do
     return 0;
 }
 
+static int arch_setup_middle(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
 static int arch_setup_late(struct xc_dom_image *dom)
 {
     xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
@@ -395,6 +438,9 @@ int xc_dom_boot_mem_init(struct xc_dom_i
 	return rc;
     }
 
+    if (0 != (rc = arch_setup_middle(dom)))
+        return rc;
+
     return 0;
 }
 
diff -r 94c3db4748b2 -r 6e847ce8e4a3 tools/libxc/xc_dom_ia64.c
--- a/tools/libxc/xc_dom_ia64.c	Tue Jan 30 16:51:51 2007 +0900
+++ b/tools/libxc/xc_dom_ia64.c	Tue Jan 30 21:18:50 2007 +0900
@@ -26,7 +26,11 @@ static int alloc_magic_pages(struct xc_d
     /* allocate special pages */
     dom->console_pfn = dom->total_pages -1;
     dom->xenstore_pfn = dom->total_pages -2;
-    dom->start_info_pfn = dom->total_pages -3;
+
+    /*
+     * this is initialized by arch_setup_middle().
+     * dom->start_info_pfn = dom->total_pages -3;
+     */
     return 0;
 }
 
@@ -39,6 +43,7 @@ static int start_info_ia64(struct xc_dom
 
     xc_dom_printf("%s\n", __FUNCTION__);
 
+    memset(start_info, 0, sizeof(*start_info));
     sprintf(start_info->magic, dom->guest_type);
     start_info->flags = dom->flags;
     start_info->nr_pages = dom->total_pages;
@@ -54,12 +59,12 @@ static int start_info_ia64(struct xc_dom
 	bp->initrd_start = start_info->mod_start;
 	bp->initrd_size = start_info->mod_len;
     }
+    bp->command_line = (dom->start_info_pfn << PAGE_SHIFT_IA64)
+	    + offsetof(start_info_t, cmd_line);
     if (dom->cmdline)
     {
 	strncpy((char *)start_info->cmd_line, dom->cmdline, MAX_GUEST_CMDLINE);
 	start_info->cmd_line[MAX_GUEST_CMDLINE - 1] = '\0';
-	bp->command_line = (dom->start_info_pfn << PAGE_SHIFT_IA64)
-	    + offsetof(start_info_t, cmd_line);
     }
     return 0;
 }

[-- Attachment #3: 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] 7+ messages in thread

* Re: [PATCH] new domain builder fix to boot domU on IA64.
  2007-01-30 12:26 [PATCH] new domain builder fix to boot domU on IA64 Isaku Yamahata
@ 2007-01-30 14:06 ` Gerd Hoffmann
  2007-01-31  2:56   ` Isaku Yamahata
  0 siblings, 1 reply; 7+ messages in thread
From: Gerd Hoffmann @ 2007-01-30 14:06 UTC (permalink / raw)
  To: Isaku Yamahata; +Cc: xen-devel, xen-ia64-devel

> +static int arch_setup_middle(struct xc_dom_image *dom)
> +{
>      DECLARE_DOMCTL;
>      int rc;
>  
> @@ -268,16 +280,35 @@ static int arch_setup_early(struct xc_do
>      domctl.cmd = XEN_DOMCTL_arch_setup;
>      domctl.domain = dom->guest_domid;
>      domctl.u.arch_setup.flags = 0;
> +
> +    /* dom->start_info_pfn should be initialized by alloc_magic_pages().
> +     * However it is called later. So we initialize here.
> +     */
> +    dom->start_info_pfn = dom->total_pages - 3;

Is it an option to call arch_setup_middle as one of the first things in
xc_dom_boot_image()?  That would avoid the start_info_pfn trickery ...

The only thing which happens between the current and the suggested place
is that domU pages are mapped and data is copyed to them.  No other
hypercalls.

If that works out we might consider giving some more desciptive names to
the arch hooks, such as "arch_setup_{meminit,bootearly,bootlate}" or so.

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] new domain builder fix to boot domU on IA64.
  2007-01-30 14:06 ` Gerd Hoffmann
@ 2007-01-31  2:56   ` Isaku Yamahata
  2007-01-31 11:58     ` Gerd Hoffmann
  0 siblings, 1 reply; 7+ messages in thread
From: Isaku Yamahata @ 2007-01-31  2:56 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: xen-devel, xen-ia64-devel

On Tue, Jan 30, 2007 at 03:06:36PM +0100, Gerd Hoffmann wrote:
> > +static int arch_setup_middle(struct xc_dom_image *dom)
> > +{
> >      DECLARE_DOMCTL;
> >      int rc;
> >  
> > @@ -268,16 +280,35 @@ static int arch_setup_early(struct xc_do
> >      domctl.cmd = XEN_DOMCTL_arch_setup;
> >      domctl.domain = dom->guest_domid;
> >      domctl.u.arch_setup.flags = 0;
> > +
> > +    /* dom->start_info_pfn should be initialized by alloc_magic_pages().
> > +     * However it is called later. So we initialize here.
> > +     */
> > +    dom->start_info_pfn = dom->total_pages - 3;
> 
> Is it an option to call arch_setup_middle as one of the first things in
> xc_dom_boot_image()?  That would avoid the start_info_pfn trickery ...
> 
> The only thing which happens between the current and the suggested place
> is that domU pages are mapped and data is copyed to them.  No other
> hypercalls.
>
> If that works out we might consider giving some more desciptive names to
> the arch hooks, such as "arch_setup_{meminit,bootearly,bootlate}" or so.

XEN_DOMCTL_arch_setup hypercall sets up EFI memory map,
xen-faked EFI firmware and etc. So it should be called before
loading kernel/initrd images.
Presumably such setting should be loader specific.
How about adding new methods like setup_meminit, setup_firmware, setup_boot
(Or please suggest better names.) to struct xc_dom_loader?
And call setup_meminit at xc_dom_boot_mem_init(),
         setup_firmware at the beginning of xc_dom_build_image(),
         setup_boot at xc_dom_boot_image().

-- 
yamahata

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] new domain builder fix to boot domU on IA64.
  2007-01-31  2:56   ` Isaku Yamahata
@ 2007-01-31 11:58     ` Gerd Hoffmann
  2007-02-01  2:57       ` [PATCH] new domain builder setup hook clean up (was Re: [PATCH] new domain builder fix to boot domU on IA64.) Isaku Yamahata
  0 siblings, 1 reply; 7+ messages in thread
From: Gerd Hoffmann @ 2007-01-31 11:58 UTC (permalink / raw)
  To: Isaku Yamahata; +Cc: xen-devel, xen-ia64-devel

Isaku Yamahata wrote:
> XEN_DOMCTL_arch_setup hypercall sets up EFI memory map,
> xen-faked EFI firmware and etc. So it should be called before
> loading kernel/initrd images.

Why is this order important?

> How about adding new methods like setup_meminit, setup_firmware, setup_boot
> (Or please suggest better names.) to struct xc_dom_loader?

Certainly not to "struct xc_dom_loader", that one is for binary formats
such as ELF and thus architecture-independant.

Maybe we could put that into "struct xc_dom_arch".  I've intentionally
tried to keep the code which does hypercalls separately though.

> And call setup_meminit at xc_dom_boot_mem_init(),
>          setup_firmware at the beginning of xc_dom_build_image(),
>          setup_boot at xc_dom_boot_image().

Only the xc_dom_boot_*() functions are supposed to invoke hypercalls.
Thus the firmware setup can happen either at the end of
xc_dom_boot_mem_init or at the start of xc_dom_boot_image.

cheers,

  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] new domain builder setup hook clean up (was Re: [PATCH] new domain builder fix to boot domU on IA64.)
  2007-01-31 11:58     ` Gerd Hoffmann
@ 2007-02-01  2:57       ` Isaku Yamahata
  2007-02-01  7:59         ` Gerd Hoffmann
  0 siblings, 1 reply; 7+ messages in thread
From: Isaku Yamahata @ 2007-02-01  2:57 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: xen-devel, xen-ia64-devel

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

On Wed, Jan 31, 2007 at 12:58:14PM +0100, Gerd Hoffmann wrote:

> Only the xc_dom_boot_*() functions are supposed to invoke hypercalls.
> Thus the firmware setup can happen either at the end of
> xc_dom_boot_mem_init or at the start of xc_dom_boot_image.

Now I see why there are arch_setup hook and xc_dom_arch.
I hope you like the attached patch.


-- 
yamahata

[-- Attachment #2: 13764_c7633b8f3702_new_domain_builder_cleanup.patch --]
[-- Type: text/x-diff, Size: 5893 bytes --]

# HG changeset patch
# User yamahata@valinux.co.jp
# Date 1170298014 -32400
# Node ID c7633b8f37025b19d07eacea16f420aa1edfd859
# Parent  3751a96ba0217690b4f1fedc577ed4d45a7b456e
new domain builder arch_setup hook clean up.
arch_setup_early  -> arch_setup_meminit
arch_setup_middle -> arch_setup_bootearly
arch_setup_late   -> arch_setup_bootlate
PATCHNAME: new_domain_builder_cleanup

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

diff -r 3751a96ba021 -r c7633b8f3702 tools/libxc/xc_dom_boot.c
--- a/tools/libxc/xc_dom_boot.c	Thu Feb 01 11:50:48 2007 +0900
+++ b/tools/libxc/xc_dom_boot.c	Thu Feb 01 11:46:54 2007 +0900
@@ -144,7 +144,7 @@ static int x86_shadow(int xc, domid_t do
     return rc;
 }
 
-static int arch_setup_early(struct xc_dom_image *dom)
+static int arch_setup_meminit(struct xc_dom_image *dom)
 {
     int rc = 0;
 
@@ -157,13 +157,13 @@ static int arch_setup_early(struct xc_do
     return rc;
 }
 
-static int arch_setup_middle(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_late(struct xc_dom_image *dom)
+static int arch_setup_bootearly(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootlate(struct xc_dom_image *dom)
 {
     static const struct {
 	char *guest;
@@ -263,13 +263,13 @@ static int arch_setup_late(struct xc_dom
 
 #elif defined(__ia64__)
 
-static int arch_setup_early(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_middle(struct xc_dom_image *dom)
+static int arch_setup_meminit(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootearly(struct xc_dom_image *dom)
 {
     DECLARE_DOMCTL;
     int rc;
@@ -281,10 +281,6 @@ static int arch_setup_middle(struct xc_d
     domctl.domain = dom->guest_domid;
     domctl.u.arch_setup.flags = 0;
 
-    /* dom->start_info_pfn should be initialized by alloc_magic_pages().
-     * However it is called later. So we initialize here.
-     */
-    dom->start_info_pfn = dom->total_pages - 3;
     domctl.u.arch_setup.bp = (dom->start_info_pfn << PAGE_SHIFT)
 	+ sizeof(start_info_t);
     /* 3 = start info page, xenstore page and console page */
@@ -293,7 +289,7 @@ static int arch_setup_middle(struct xc_d
     return rc;
 }
 
-static int arch_setup_late(struct xc_dom_image *dom)
+static int arch_setup_bootlate(struct xc_dom_image *dom)
 {
     unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
     shared_info_t *shared_info;
@@ -317,19 +313,19 @@ static int arch_setup_late(struct xc_dom
 
 #elif defined(__powerpc64__)
 
-static int arch_setup_early(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_middle(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_late(struct xc_dom_image *dom)
+static int arch_setup_meminit(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootearly(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootlate(struct xc_dom_image *dom)
 {
     start_info_t *si =
 	xc_dom_pfn_to_ptr(dom, dom->start_info_pfn, 1);
@@ -355,19 +351,19 @@ static int arch_setup_late(struct xc_dom
 
 #else
 
-static int arch_setup_early(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_middle(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_late(struct xc_dom_image *dom)
+static int arch_setup_meminit(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootearly(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootlate(struct xc_dom_image *dom)
 {
     xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
     return 0;
@@ -423,7 +419,7 @@ int xc_dom_boot_mem_init(struct xc_dom_i
 
     xc_dom_printf("%s: called\n", __FUNCTION__);
 
-    if (0 != (rc = arch_setup_early(dom)))
+    if (0 != (rc = arch_setup_meminit(dom)))
 	return rc;
 
     /* allocate guest memory */
@@ -438,7 +434,7 @@ int xc_dom_boot_mem_init(struct xc_dom_i
 	return rc;
     }
 
-    if (0 != (rc = arch_setup_middle(dom)))
+    if (0 != (rc = arch_setup_bootearly(dom)))
         return rc;
 
     return 0;
@@ -497,6 +493,10 @@ int xc_dom_boot_image(struct xc_dom_imag
 
     xc_dom_printf("%s: called\n", __FUNCTION__);
 
+    /* misc ia64 stuff*/
+    if (0 != (rc = arch_setup_bootearly(dom)))
+	return rc;
+
     /* collect some info */
     domctl.cmd = XEN_DOMCTL_getdomaininfo;
     domctl.domain = dom->guest_domid;
@@ -542,7 +542,7 @@ int xc_dom_boot_image(struct xc_dom_imag
     xc_dom_log_memory_footprint(dom);
 
     /* misc x86 stuff */
-    if (0 != (rc = arch_setup_late(dom)))
+    if (0 != (rc = arch_setup_bootlate(dom)))
 	return rc;
 
     /* let the vm run */
diff -r 3751a96ba021 -r c7633b8f3702 tools/libxc/xc_dom_ia64.c
--- a/tools/libxc/xc_dom_ia64.c	Thu Feb 01 11:50:48 2007 +0900
+++ b/tools/libxc/xc_dom_ia64.c	Thu Feb 01 11:46:54 2007 +0900
@@ -26,11 +26,7 @@ static int alloc_magic_pages(struct xc_d
     /* allocate special pages */
     dom->console_pfn = dom->total_pages -1;
     dom->xenstore_pfn = dom->total_pages -2;
-
-    /*
-     * this is initialized by arch_setup_middle().
-     * dom->start_info_pfn = dom->total_pages -3;
-     */
+    dom->start_info_pfn = dom->total_pages -3;
     return 0;
 }
 

[-- Attachment #3: 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] 7+ messages in thread

* Re: [PATCH] new domain builder setup hook clean up (was Re: [PATCH] new domain builder fix to boot domU on IA64.)
  2007-02-01  2:57       ` [PATCH] new domain builder setup hook clean up (was Re: [PATCH] new domain builder fix to boot domU on IA64.) Isaku Yamahata
@ 2007-02-01  7:59         ` Gerd Hoffmann
  2007-02-01 11:40           ` Isaku Yamahata
  0 siblings, 1 reply; 7+ messages in thread
From: Gerd Hoffmann @ 2007-02-01  7:59 UTC (permalink / raw)
  To: Isaku Yamahata; +Cc: xen-devel, xen-ia64-devel


  Hi,

> @@ -438,7 +434,7 @@ int xc_dom_boot_mem_init(struct xc_dom_i
>  	return rc;
>      }
>  
> -    if (0 != (rc = arch_setup_middle(dom)))
> +    if (0 != (rc = arch_setup_bootearly(dom)))
>          return rc;
>  
>      return 0;

> @@ -497,6 +493,10 @@ int xc_dom_boot_image(struct xc_dom_imag
>  
>      xc_dom_printf("%s: called\n", __FUNCTION__);
>  
> +    /* misc ia64 stuff*/
> +    if (0 != (rc = arch_setup_bootearly(dom)))
> +	return rc;
> +
>      /* collect some info */
>      domctl.cmd = XEN_DOMCTL_getdomaininfo;
>      domctl.domain = dom->guest_domid;

Hmm, bootearly() is called twice now, I guess the first call in
mem_init() should have been removed?  Otherwise the patch looks fine to me.

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] new domain builder setup hook clean up (was Re: [PATCH] new domain builder fix to boot domU on IA64.)
  2007-02-01  7:59         ` Gerd Hoffmann
@ 2007-02-01 11:40           ` Isaku Yamahata
  0 siblings, 0 replies; 7+ messages in thread
From: Isaku Yamahata @ 2007-02-01 11:40 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: xen-devel, xen-ia64-devel

[-- Attachment #1: Type: text/plain, Size: 273 bytes --]

On Thu, Feb 01, 2007 at 08:59:33AM +0100, Gerd Hoffmann wrote:
> Hmm, bootearly() is called twice now, I guess the first call in
> mem_init() should have been removed?  Otherwise the patch looks fine to me.

Yes. Thanks for pointing out.
Attaced updated one.

-- 
yamahata

[-- Attachment #2: 13764_72fa33b455d1_new_domain_builder_cleanup.patch --]
[-- Type: text/x-diff, Size: 5850 bytes --]

# HG changeset patch
# User yamahata@valinux.co.jp
# Date 1170329925 -32400
# Node ID 72fa33b455d1058f15caabab1aafe6ea27fcdb43
# Parent  3751a96ba0217690b4f1fedc577ed4d45a7b456e
new domain builder arch_setup hook clean up.
arch_setup_early  -> arch_setup_meminit
arch_setup_middle -> arch_setup_bootearly
arch_setup_late   -> arch_setup_bootlate
PATCHNAME: new_domain_builder_cleanup

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

diff -r 3751a96ba021 -r 72fa33b455d1 tools/libxc/xc_dom_boot.c
--- a/tools/libxc/xc_dom_boot.c	Thu Feb 01 11:50:48 2007 +0900
+++ b/tools/libxc/xc_dom_boot.c	Thu Feb 01 20:38:45 2007 +0900
@@ -144,7 +144,7 @@ static int x86_shadow(int xc, domid_t do
     return rc;
 }
 
-static int arch_setup_early(struct xc_dom_image *dom)
+static int arch_setup_meminit(struct xc_dom_image *dom)
 {
     int rc = 0;
 
@@ -157,13 +157,13 @@ static int arch_setup_early(struct xc_do
     return rc;
 }
 
-static int arch_setup_middle(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_late(struct xc_dom_image *dom)
+static int arch_setup_bootearly(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootlate(struct xc_dom_image *dom)
 {
     static const struct {
 	char *guest;
@@ -263,13 +263,13 @@ static int arch_setup_late(struct xc_dom
 
 #elif defined(__ia64__)
 
-static int arch_setup_early(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_middle(struct xc_dom_image *dom)
+static int arch_setup_meminit(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootearly(struct xc_dom_image *dom)
 {
     DECLARE_DOMCTL;
     int rc;
@@ -281,10 +281,6 @@ static int arch_setup_middle(struct xc_d
     domctl.domain = dom->guest_domid;
     domctl.u.arch_setup.flags = 0;
 
-    /* dom->start_info_pfn should be initialized by alloc_magic_pages().
-     * However it is called later. So we initialize here.
-     */
-    dom->start_info_pfn = dom->total_pages - 3;
     domctl.u.arch_setup.bp = (dom->start_info_pfn << PAGE_SHIFT)
 	+ sizeof(start_info_t);
     /* 3 = start info page, xenstore page and console page */
@@ -293,7 +289,7 @@ static int arch_setup_middle(struct xc_d
     return rc;
 }
 
-static int arch_setup_late(struct xc_dom_image *dom)
+static int arch_setup_bootlate(struct xc_dom_image *dom)
 {
     unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
     shared_info_t *shared_info;
@@ -317,19 +313,19 @@ static int arch_setup_late(struct xc_dom
 
 #elif defined(__powerpc64__)
 
-static int arch_setup_early(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_middle(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_late(struct xc_dom_image *dom)
+static int arch_setup_meminit(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootearly(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootlate(struct xc_dom_image *dom)
 {
     start_info_t *si =
 	xc_dom_pfn_to_ptr(dom, dom->start_info_pfn, 1);
@@ -355,19 +351,19 @@ static int arch_setup_late(struct xc_dom
 
 #else
 
-static int arch_setup_early(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_middle(struct xc_dom_image *dom)
-{
-    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
-    return 0;
-}
-
-static int arch_setup_late(struct xc_dom_image *dom)
+static int arch_setup_meminit(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootearly(struct xc_dom_image *dom)
+{
+    xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
+    return 0;
+}
+
+static int arch_setup_bootlate(struct xc_dom_image *dom)
 {
     xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
     return 0;
@@ -423,7 +419,7 @@ int xc_dom_boot_mem_init(struct xc_dom_i
 
     xc_dom_printf("%s: called\n", __FUNCTION__);
 
-    if (0 != (rc = arch_setup_early(dom)))
+    if (0 != (rc = arch_setup_meminit(dom)))
 	return rc;
 
     /* allocate guest memory */
@@ -438,9 +434,6 @@ int xc_dom_boot_mem_init(struct xc_dom_i
 	return rc;
     }
 
-    if (0 != (rc = arch_setup_middle(dom)))
-        return rc;
-
     return 0;
 }
 
@@ -497,6 +490,10 @@ int xc_dom_boot_image(struct xc_dom_imag
 
     xc_dom_printf("%s: called\n", __FUNCTION__);
 
+    /* misc ia64 stuff*/
+    if (0 != (rc = arch_setup_bootearly(dom)))
+	return rc;
+
     /* collect some info */
     domctl.cmd = XEN_DOMCTL_getdomaininfo;
     domctl.domain = dom->guest_domid;
@@ -542,7 +539,7 @@ int xc_dom_boot_image(struct xc_dom_imag
     xc_dom_log_memory_footprint(dom);
 
     /* misc x86 stuff */
-    if (0 != (rc = arch_setup_late(dom)))
+    if (0 != (rc = arch_setup_bootlate(dom)))
 	return rc;
 
     /* let the vm run */
diff -r 3751a96ba021 -r 72fa33b455d1 tools/libxc/xc_dom_ia64.c
--- a/tools/libxc/xc_dom_ia64.c	Thu Feb 01 11:50:48 2007 +0900
+++ b/tools/libxc/xc_dom_ia64.c	Thu Feb 01 20:38:45 2007 +0900
@@ -26,11 +26,7 @@ static int alloc_magic_pages(struct xc_d
     /* allocate special pages */
     dom->console_pfn = dom->total_pages -1;
     dom->xenstore_pfn = dom->total_pages -2;
-
-    /*
-     * this is initialized by arch_setup_middle().
-     * dom->start_info_pfn = dom->total_pages -3;
-     */
+    dom->start_info_pfn = dom->total_pages -3;
     return 0;
 }
 

[-- Attachment #3: 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] 7+ messages in thread

end of thread, other threads:[~2007-02-01 11:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-30 12:26 [PATCH] new domain builder fix to boot domU on IA64 Isaku Yamahata
2007-01-30 14:06 ` Gerd Hoffmann
2007-01-31  2:56   ` Isaku Yamahata
2007-01-31 11:58     ` Gerd Hoffmann
2007-02-01  2:57       ` [PATCH] new domain builder setup hook clean up (was Re: [PATCH] new domain builder fix to boot domU on IA64.) Isaku Yamahata
2007-02-01  7:59         ` Gerd Hoffmann
2007-02-01 11:40           ` Isaku Yamahata

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.