+.SECONDARY:
diff --git a/tools/hvm-info/main.c b/tools/hvm-info/main.c
new file mode 100644
-index 0000000..243d546
+index 0000000..f7e0119
--- /dev/null
+++ b/tools/hvm-info/main.c
-@@ -0,0 +1,31 @@
+@@ -0,0 +1,37 @@
+#include <xenctrl.h>
+#include <stdio.h>
++#include <string.h>
++#include <errno.h>
+
+int main(int argc, char **argv)
+{
++#define MAX_CPU_ID 255
+ int xc_handle;
+ xc_physinfo_t info;
++ xc_cpu_to_node_t map[MAX_CPU_ID + 1];
+ int has_hvm, has_hvm_directio;
+
+ xc_handle = xc_interface_open();
+ if (xc_handle == -1)
+ {
-+ fprintf(stderr, "xc_interface_open() failed.\n");
++ fprintf(stderr, "xc_interface_open() failed: %s.\n", strerror(errno));
+ return 1;
+ }
+
++ set_xen_guest_handle(info.cpu_to_node, map);
++ info.max_cpu_id = MAX_CPU_ID;
+ if (xc_physinfo(xc_handle, &info) != 0)
+ {
-+ fprintf(stderr, "xc_physinfo() failed.\n");
++ fprintf(stderr, "xc_physinfo() failed: %s.\n", strerror(errno));
+ return 1;
+ }
+