# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID de1207b85ef88aabcfbed18b2fbfc840db6dc373
# Parent ae3a721bbcb87b6ef12c1571ed2580a6614d0475
Always pass around the store machine frame number instead of the linear address.
Also cleanup IOCTL_PRIVCMD_INITDOMAIN_STORE.
Signed-off-by: Rusty Russel <rusty@xxxxxxxxxxxxxxx>
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
diff -r ae3a721bbcb8 -r de1207b85ef8
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
--- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Wed Jul 27
17:06:02 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Wed Jul 27
17:17:09 2005
@@ -200,27 +200,29 @@
case IOCTL_PRIVCMD_INITDOMAIN_STORE:
{
extern int do_xenbus_probe(void*);
+ unsigned long page;
if (xen_start_info.store_evtchn != 0) {
- ret = -EINVAL;
+ ret = xen_start_info.store_mfn;
break;
}
/* Allocate page. */
- xen_start_info.store_page = get_zeroed_page(GFP_KERNEL);
- if (!xen_start_info.store_page) {
+ page = get_zeroed_page(GFP_KERNEL);
+ if (!page) {
ret = -ENOMEM;
break;
}
/* We don't refcnt properly, so set reserved on page.
* (this allocation is permanent) */
- SetPageReserved(virt_to_page(xen_start_info.store_page));
+ SetPageReserved(virt_to_page(page));
/* Initial connect. Setup channel and page. */
xen_start_info.store_evtchn = data;
- ret = pfn_to_mfn(virt_to_phys((void *)xen_start_info.store_page) >>
- PAGE_SHIFT);
+ xen_start_info.store_mfn = pfn_to_mfn(virt_to_phys((void *)page) >>
+ PAGE_SHIFT);
+ ret = xen_start_info.store_mfn;
/* We'll return then this will wait for daemon to answer */
kthread_run(do_xenbus_probe, NULL, "xenbus_probe");
diff -r ae3a721bbcb8 -r de1207b85ef8
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c Wed Jul 27
17:06:02 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c Wed Jul 27
17:17:09 2005
@@ -202,10 +202,11 @@
return err;
}
+ *out = machine_to_virt(xen_start_info.store_mfn << PAGE_SHIFT);
+ *in = *out + PAGE_SIZE / 2;
+
/* FIXME zero out page -- domain builder should probably do this*/
- memset((void *)xen_start_info.store_page, 0, PAGE_SIZE);
-
- *out = (void *)xen_start_info.store_page;
- *in = (void *)xen_start_info.store_page + PAGE_SIZE/2;
+ memset(*out, 0, PAGE_SIZE);
+
return 0;
}
diff -r ae3a721bbcb8 -r de1207b85ef8
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Wed Jul 27
17:06:02 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Wed Jul 27
17:17:09 2005
@@ -94,7 +94,7 @@
void xenbus_debug_write(const char *str, unsigned int count)
{
struct xsd_sockmsg msg;
- void *out = (void *)xen_start_info.store_page;
+ void *out = machine_to_virt(xen_start_info.store_mfn << PAGE_SHIFT);
msg.type = XS_DEBUG;
msg.len = sizeof("print") + count + 1;
diff -r ae3a721bbcb8 -r de1207b85ef8 tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c Wed Jul 27 17:06:02 2005
+++ b/tools/libxc/xc_linux_build.c Wed Jul 27 17:17:09 2005
@@ -500,6 +500,8 @@
goto error_out;
#endif
+ *store_mfn = page_array[(vstoreinfo_start-dsi.v_start) >> PAGE_SHIFT];
+
start_info = xc_map_foreign_range(
xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
page_array[(vstartinfo_start-dsi.v_start)>>PAGE_SHIFT]);
@@ -511,7 +513,7 @@
start_info->nr_pt_frames = nr_pt_pages;
start_info->mfn_list = vphysmap_start;
start_info->domain_controller_evtchn = control_evtchn;
- start_info->store_page = vstoreinfo_start;
+ start_info->store_mfn = *store_mfn;
start_info->store_evtchn = store_evtchn;
if ( initrd_len != 0 )
{
@@ -521,9 +523,6 @@
strncpy((char *)start_info->cmd_line, cmdline, MAX_GUEST_CMDLINE);
start_info->cmd_line[MAX_GUEST_CMDLINE-1] = '\0';
munmap(start_info, PAGE_SIZE);
-
- /* Tell our caller where we told domain store page was. */
- *store_mfn = page_array[((vstoreinfo_start-dsi.v_start)>>PAGE_SHIFT)];
/* shared_info page starts its life empty. */
shared_info = xc_map_foreign_range(
diff -r ae3a721bbcb8 -r de1207b85ef8 xen/include/public/xen.h
--- a/xen/include/public/xen.h Wed Jul 27 17:06:02 2005
+++ b/xen/include/public/xen.h Wed Jul 27 17:17:09 2005
@@ -446,7 +446,7 @@
memory_t mod_start; /* VIRTUAL address of pre-loaded module. */
memory_t mod_len; /* Size (bytes) of pre-loaded module. */
s8 cmd_line[MAX_GUEST_CMDLINE];
- memory_t store_page; /* VIRTUAL address of store page. */
+ memory_t store_mfn; /* MACHINE page number of shared page. */
u16 store_evtchn; /* Event channel for store communication. */
} start_info_t;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|