Skip to contentSkip to conversation

support XEN_SYSCTL_numainfo

PATCH In review KUWAMURA Shin'ya 2 participants 3 messages Jun 4, 2010 – Jun 7, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support XEN_SYSCTL_numainfo

Hi,

This patch enables ia64 to support XEN_SYSCTL_numainfo.

Signature · 1 line
  KUWAMURA Shin'ya

# HG changeset patch
# User KUWAMURA Shin'ya <[email protected]> # Date 1275628873 -32400
# Node ID a43a84363bc3b6ef046aa61e3df4d9bb424d8109 # Parent d2977fcbd7e87bbfb96a2d1f11e4db6789613dde [IA64] support XEN_SYSCTL_numainfo

xen/arch/ia64/xen/dom0_ops.c +44 -0
diff -r d2977fcbd7e8 -r a43a84363bc3 xen/arch/ia64/xen/dom0_ops.c
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Hi there,

I applied this patch. The other three you sent at the same time did not apply to xen-unstable tip. Please re-base and re-submit.

Thanks,
Keir

Quoted 5 lines · KUWAMURA Shin'ya

Hi,

This patch enables ia64 to support XEN_SYSCTL_numainfo.

#2 lore raw

Hi Keir,

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

On Fri, 4 Jun 2010 11:40:37 +0100
[email protected](Keir Fraser) said:

I applied this patch. The other three you sent at the same time did not apply to xen-unstable tip. Please re-base and re-submit.

Sorry, I will re-base the patch that disables xen-hptool on ia64. However, the other two patches are for linux-2.6.18-xen.hg:

- [PATCH] ia64, xencomm: support XEN_SYSCTL_topologyinfo and XEN_SYSCTL_numainfo
http://lists.xensource.com/archives/html/xen-devel/2010-06/msg00308.html

- [PATCH] ia64, xencomm: support XEN_SYSCTL_cpupool_op
http://lists.xensource.com/archives/html/xen-devel/2010-06/msg00309.html

I confirmed they can be applied to linux-2.6.18-xen.hg 1017:948c933f8839. Could you apply them to linux-2.6.18-xen.hg?
The linux-2.6.18-xen.hg tree is still required for ia64.

Best regards,

Signature · 1 line
  KUWAMURA Shin'ya