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

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.