[IA64] Map shared_info into guest pseudo physical address space

Allows libxc to map from dom0. This is used by domain builder.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
This commit is contained in:
awilliam@xenbuild2.aw committed 2006-12-07 14:49:00 -07:00
1 parent 0741834153
commit 2f96a266fe
3 files changed
+32 -20

No files matched your search

+12 -8
View File
@@ -481,9 +481,7 @@ static int setup_guest(int xc_handle,
start_info_t *start_info;
unsigned long start_info_mpa;
struct xen_ia64_boot_param *bp;
#if 0 // see comment below
shared_info_t *shared_info;
#endif
int i;
DECLARE_DOMCTL;
int rc;
@@ -595,13 +593,20 @@ static int setup_guest(int xc_handle,
ctxt->user_regs.r28 = start_info_mpa + sizeof (start_info_t);
munmap(start_info, PAGE_SIZE);
#if 0
/*
* XXX FIXME:
* The follwoing initialization is done by XEN_DOMCTL_arch_setup as
* work around.
* Should XENMEM_add_to_physmap with XENMAPSPACE_shared_info be used?
* shared_info is assiged into guest pseudo physical address space
* by XEN_DOMCTL_arch_setup. shared_info_frame is stale value until that.
* So passed shared_info_frame is stale. obtain the right value here.
*/
domctl.cmd = XEN_DOMCTL_getdomaininfo;
domctl.domain = (domid_t)dom;
if ( (xc_domctl(xc_handle, &domctl) < 0) ||
((uint16_t)domctl.domain != dom) )
{
PERROR("Could not get info on domain");
goto error_out;
}
shared_info_frame = domctl.u.getdomaininfo.shared_info_frame;
/* shared_info page starts its life empty. */
shared_info = xc_map_foreign_range(
@@ -615,7 +620,6 @@ static int setup_guest(int xc_handle,
shared_info->arch.start_info_pfn = nr_pages - 3;
munmap(shared_info, PAGE_SIZE);
#endif
free(page_array);
return 0;
+11 -11
View File
@@ -125,19 +125,19 @@ long arch_do_domctl(xen_domctl_t *op, XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
for_each_vcpu (d, v)
v->arch.breakimm = d->arch.breakimm;
}
#if 1
/*
* XXX FIXME
* see comment around shared_info in setup_guest() in
* libxc/xc_linux_build.c
*/
{
int i;
d->shared_info->arch.start_info_pfn = ds->maxmem >> PAGE_SHIFT;
for_each_cpu(i)
d->shared_info->vcpu_info[i].evtchn_upcall_mask = 1;
/*
* XXX IA64_SHARED_INFO_PADDR
* assign these pages into guest psudo physical address
* space for dom0 to map this page by gmfn.
* this is necessary for domain build, save, restore and
* dump-core.
*/
unsigned long i;
for (i = 0; i < XSI_SIZE; i += PAGE_SIZE)
assign_domain_page(d, IA64_SHARED_INFO_PADDR + i,
virt_to_maddr(d->shared_info + i));
}
#endif
}
}
+9 -1
View File
@@ -23,8 +23,16 @@ void guest_physmap_add_page(struct domain *d, unsigned long gpfn, unsigned long
} while (0)
/* XXX
* somewhere appropriate
* those constand shouldn't be pre-defined and
* those area should be reserved by EFI MD.
*/
/* Guest phsyical address of shared_info */
#define IA64_SHARED_INFO_PADDR (1UL << 40)
/* Guest physical address of the grant table. */
#define IA64_GRANT_TABLE_PADDR (1UL << 40)
#define IA64_GRANT_TABLE_PADDR (IA64_SHARED_INFO_PADDR + XSI_SIZE)
#define gnttab_shared_maddr(d, t, i) \
virt_to_maddr((char*)(t)->shared + ((i) << PAGE_SHIFT))
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.