new domain builder fix to boot domU on IA64.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
This commit is contained in:
kaf24@localhost.localdomain committed 2007-01-30 13:52:52 +00:00
1 parent 0a957ea75a
commit 2bc69bd7d9
2 files changed
+56 -5

No files matched your search

+48 -2
View File
@@ -157,6 +157,12 @@ static int arch_setup_early(struct xc_dom_image *dom)
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 const struct {
@@ -258,6 +264,12 @@ static int arch_setup_late(struct xc_dom_image *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)
{
DECLARE_DOMCTL;
int rc;
@@ -268,16 +280,35 @@ static int arch_setup_early(struct xc_dom_image *dom)
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;
}
@@ -292,6 +323,12 @@ static int arch_setup_early(struct xc_dom_image *dom)
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)
{
start_info_t *si =
@@ -324,6 +361,12 @@ static int arch_setup_early(struct xc_dom_image *dom)
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_image *dom)
return rc;
}
if (0 != (rc = arch_setup_middle(dom)))
return rc;
return 0;
}
+8 -3
View File
@@ -26,7 +26,11 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
/* 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_image *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_image *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;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.