Hi,
This patch enables ia64 to support XEN_SYSCTL_numainfo.
Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
--
KUWAMURA Shin'ya
# HG changeset patch
# User KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
# Date 1275628873 -32400
# Node ID a43a84363bc3b6ef046aa61e3df4d9bb424d8109
# Parent d2977fcbd7e87bbfb96a2d1f11e4db6789613dde
[IA64] support XEN_SYSCTL_numainfo
Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
diff -r d2977fcbd7e8 -r a43a84363bc3 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c Fri Jun 04 12:05:55 2010 +0900
+++ b/xen/arch/ia64/xen/dom0_ops.c Fri Jun 04 14:21:13 2010 +0900
@@ -803,6 +803,50 @@ long arch_do_sysctl(xen_sysctl_t *op, XE
}
break;
+ case XEN_SYSCTL_numainfo:
+ {
+ uint32_t i, j, max_node_index, last_online_node;
+ xen_sysctl_numainfo_t *ni = &op->u.numainfo;
+
+ last_online_node = last_node(node_online_map);
+ max_node_index = min_t(uint32_t, ni->max_node_index, last_online_node);
+ ni->max_node_index = last_online_node;
+
+ for (i = 0; i <= max_node_index; i++) {
+ if (!guest_handle_is_null(ni->node_to_memsize)) {
+ uint64_t memsize = node_online(i) ?
+ node_memblk[i].size << PAGE_SHIFT : 0ul;
+ if (copy_to_guest_offset(ni->node_to_memsize, i, &memsize, 1))
+ break;
+ }
+ if (!guest_handle_is_null(ni->node_to_memfree)) {
+ uint64_t memfree = node_online(i) ?
+ avail_node_heap_pages(i) << PAGE_SHIFT :
0ul;
+ if (copy_to_guest_offset(ni->node_to_memfree, i, &memfree, 1))
+ break;
+ }
+
+ if (!guest_handle_is_null(ni->node_to_node_distance)) {
+ for (j = 0; j <= max_node_index; j++) {
+ uint32_t distance = ~0u;
+ if (node_online(i) && node_online (j))
+ distance = node_distance(i, j);
+
+ if (copy_to_guest_offset(
+ ni->node_to_node_distance,
+ i*(max_node_index+1) + j, &distance, 1))
+ break;
+ }
+ if (j <= max_node_index)
+ break;
+ }
+ }
+
+ ret = ((i <= max_node_index) || copy_to_guest(u_sysctl, op, 1))
+ ? -EFAULT : 0;
+ }
+ break;
+
default:
printk("arch_do_sysctl: unrecognized sysctl: %d!!!\n",op->cmd);
ret = -ENOSYS;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|