[libvirt] [RFC v5 PATCH 0/5] PowerPC : Extend Libvirt for PowerPC architecture

Libvirt continues to be the key interface to configure and manage the KVM guest instances on x86. This patch set is an effort to enable libvirt to support KVM guest configuration and management on Power Book3S machines. Based on community discussion around the earlier version, this patch series augments the present 'kvm' driver to support PowerPC-KVM based guests. With the CPU driver for PowerPC already merged, this patch series adds on clean-ups, and some test cases as suggested. This series mostly focuses on cleanup and addition of testcases for base- powerpc patches. The patches for enabling spapr-vio based addressing would be sent out shortly, with the right domain schema additions. Series description: ------------------- Patch 1/5 : Use sysfs to decipher cpu topology information. Patch 2/5 : Modify the tests/nodeinfotest.c to use sysfs in addition to proc/cpuinfo. Patch 3/5 : Add support for ppc64 qemu Patch 4/5 : Clean up qemuBuildCommandLine to remove x86-specific assumptions. Patch 5/5 : Add ppc64 specific definitions to domain.rng Changelog: ---------- ** v1->v2 : * Patches 1,2,3 unchanged ; The hacks in Patch 4 of v1 replaced by a new patch to neatly select arch-specific features. ** v2->v3 : * Patches 1,2,3 have minor cleanups ; Patch 4 no longer has an arch-specific handler routine. It is now replaced by a much simpler patch that merely removes x86/pc-specific assumptions from libvirt. Patch 5 is a new addition from Michael Ellerman that adds a new device-tree based addressing mechanism for the 'pseries' guest. ** v3->v4 : * Patch 1 has minor cleanups, Patch 2 is a new addition that introduces test cases for patch 1. Patch 3,4 also have minor cleanups Patch 5 is a new addition, it contains ppc64 specific definitions to domain.rng ** v4->v5 : * Patch 1 fixes some issues that were causing testcase (patch 2) to fail. Patch 2 has minor cleanups. Patch 3 unchanged. Patch 4 has a whitespace cleanup. Patch 5 is a subset of the original patch, it contains ppc64 specific additions to domain.rng -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Mon, 3 Oct 2011 05:45:30 -0700 Subject: [PATCH 1/5] Use sysfs to gather host topology, in place of /proc/cpuinfo Libvirt at present depends on /proc/cpuinfo to gather host details such as CPUs, cores, threads, etc. This is an architecture- dependent approach. An alternative is to use 'Sysfs', which provides a platform-agnostic interface to parse host CPU topology. Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> --- src/nodeinfo.c | 144 ++++++++++++++++++++++++-------------------------------- 1 files changed, 61 insertions(+), 83 deletions(-) diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 6448b79..3b4ac50 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -30,6 +30,7 @@ #include <errno.h> #include <dirent.h> #include <sys/utsname.h> +#include <sched.h> #if HAVE_NUMACTL # define NUMA_VERSION1_COMPATIBILITY 1 @@ -67,8 +68,8 @@ /* NB, this is not static as we need to call it from the testsuite */ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, - virNodeInfoPtr nodeinfo, - bool need_hyperthreads); + char *sysfs_cpudir, + virNodeInfoPtr nodeinfo); static int linuxNodeGetCPUStats(FILE *procstat, int cpuNum, @@ -79,8 +80,9 @@ static int linuxNodeGetMemoryStats(FILE *meminfo, virNodeMemoryStatsPtr params, int *nparams); +static char sysfs_path[1024]; /* Return the positive decimal contents of the given - * CPU_SYS_PATH/cpu%u/FILE, or -1 on error. If MISSING_OK and the + * (*sysfs_path)/cpu%u/FILE, or -1 on error. If MISSING_OK and the * file could not be found, return 1 instead of an error; this is * because some machines cannot hot-unplug cpu0, or because * hot-unplugging is disabled. */ @@ -93,7 +95,7 @@ get_cpu_value(unsigned int cpu, const char *file, bool missing_ok) char value_str[INT_BUFSIZE_BOUND(value)]; char *tmp; - if (virAsprintf(&path, CPU_SYS_PATH "/cpu%u/%s", cpu, file) < 0) { + if (virAsprintf(&path, "%s/cpu%u/%s", sysfs_path, cpu, file) < 0) { virReportOOMError(); return -1; } @@ -125,7 +127,7 @@ cleanup: return value; } -/* Check if CPU is online via CPU_SYS_PATH/cpu%u/online. Return 1 if online, +/* Check if CPU is online via sysfs_path/cpu%u/online. Return 1 if online, 0 if offline, and -1 on error. */ static int cpu_online(unsigned int cpu) @@ -141,8 +143,8 @@ static unsigned long count_thread_siblings(unsigned int cpu) char str[1024]; int i; - if (virAsprintf(&path, CPU_SYS_PATH "/cpu%u/topology/thread_siblings", - cpu) < 0) { + if (virAsprintf(&path, "%s/cpu%u/topology/thread_siblings", + sysfs_path, cpu) < 0) { virReportOOMError(); return 0; } @@ -191,23 +193,27 @@ static int parse_socket(unsigned int cpu) return ret; } +static int parse_core(unsigned int cpu) +{ + return get_cpu_value(cpu, "topology/core_id", false); +} + int linuxNodeInfoCPUPopulate(FILE *cpuinfo, - virNodeInfoPtr nodeinfo, - bool need_hyperthreads) + char *sysfs_cpudir, + virNodeInfoPtr nodeinfo) { char line[1024]; DIR *cpudir = NULL; struct dirent *cpudirent = NULL; unsigned int cpu; - unsigned long cur_threads; - int socket; - unsigned long long socket_mask = 0; - unsigned int remaining; + unsigned long core, socket, cur_threads; + cpu_set_t core_mask; + cpu_set_t socket_mask; int online; nodeinfo->cpus = 0; nodeinfo->mhz = 0; - nodeinfo->cores = 1; + nodeinfo->cores = 0; nodeinfo->nodes = 1; # if HAVE_NUMACTL @@ -215,26 +221,20 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, nodeinfo->nodes = numa_max_node() + 1; # endif + if (!virStrcpyStatic(sysfs_path, sysfs_cpudir)) { + virReportSystemError(errno, _("cannot copy %s"), sysfs_cpudir); + return -1; + } /* NB: It is impossible to fill our nodes, since cpuinfo * has no knowledge of NUMA nodes */ /* NOTE: hyperthreads are ignored here; they are parsed out of /sys */ while (fgets(line, sizeof(line), cpuinfo) != NULL) { char *buf = line; - if (STRPREFIX(buf, "processor")) { /* aka a single logical CPU */ - buf += 9; - while (*buf && c_isspace(*buf)) - buf++; - if (*buf != ':') { - nodeReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("parsing cpuinfo processor")); - return -1; - } - nodeinfo->cpus++; # if defined(__x86_64__) || \ defined(__amd64__) || \ defined(__i386__) - } else if (STRPREFIX(buf, "cpu MHz")) { + if (STRPREFIX(buf, "cpu MHz")) { char *p; unsigned int ui; buf += 9; @@ -249,24 +249,9 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, /* Accept trailing fractional part. */ && (*p == '\0' || *p == '.' || c_isspace(*p))) nodeinfo->mhz = ui; - } else if (STRPREFIX(buf, "cpu cores")) { /* aka cores */ - char *p; - unsigned int id; - buf += 9; - while (*buf && c_isspace(*buf)) - buf++; - if (*buf != ':' || !buf[1]) { - nodeReportError(VIR_ERR_INTERNAL_ERROR, - _("parsing cpuinfo cpu cores %c"), *buf); - return -1; - } - if (virStrToLong_ui(buf+1, &p, 10, &id) == 0 - && (*p == '\0' || c_isspace(*p)) - && id > nodeinfo->cores) - nodeinfo->cores = id; # elif defined(__powerpc__) || \ defined(__powerpc64__) - } else if (STRPREFIX(buf, "clock")) { + if (STRPREFIX(buf, "clock")) { char *p; unsigned int ui; buf += 5; @@ -281,53 +266,30 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, /* Accept trailing fractional part. */ && (*p == '\0' || *p == '.' || c_isspace(*p))) nodeinfo->mhz = ui; -# elif defined(__s390__) || \ - defined(__s390x__) - } else if (STRPREFIX(buf, "# processors")) { - char *p; - unsigned int ui; - buf += 12; - while (*buf && c_isspace(*buf)) - buf++; - if (*buf != ':' || !buf[1]) { - nodeReportError(VIR_ERR_INTERNAL_ERROR, - _("parsing number of processors %c"), *buf); - return -1; - } - if (virStrToLong_ui(buf+1, &p, 10, &ui) == 0 - && (*p == '\0' || c_isspace(*p))) - nodeinfo->cpus = ui; /* No other interesting infos are available in /proc/cpuinfo. * However, there is a line identifying processor's version, * identification and machine, but we don't want it to be caught * and parsed in next iteration, because it is not in expected * format and thus lead to error. */ - break; # else # warning Parser for /proc/cpuinfo needs to be adapted for your architecture # endif } } - if (!nodeinfo->cpus) { - nodeReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("no cpus found")); - return -1; - } - - if (!need_hyperthreads) - return 0; - - /* OK, we've parsed what we can out of /proc/cpuinfo. Get the socket - * and thread information from /sys + /* OK, we've parsed clock speed out of /proc/cpuinfo. Get the core, socket + * thread and topology information from /sys */ - remaining = nodeinfo->cpus; - cpudir = opendir(CPU_SYS_PATH); + cpudir = opendir(sysfs_cpudir); if (cpudir == NULL) { - virReportSystemError(errno, _("cannot opendir %s"), CPU_SYS_PATH); + virReportSystemError(errno, _("cannot opendir %s"), sysfs_cpudir); return -1; } - while ((errno = 0), remaining && (cpudirent = readdir(cpudir))) { + + CPU_ZERO(&core_mask); + CPU_ZERO(&socket_mask); + + while ((cpudirent = readdir(cpudir))) { if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1) continue; @@ -338,15 +300,19 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, } if (!online) continue; - remaining--; + nodeinfo->cpus++; - socket = parse_socket(cpu); - if (socket < 0) { - closedir(cpudir); - return -1; + /* Parse core */ + core = parse_core(cpu); + if (!CPU_ISSET(core, &core_mask)) { + CPU_SET(core, &core_mask); + nodeinfo->cores++; } - if (!(socket_mask & (1 << socket))) { - socket_mask |= (1 << socket); + + /* Parse socket */ + socket = parse_socket(cpu); + if (!CPU_ISSET(socket, &socket_mask)) { + CPU_SET(socket, &socket_mask); nodeinfo->sockets++; } @@ -360,14 +326,19 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, } if (errno) { virReportSystemError(errno, - _("problem reading %s"), CPU_SYS_PATH); + _("problem reading %s"), sysfs_path); closedir(cpudir); return -1; } closedir(cpudir); - /* there should always be at least one socket and one thread */ + /* there should always be at least one cpu, socket and one thread */ + if (nodeinfo->cpus == 0) { + nodeReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("no CPUs found")); + return -1; + } if (nodeinfo->sockets == 0) { nodeReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no sockets found")); @@ -611,13 +582,20 @@ int nodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED, virNodeInfoPtr nodeinfo) { #ifdef __linux__ { int ret; + char *sysfs_cpuinfo; FILE *cpuinfo = fopen(CPUINFO_PATH, "r"); if (!cpuinfo) { virReportSystemError(errno, _("cannot open %s"), CPUINFO_PATH); return -1; } - ret = linuxNodeInfoCPUPopulate(cpuinfo, nodeinfo, true); + + if (virAsprintf(&sysfs_cpuinfo, CPU_SYS_PATH) < 0) { + virReportOOMError(); + return -1; + } + + ret = linuxNodeInfoCPUPopulate(cpuinfo, sysfs_cpuinfo, nodeinfo); VIR_FORCE_FCLOSE(cpuinfo); if (ret < 0) return -1; -- 1.7.7 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Thu, 1 Dec 2011 12:47:52 +0530 Subject: [PATCH 2/5] Modify the tests/nodeinfotest.c to use sysfs in addition to proc/cpuinfo This patch creates a new sysfs hierarchy under tests/nodeinfodata/linux-nodeinfo-sysfs-test-1. Output files and /proc/cpuinfo files are also respectively added for both x86 and ppc64. Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> --- tests/nodeinfodata/linux-nodeinfo-1.cpuinfo | 45 --------- tests/nodeinfodata/linux-nodeinfo-1.meminfo | 28 ------ tests/nodeinfodata/linux-nodeinfo-1.txt | 1 - tests/nodeinfodata/linux-nodeinfo-2.cpuinfo | 47 --------- tests/nodeinfodata/linux-nodeinfo-2.meminfo | 28 ------ tests/nodeinfodata/linux-nodeinfo-2.txt | 1 - tests/nodeinfodata/linux-nodeinfo-3.cpuinfo | 99 -------------------- tests/nodeinfodata/linux-nodeinfo-3.meminfo | 28 ------ tests/nodeinfodata/linux-nodeinfo-3.txt | 1 - tests/nodeinfodata/linux-nodeinfo-4.cpuinfo | 95 ------------------- tests/nodeinfodata/linux-nodeinfo-4.meminfo | 28 ------ tests/nodeinfodata/linux-nodeinfo-4.txt | 1 - tests/nodeinfodata/linux-nodeinfo-5.cpuinfo | 95 ------------------- tests/nodeinfodata/linux-nodeinfo-5.meminfo | 28 ------ tests/nodeinfodata/linux-nodeinfo-5.txt | 1 - tests/nodeinfodata/linux-nodeinfo-6.cpuinfo | 95 ------------------- tests/nodeinfodata/linux-nodeinfo-6.meminfo | 28 ------ tests/nodeinfodata/linux-nodeinfo-6.txt | 1 - .../linux-nodeinfo-sysfs-test-1-cpu-ppc-output.txt | 1 + .../linux-nodeinfo-sysfs-test-1-cpu-x86-output.txt | 1 + .../linux-nodeinfo-sysfs-test-1-ppc.cpuinfo | 9 ++ .../linux-nodeinfo-sysfs-test-1-x86.cpuinfo | 45 +++++++++ .../linux-nodeinfo-sysfs-test-1/cpu/cpu0/online | 1 + .../cpu/cpu0/topology/core_id | 1 + .../cpu/cpu0/topology/core_siblings | 1 + .../cpu/cpu0/topology/core_siblings_list | 1 + .../cpu/cpu0/topology/physical_package_id | 1 + .../cpu/cpu0/topology/thread_siblings | 1 + .../cpu/cpu0/topology/thread_siblings_list | 1 + .../linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_id | 1 + .../cpu/cpu1/core_siblings | 1 + .../cpu/cpu1/core_siblings_list | 1 + .../linux-nodeinfo-sysfs-test-1/cpu/cpu1/online | 1 + .../cpu/cpu1/physical_package_id | 1 + .../cpu/cpu1/thread_siblings | 1 + .../cpu/cpu1/thread_siblings_list | 1 + .../cpu/cpu1/topology/core_id | 1 + .../cpu/cpu1/topology/core_siblings | 1 + .../cpu/cpu1/topology/core_siblings_list | 1 + .../cpu/cpu1/topology/physical_package_id | 1 + .../cpu/cpu1/topology/thread_siblings | 1 + .../cpu/cpu1/topology/thread_siblings_list | 1 + .../linux-nodeinfo-sysfs-test-1/node/node0/meminfo | 28 ++++++ .../linux-nodeinfo-sysfs-test-1/node/node1/meminfo | 28 ++++++ tests/nodeinfotest.c | 41 ++++++--- 45 files changed, 159 insertions(+), 664 deletions(-) delete mode 100644 tests/nodeinfodata/linux-nodeinfo-1.cpuinfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-1.meminfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-1.txt delete mode 100644 tests/nodeinfodata/linux-nodeinfo-2.cpuinfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-2.meminfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-2.txt delete mode 100644 tests/nodeinfodata/linux-nodeinfo-3.cpuinfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-3.meminfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-3.txt delete mode 100644 tests/nodeinfodata/linux-nodeinfo-4.cpuinfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-4.meminfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-4.txt delete mode 100644 tests/nodeinfodata/linux-nodeinfo-5.cpuinfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-5.meminfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-5.txt delete mode 100644 tests/nodeinfodata/linux-nodeinfo-6.cpuinfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-6.meminfo delete mode 100644 tests/nodeinfodata/linux-nodeinfo-6.txt create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-ppc-output.txt create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-x86-output.txt create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-ppc.cpuinfo create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-x86.cpuinfo create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/online create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_id create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_siblings create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_siblings_list create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/physical_package_id create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/thread_siblings create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/thread_siblings_list create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_id create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_siblings create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_siblings_list create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/online create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/physical_package_id create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/thread_siblings create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/thread_siblings_list create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_id create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_siblings create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_siblings_list create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/physical_package_id create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/thread_siblings create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/thread_siblings_list create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/node/node0/meminfo create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/node/node1/meminfo diff --git a/tests/nodeinfodata/linux-nodeinfo-1.cpuinfo b/tests/nodeinfodata/linux-nodeinfo-1.cpuinfo deleted file mode 100644 index e88a48f..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-1.cpuinfo +++ /dev/null @@ -1,45 +0,0 @@ -processor : 0 -vendor_id : GenuineIntel -cpu family : 15 -model : 4 -model name : Intel(R) Xeon(TM) CPU 2.80GHz -stepping : 8 -cpu MHz : 2800.000 -cache size : 2048 KB -physical id : 0 -siblings : 2 -core id : 0 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 5 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl est cid cx16 xtpr lahf_lm -bogomips : 5590.67 -clflush size : 64 -cache_alignment : 128 -address sizes : 36 bits physical, 48 bits virtual -power management: - -processor : 1 -vendor_id : GenuineIntel -cpu family : 15 -model : 4 -model name : Intel(R) Xeon(TM) CPU 2.80GHz -stepping : 8 -cpu MHz : 2800.000 -cache size : 2048 KB -physical id : 0 -siblings : 2 -core id : 1 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 5 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl est cid cx16 xtpr lahf_lm -bogomips : 5586.49 -clflush size : 64 -cache_alignment : 128 -address sizes : 36 bits physical, 48 bits virtual -power management: diff --git a/tests/nodeinfodata/linux-nodeinfo-1.meminfo b/tests/nodeinfodata/linux-nodeinfo-1.meminfo deleted file mode 100644 index dd5565e..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-1.meminfo +++ /dev/null @@ -1,28 +0,0 @@ -MemTotal: 2053960 kB -MemFree: 157792 kB -Buffers: 209440 kB -Cached: 660788 kB -SwapCached: 76 kB -Active: 1416036 kB -Inactive: 178872 kB -SwapTotal: 2064376 kB -SwapFree: 2063940 kB -Dirty: 1736 kB -Writeback: 0 kB -AnonPages: 723984 kB -Mapped: 105208 kB -Slab: 225000 kB -SReclaimable: 172568 kB -SUnreclaim: 52432 kB -PageTables: 40224 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -CommitLimit: 3091356 kB -Committed_AS: 1270588 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 30640 kB -VmallocChunk: 34359705907 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -Hugepagesize: 2048 kB diff --git a/tests/nodeinfodata/linux-nodeinfo-1.txt b/tests/nodeinfodata/linux-nodeinfo-1.txt deleted file mode 100644 index 09e2946..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-1.txt +++ /dev/null @@ -1 +0,0 @@ -CPUs: 2, MHz: 2800, Nodes: 1, Cores: 2 diff --git a/tests/nodeinfodata/linux-nodeinfo-2.cpuinfo b/tests/nodeinfodata/linux-nodeinfo-2.cpuinfo deleted file mode 100644 index 95d96e1..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-2.cpuinfo +++ /dev/null @@ -1,47 +0,0 @@ -processor : 0 -vendor_id : AuthenticAMD -cpu family : 15 -model : 75 -model name : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ -stepping : 2 -cpu MHz : 2211.364 -cache size : 512 KB -physical id : 0 -siblings : 2 -core id : 0 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 1 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy -bogomips : 4424.80 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 40 bits physical, 48 bits virtual -power management: ts fid vid ttp tm stc - -processor : 1 -vendor_id : AuthenticAMD -cpu family : 15 -model : 75 -model name : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ -stepping : 2 -cpu MHz : 2211.364 -cache size : 512 KB -physical id : 0 -siblings : 2 -core id : 1 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 1 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy -bogomips : 4422.14 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 40 bits physical, 48 bits virtual -power management: ts fid vid ttp tm stc diff --git a/tests/nodeinfodata/linux-nodeinfo-2.meminfo b/tests/nodeinfodata/linux-nodeinfo-2.meminfo deleted file mode 100644 index e1d9b86..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-2.meminfo +++ /dev/null @@ -1,28 +0,0 @@ -MemTotal: 4059540 kB -MemFree: 3525008 kB -Buffers: 24480 kB -Cached: 282300 kB -SwapCached: 0 kB -Active: 230980 kB -Inactive: 243276 kB -SwapTotal: 2031608 kB -SwapFree: 2031608 kB -Dirty: 200 kB -Writeback: 0 kB -AnonPages: 167376 kB -Mapped: 31204 kB -Slab: 34904 kB -SReclaimable: 15544 kB -SUnreclaim: 19360 kB -PageTables: 7704 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -CommitLimit: 4061376 kB -Committed_AS: 265176 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 1736 kB -VmallocChunk: 34359736147 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -Hugepagesize: 2048 kB diff --git a/tests/nodeinfodata/linux-nodeinfo-2.txt b/tests/nodeinfodata/linux-nodeinfo-2.txt deleted file mode 100644 index e4eea94..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-2.txt +++ /dev/null @@ -1 +0,0 @@ -CPUs: 2, MHz: 2211, Nodes: 1, Cores: 2 diff --git a/tests/nodeinfodata/linux-nodeinfo-3.cpuinfo b/tests/nodeinfodata/linux-nodeinfo-3.cpuinfo deleted file mode 100644 index 94e3c01..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-3.cpuinfo +++ /dev/null @@ -1,99 +0,0 @@ -processor : 0 -vendor_id : GenuineIntel -cpu family : 6 -model : 15 -model name : Intel(R) Xeon(R) CPU 5110 @ 1.60GHz -stepping : 6 -cpu MHz : 1595.925 -cache size : 4096 KB -physical id : 0 -siblings : 2 -core id : 0 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 10 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov -pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc -pni monitor ds_cpl vmx tm2 ssse3 cx16 xtpr dca lahf_lm -bogomips : 3193.88 -clflush size : 64 -cache_alignment : 64 -address sizes : 36 bits physical, 48 bits virtual -power management: - -processor : 1 -vendor_id : GenuineIntel -cpu family : 6 -model : 15 -model name : Intel(R) Xeon(R) CPU 5110 @ 1.60GHz -stepping : 6 -cpu MHz : 1595.925 -cache size : 4096 KB -physical id : 3 -siblings : 2 -core id : 0 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 10 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov -pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc -pni monitor ds_cpl vmx tm2 ssse3 cx16 xtpr dca lahf_lm -bogomips : 3191.89 -clflush size : 64 -cache_alignment : 64 -address sizes : 36 bits physical, 48 bits virtual -power management: - -processor : 2 -vendor_id : GenuineIntel -cpu family : 6 -model : 15 -model name : Intel(R) Xeon(R) CPU 5110 @ 1.60GHz -stepping : 6 -cpu MHz : 1595.925 -cache size : 4096 KB -physical id : 0 -siblings : 2 -core id : 1 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 10 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov -pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc -pni monitor ds_cpl vmx tm2 ssse3 cx16 xtpr dca lahf_lm -bogomips : 3191.88 -clflush size : 64 -cache_alignment : 64 -address sizes : 36 bits physical, 48 bits virtual -power management: - -processor : 3 -vendor_id : GenuineIntel -cpu family : 6 -model : 15 -model name : Intel(R) Xeon(R) CPU 5110 @ 1.60GHz -stepping : 6 -cpu MHz : 1595.925 -cache size : 4096 KB -physical id : 3 -siblings : 2 -core id : 1 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 10 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov -pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc -pni monitor ds_cpl vmx tm2 ssse3 cx16 xtpr dca lahf_lm -bogomips : 3191.87 -clflush size : 64 -cache_alignment : 64 -address sizes : 36 bits physical, 48 bits virtual -power management: diff --git a/tests/nodeinfodata/linux-nodeinfo-3.meminfo b/tests/nodeinfodata/linux-nodeinfo-3.meminfo deleted file mode 100644 index 6bb8f64..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-3.meminfo +++ /dev/null @@ -1,28 +0,0 @@ -MemTotal: 4059272 kB -MemFree: 3532828 kB -Buffers: 16644 kB -Cached: 286152 kB -SwapCached: 0 kB -Active: 252032 kB -Inactive: 220148 kB -SwapTotal: 2031608 kB -SwapFree: 2031608 kB -Dirty: 76 kB -Writeback: 0 kB -AnonPages: 169548 kB -Mapped: 25456 kB -Slab: 27260 kB -SReclaimable: 9512 kB -SUnreclaim: 17748 kB -PageTables: 7552 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -CommitLimit: 4061244 kB -Committed_AS: 278572 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 2044 kB -VmallocChunk: 34359736107 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -Hugepagesize: 2048 kB diff --git a/tests/nodeinfodata/linux-nodeinfo-3.txt b/tests/nodeinfodata/linux-nodeinfo-3.txt deleted file mode 100644 index 17d4d8e..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-3.txt +++ /dev/null @@ -1 +0,0 @@ -CPUs: 4, MHz: 1595, Nodes: 1, Cores: 2 diff --git a/tests/nodeinfodata/linux-nodeinfo-4.cpuinfo b/tests/nodeinfodata/linux-nodeinfo-4.cpuinfo deleted file mode 100644 index 535a29d..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-4.cpuinfo +++ /dev/null @@ -1,95 +0,0 @@ -processor : 0 -vendor_id : AuthenticAMD -cpu family : 16 -model : 2 -model name : AMD Processor model unknown -stepping : 0 -cpu MHz : 1000.000 -cache size : 512 KB -physical id : 0 -siblings : 4 -core id : 0 -cpu cores : 4 -fpu : yes -fpu_exception : yes -cpuid level : 5 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy altmovcr8 abm sse4a misalignsse 3dnowprefetch osvw -bogomips : 4131.46 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 48 bits physical, 48 bits virtual -power management: ts ttp tm stc 100mhzsteps hwpstate [8] - -processor : 1 -vendor_id : AuthenticAMD -cpu family : 16 -model : 2 -model name : AMD Processor model unknown -stepping : 0 -cpu MHz : 1000.000 -cache size : 512 KB -physical id : 0 -siblings : 4 -core id : 1 -cpu cores : 4 -fpu : yes -fpu_exception : yes -cpuid level : 5 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy altmovcr8 abm sse4a misalignsse 3dnowprefetch osvw -bogomips : 3200.13 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 48 bits physical, 48 bits virtual -power management: ts ttp tm stc 100mhzsteps hwpstate [8] - -processor : 2 -vendor_id : AuthenticAMD -cpu family : 16 -model : 2 -model name : AMD Processor model unknown -stepping : 0 -cpu MHz : 1000.000 -cache size : 512 KB -physical id : 0 -siblings : 4 -core id : 2 -cpu cores : 4 -fpu : yes -fpu_exception : yes -cpuid level : 5 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy altmovcr8 abm sse4a misalignsse 3dnowprefetch osvw -bogomips : 3200.14 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 48 bits physical, 48 bits virtual -power management: ts ttp tm stc 100mhzsteps hwpstate [8] - -processor : 3 -vendor_id : AuthenticAMD -cpu family : 16 -model : 2 -model name : AMD Processor model unknown -stepping : 0 -cpu MHz : 1000.000 -cache size : 512 KB -physical id : 0 -siblings : 4 -core id : 3 -cpu cores : 4 -fpu : yes -fpu_exception : yes -cpuid level : 5 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy altmovcr8 abm sse4a misalignsse 3dnowprefetch osvw -bogomips : 3200.01 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 48 bits physical, 48 bits virtual -power management: ts ttp tm stc 100mhzsteps hwpstate [8] diff --git a/tests/nodeinfodata/linux-nodeinfo-4.meminfo b/tests/nodeinfodata/linux-nodeinfo-4.meminfo deleted file mode 100644 index 6bb8f64..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-4.meminfo +++ /dev/null @@ -1,28 +0,0 @@ -MemTotal: 4059272 kB -MemFree: 3532828 kB -Buffers: 16644 kB -Cached: 286152 kB -SwapCached: 0 kB -Active: 252032 kB -Inactive: 220148 kB -SwapTotal: 2031608 kB -SwapFree: 2031608 kB -Dirty: 76 kB -Writeback: 0 kB -AnonPages: 169548 kB -Mapped: 25456 kB -Slab: 27260 kB -SReclaimable: 9512 kB -SUnreclaim: 17748 kB -PageTables: 7552 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -CommitLimit: 4061244 kB -Committed_AS: 278572 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 2044 kB -VmallocChunk: 34359736107 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -Hugepagesize: 2048 kB diff --git a/tests/nodeinfodata/linux-nodeinfo-4.txt b/tests/nodeinfodata/linux-nodeinfo-4.txt deleted file mode 100644 index 5a5c919..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-4.txt +++ /dev/null @@ -1 +0,0 @@ -CPUs: 4, MHz: 1000, Nodes: 1, Cores: 4 diff --git a/tests/nodeinfodata/linux-nodeinfo-5.cpuinfo b/tests/nodeinfodata/linux-nodeinfo-5.cpuinfo deleted file mode 100644 index 7cb6e18..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-5.cpuinfo +++ /dev/null @@ -1,95 +0,0 @@ -processor : 0 -vendor_id : AuthenticAMD -cpu family : 15 -model : 65 -model name : Dual-Core AMD Opteron(tm) Processor 2220 -stepping : 3 -cpu MHz : 2814.921 -cache size : 1024 KB -physical id : 0 -siblings : 2 -core id : 0 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 1 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy -bogomips : 5633.58 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 40 bits physical, 48 bits virtual -power management: ts fid vid ttp tm stc - -processor : 1 -vendor_id : AuthenticAMD -cpu family : 15 -model : 65 -model name : Dual-Core AMD Opteron(tm) Processor 2220 -stepping : 3 -cpu MHz : 2814.921 -cache size : 1024 KB -physical id : 0 -siblings : 2 -core id : 1 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 1 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy -bogomips : 5629.01 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 40 bits physical, 48 bits virtual -power management: ts fid vid ttp tm stc - -processor : 2 -vendor_id : AuthenticAMD -cpu family : 15 -model : 65 -model name : Dual-Core AMD Opteron(tm) Processor 2220 -stepping : 3 -cpu MHz : 2814.921 -cache size : 1024 KB -physical id : 1 -siblings : 2 -core id : 0 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 1 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy -bogomips : 5628.94 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 40 bits physical, 48 bits virtual -power management: ts fid vid ttp tm stc - -processor : 3 -vendor_id : AuthenticAMD -cpu family : 15 -model : 65 -model name : Dual-Core AMD Opteron(tm) Processor 2220 -stepping : 3 -cpu MHz : 2814.921 -cache size : 1024 KB -physical id : 1 -siblings : 2 -core id : 1 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 1 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy -bogomips : 5628.86 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 40 bits physical, 48 bits virtual -power management: ts fid vid ttp tm stc diff --git a/tests/nodeinfodata/linux-nodeinfo-5.meminfo b/tests/nodeinfodata/linux-nodeinfo-5.meminfo deleted file mode 100644 index 6bb8f64..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-5.meminfo +++ /dev/null @@ -1,28 +0,0 @@ -MemTotal: 4059272 kB -MemFree: 3532828 kB -Buffers: 16644 kB -Cached: 286152 kB -SwapCached: 0 kB -Active: 252032 kB -Inactive: 220148 kB -SwapTotal: 2031608 kB -SwapFree: 2031608 kB -Dirty: 76 kB -Writeback: 0 kB -AnonPages: 169548 kB -Mapped: 25456 kB -Slab: 27260 kB -SReclaimable: 9512 kB -SUnreclaim: 17748 kB -PageTables: 7552 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -CommitLimit: 4061244 kB -Committed_AS: 278572 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 2044 kB -VmallocChunk: 34359736107 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -Hugepagesize: 2048 kB diff --git a/tests/nodeinfodata/linux-nodeinfo-5.txt b/tests/nodeinfodata/linux-nodeinfo-5.txt deleted file mode 100644 index 54abb5d..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-5.txt +++ /dev/null @@ -1 +0,0 @@ -CPUs: 4, MHz: 2814, Nodes: 1, Cores: 2 diff --git a/tests/nodeinfodata/linux-nodeinfo-6.cpuinfo b/tests/nodeinfodata/linux-nodeinfo-6.cpuinfo deleted file mode 100644 index a08cf26..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-6.cpuinfo +++ /dev/null @@ -1,95 +0,0 @@ -processor : 0 -vendor_id : AuthenticAMD -cpu family : 15 -model : 65 -model name : Dual-Core AMD Opteron(tm) Processor 2218 -stepping : 2 -cpu MHz : 1000.000 -cache size : 1024 KB -physical id : 0 -siblings : 2 -core id : 0 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 1 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy -bogomips : 1999.99 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 40 bits physical, 48 bits virtual -power management: ts fid vid ttp tm stc - -processor : 1 -vendor_id : AuthenticAMD -cpu family : 15 -model : 65 -model name : Dual-Core AMD Opteron(tm) Processor 2218 -stepping : 2 -cpu MHz : 1000.000 -cache size : 1024 KB -physical id : 1 -siblings : 2 -core id : 0 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 1 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy -bogomips : 1999.99 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 40 bits physical, 48 bits virtual -power management: ts fid vid ttp tm stc - -processor : 2 -vendor_id : AuthenticAMD -cpu family : 15 -model : 65 -model name : Dual-Core AMD Opteron(tm) Processor 2218 -stepping : 2 -cpu MHz : 1000.000 -cache size : 1024 KB -physical id : 0 -siblings : 2 -core id : 1 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 1 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy -bogomips : 1999.99 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 40 bits physical, 48 bits virtual -power management: ts fid vid ttp tm stc - -processor : 3 -vendor_id : AuthenticAMD -cpu family : 15 -model : 65 -model name : Dual-Core AMD Opteron(tm) Processor 2218 -stepping : 2 -cpu MHz : 1000.000 -cache size : 1024 KB -physical id : 1 -siblings : 2 -core id : 1 -cpu cores : 2 -fpu : yes -fpu_exception : yes -cpuid level : 1 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy -bogomips : 1999.99 -TLB size : 1024 4K pages -clflush size : 64 -cache_alignment : 64 -address sizes : 40 bits physical, 48 bits virtual -power management: ts fid vid ttp tm stc diff --git a/tests/nodeinfodata/linux-nodeinfo-6.meminfo b/tests/nodeinfodata/linux-nodeinfo-6.meminfo deleted file mode 100644 index 6bb8f64..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-6.meminfo +++ /dev/null @@ -1,28 +0,0 @@ -MemTotal: 4059272 kB -MemFree: 3532828 kB -Buffers: 16644 kB -Cached: 286152 kB -SwapCached: 0 kB -Active: 252032 kB -Inactive: 220148 kB -SwapTotal: 2031608 kB -SwapFree: 2031608 kB -Dirty: 76 kB -Writeback: 0 kB -AnonPages: 169548 kB -Mapped: 25456 kB -Slab: 27260 kB -SReclaimable: 9512 kB -SUnreclaim: 17748 kB -PageTables: 7552 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -CommitLimit: 4061244 kB -Committed_AS: 278572 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 2044 kB -VmallocChunk: 34359736107 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -Hugepagesize: 2048 kB diff --git a/tests/nodeinfodata/linux-nodeinfo-6.txt b/tests/nodeinfodata/linux-nodeinfo-6.txt deleted file mode 100644 index f89e35e..0000000 --- a/tests/nodeinfodata/linux-nodeinfo-6.txt +++ /dev/null @@ -1 +0,0 @@ -CPUs: 4, MHz: 1000, Nodes: 1, Cores: 2 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-ppc-output.txt b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-ppc-output.txt new file mode 100644 index 0000000..433a81f --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-ppc-output.txt @@ -0,0 +1 @@ +CPUs: 2, MHz: 8, Nodes: 1, Cores: 2 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-x86-output.txt b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-x86-output.txt new file mode 100644 index 0000000..09e2946 --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-x86-output.txt @@ -0,0 +1 @@ +CPUs: 2, MHz: 2800, Nodes: 1, Cores: 2 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-ppc.cpuinfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-ppc.cpuinfo new file mode 100644 index 0000000..38f2050 --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-ppc.cpuinfo @@ -0,0 +1,9 @@ +processor : 0 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) + +processor : 1 +cpu : POWER7 (raw), altivec supported +clock : 8.388608MHz +revision : 2.3 (pvr 003f 0203) diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-x86.cpuinfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-x86.cpuinfo new file mode 100644 index 0000000..e88a48f --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-x86.cpuinfo @@ -0,0 +1,45 @@ +processor : 0 +vendor_id : GenuineIntel +cpu family : 15 +model : 4 +model name : Intel(R) Xeon(TM) CPU 2.80GHz +stepping : 8 +cpu MHz : 2800.000 +cache size : 2048 KB +physical id : 0 +siblings : 2 +core id : 0 +cpu cores : 2 +fpu : yes +fpu_exception : yes +cpuid level : 5 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl est cid cx16 xtpr lahf_lm +bogomips : 5590.67 +clflush size : 64 +cache_alignment : 128 +address sizes : 36 bits physical, 48 bits virtual +power management: + +processor : 1 +vendor_id : GenuineIntel +cpu family : 15 +model : 4 +model name : Intel(R) Xeon(TM) CPU 2.80GHz +stepping : 8 +cpu MHz : 2800.000 +cache size : 2048 KB +physical id : 0 +siblings : 2 +core id : 1 +cpu cores : 2 +fpu : yes +fpu_exception : yes +cpuid level : 5 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl est cid cx16 xtpr lahf_lm +bogomips : 5586.49 +clflush size : 64 +cache_alignment : 128 +address sizes : 36 bits physical, 48 bits virtual +power management: diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/online b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/online new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/online @@ -0,0 +1 @@ +1 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_id new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_id @@ -0,0 +1 @@ +0 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_siblings new file mode 100644 index 0000000..b9ad9ed --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_siblings @@ -0,0 +1 @@ +00000003 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_siblings_list b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_siblings_list new file mode 100644 index 0000000..8b0fab8 --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/core_siblings_list @@ -0,0 +1 @@ +0-1 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/physical_package_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/physical_package_id new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/physical_package_id @@ -0,0 +1 @@ +0 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/thread_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/thread_siblings new file mode 100644 index 0000000..d347603 --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/thread_siblings @@ -0,0 +1 @@ +00000001 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/thread_siblings_list b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/thread_siblings_list new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu0/topology/thread_siblings_list @@ -0,0 +1 @@ +0 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_id new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_id @@ -0,0 +1 @@ +1 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_siblings new file mode 100644 index 0000000..b9ad9ed --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_siblings @@ -0,0 +1 @@ +00000003 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_siblings_list b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_siblings_list new file mode 100644 index 0000000..8b0fab8 --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/core_siblings_list @@ -0,0 +1 @@ +0-1 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/online b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/online new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/online @@ -0,0 +1 @@ +1 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/physical_package_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/physical_package_id new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/physical_package_id @@ -0,0 +1 @@ +0 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/thread_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/thread_siblings new file mode 100644 index 0000000..0af11c5 --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/thread_siblings @@ -0,0 +1 @@ +00000002 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/thread_siblings_list b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/thread_siblings_list new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/thread_siblings_list @@ -0,0 +1 @@ +1 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_id new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_id @@ -0,0 +1 @@ +1 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_siblings new file mode 100644 index 0000000..b9ad9ed --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_siblings @@ -0,0 +1 @@ +00000003 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_siblings_list b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_siblings_list new file mode 100644 index 0000000..8b0fab8 --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/core_siblings_list @@ -0,0 +1 @@ +0-1 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/physical_package_id b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/physical_package_id new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/physical_package_id @@ -0,0 +1 @@ +0 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/thread_siblings b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/thread_siblings new file mode 100644 index 0000000..d347603 --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/thread_siblings @@ -0,0 +1 @@ +00000001 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/thread_siblings_list b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/thread_siblings_list new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/cpu/cpu1/topology/thread_siblings_list @@ -0,0 +1 @@ +0 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/node/node0/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/node/node0/meminfo new file mode 100644 index 0000000..ad2286a --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/node/node0/meminfo @@ -0,0 +1,28 @@ +Node 0 MemTotal: 33554432 kB +Node 0 MemFree: 12351744 kB +Node 0 MemUsed: 21202688 kB +Node 0 Active: 2086528 kB +Node 0 Inactive: 1816512 kB +Node 0 Active(anon): 174208 kB +Node 0 Inactive(anon): 3840 kB +Node 0 Active(file): 1912320 kB +Node 0 Inactive(file): 1812672 kB +Node 0 Unevictable: 0 kB +Node 0 Mlocked: 0 kB +Node 0 Dirty: 0 kB +Node 0 Writeback: 0 kB +Node 0 FilePages: 3758976 kB +Node 0 Mapped: 13440 kB +Node 0 AnonPages: 160704 kB +Node 0 Shmem: 17664 kB +Node 0 KernelStack: 2944 kB +Node 0 PageTables: 12032 kB +Node 0 NFS_Unstable: 0 kB +Node 0 Bounce: 0 kB +Node 0 WritebackTmp: 0 kB +Node 0 Slab: 315904 kB +Node 0 SReclaimable: 197824 kB +Node 0 SUnreclaim: 118080 kB +Node 0 HugePages_Total: 1024 +Node 0 HugePages_Free: 768 +Node 0 HugePages_Surp: 0 diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/node/node1/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/node/node1/meminfo new file mode 100644 index 0000000..7666eb6 --- /dev/null +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1/node/node1/meminfo @@ -0,0 +1,28 @@ +Node 1 MemTotal: 33554432 kB +Node 1 MemFree: 11934016 kB +Node 1 MemUsed: 21620416 kB +Node 1 Active: 3225728 kB +Node 1 Inactive: 1057536 kB +Node 1 Active(anon): 154752 kB +Node 1 Inactive(anon): 80320 kB +Node 1 Active(file): 3070976 kB +Node 1 Inactive(file): 977216 kB +Node 1 Unevictable: 0 kB +Node 1 Mlocked: 0 kB +Node 1 Dirty: 192 kB +Node 1 Writeback: 0 kB +Node 1 FilePages: 4165696 kB +Node 1 Mapped: 36416 kB +Node 1 AnonPages: 117248 kB +Node 1 Shmem: 117760 kB +Node 1 KernelStack: 2144 kB +Node 1 PageTables: 10368 kB +Node 1 NFS_Unstable: 0 kB +Node 1 Bounce: 0 kB +Node 1 WritebackTmp: 0 kB +Node 1 Slab: 277888 kB +Node 1 SReclaimable: 175744 kB +Node 1 SUnreclaim: 102144 kB +Node 1 HugePages_Total: 1024 +Node 1 HugePages_Free: 1024 +Node 1 HugePages_Surp: 0 diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index 448e072..e01abb2 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -13,7 +13,9 @@ #if ! (defined __linux__ && (defined(__x86_64__) || \ defined(__amd64__) || \ - defined(__i386__))) + defined(__i386__) || \ + defined(__powerpc__) || \ + defined(__powerpc64__))) int main(void) @@ -23,11 +25,14 @@ main(void) #else -extern int linuxNodeInfoCPUPopulate(FILE *cpuinfo, virNodeInfoPtr nodeinfo, - bool need_hyperthreads); +extern int linuxNodeInfoCPUPopulate(FILE *cpuinfo, + char *sysfs_cpuinfo, + virNodeInfoPtr nodeinfo); static int -linuxTestCompareFiles(const char *cpuinfofile, const char *outputfile) +linuxTestCompareFiles(const char *cpuinfofile, + char *sysfs_cpuinfo, + const char *outputfile) { int ret = -1; char *actualData = NULL; @@ -43,7 +48,7 @@ linuxTestCompareFiles(const char *cpuinfofile, const char *outputfile) goto fail; memset(&nodeinfo, 0, sizeof(nodeinfo)); - if (linuxNodeInfoCPUPopulate(cpuinfo, &nodeinfo, false) < 0) { + if (linuxNodeInfoCPUPopulate(cpuinfo, sysfs_cpuinfo, &nodeinfo) < 0) { if (virTestGetDebug()) { virErrorPtr error = virSaveLastError(); if (error && error->code != VIR_ERR_OK) @@ -87,16 +92,29 @@ linuxTestNodeInfo(const void *data) { int result = -1; char *cpuinfo = NULL; + char *sysfs_cpuinfo = NULL; char *output = NULL; - if (virAsprintf(&cpuinfo, "%s/nodeinfodata/linux-%s.cpuinfo", +#if defined(__powerpc__) || \ + defined(__powerpc64__) + if (virAsprintf(&sysfs_cpuinfo, "%s/nodeinfodata/linux-%s/cpu/", abs_srcdir, (const char*)data) < 0 || - virAsprintf(&output, "%s/nodeinfodata/linux-%s.txt", + virAsprintf(&cpuinfo, "%s/nodeinfodata/linux-%s-ppc.cpuinfo", + abs_srcdir, (const char*)data) < 0 || + virAsprintf(&output, "%s/nodeinfodata/linux-%s-cpu-ppc-output.txt", + abs_srcdir, (const char*)data) < 0) { +#else + if (virAsprintf(&sysfs_cpuinfo, "%s/nodeinfodata/linux-%s/cpu/", + abs_srcdir, (const char*)data) < 0 || + virAsprintf(&cpuinfo, "%s/nodeinfodata/linux-%s-x86.cpuinfo", + abs_srcdir, (const char*)data) < 0 || + virAsprintf(&output, "%s/nodeinfodata/linux-%s-cpu-x86-output.txt", abs_srcdir, (const char*)data) < 0) { +#endif goto cleanup; } - result = linuxTestCompareFiles(cpuinfo, output); + result = linuxTestCompareFiles(cpuinfo, sysfs_cpuinfo, output); cleanup: free(cpuinfo); @@ -112,12 +130,7 @@ mymain(void) int ret = 0; int i; const char *nodeData[] = { - "nodeinfo-1", - "nodeinfo-2", - "nodeinfo-3", - "nodeinfo-4", - "nodeinfo-5", - "nodeinfo-6", + "nodeinfo-sysfs-test-1", }; if (virInitialize() < 0) -- 1.7.7 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Mon, 3 Oct 2011 06:01:33 -0700 Subject: [PATCH 3/5] Add support for ppc64 qemu This enables libvirt to select the correct qemu binary (qemu-system-ppc64) for a guest vm based on arch 'ppc64'. Also, libvirt is enabled to correctly parse the list of supported PowerPC CPUs, generated by running 'qemu-system-ppc64 -cpu ?' Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> Acked-by: Stefan Berger <stefanb@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 74 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index deef0ea..7b56b13 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -186,6 +186,7 @@ static const struct qemu_arch_info const arch_info_hvm[] = { { "mipsel", 32, NULL, "qemu-system-mipsel", NULL, NULL, 0 }, { "sparc", 32, NULL, "qemu-system-sparc", NULL, NULL, 0 }, { "ppc", 32, NULL, "qemu-system-ppc", NULL, NULL, 0 }, + { "ppc64", 64, NULL, "qemu-system-ppc64", NULL, NULL, 0 }, { "itanium", 64, NULL, "qemu-system-ia64", NULL, NULL, 0 }, { "s390x", 64, NULL, "qemu-system-s390x", NULL, NULL, 0 }, }; @@ -478,6 +479,77 @@ error: return -1; } +/* ppc64 parser. + * Format : PowerPC <machine> <description> + */ +static int +qemuCapsParsePPCModels(const char *output, + unsigned int *retcount, + const char ***retcpus) +{ + const char *p = output; + const char *next; + unsigned int count = 0; + const char **cpus = NULL; + int i; + + if (!retcpus) { + VIR_DEBUG("No retcpus specified"); + return -1; + } + + do { + const char *t; + + if ((next = strchr(p, '\n'))) + next++; + + if (!STRPREFIX(p, "PowerPC ")) + continue; + + /* Skip the preceding sub-string "PowerPC " */ + p += 8; + + /*Malformed string, does not obey the format 'PowerPC <model> <desc>'*/ + if (!(t = strchr(p, ' ')) || (next && t >= next)) + continue; + + if (*p == '\0') + break; + + if (*p == '\n') + continue; + + if (retcpus) { + unsigned int len; + + if (VIR_REALLOC_N(cpus, count + 1) < 0) + virReportOOMError(); + goto error; + + len = t - p - 1; + + if (!(cpus[count] = strndup(p, len))) + virReportOOMError(); + goto error; + } + count++; + } while ((p = next)); + + if (retcount) + *retcount = count; + if (retcpus) + *retcpus = cpus; + return 0; + +error: + if (cpus) { + for (i = 0; i < count; i++) + VIR_FREE(cpus[i]); + } + VIR_FREE(cpus); + return -1; +} int qemuCapsProbeCPUModels(const char *qemu, @@ -498,6 +570,8 @@ qemuCapsProbeCPUModels(const char *qemu, if (STREQ(arch, "i686") || STREQ(arch, "x86_64")) parse = qemuCapsParseX86Models; + else if (STREQ(arch, "ppc64")) + parse = qemuCapsParsePPCModels; else { VIR_DEBUG("don't know how to parse %s CPU models", arch); return 0; -- 1.7.7 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Mon, 21 Nov 2011 18:20:42 +0530 Subject: [PATCH 4/5] Clean up qemuBuildCommandLine to remove x86-specific assumptions from generic code. This implements the minimal set of changes needed in libvirt to launch a PowerPC-KVM based guest. It removes x86-specific assumptions about choice of serial driver backend from generic qemu guest commandline generation code. It also restricts the ACPI capability to be available for an x86 or x86_64 domain. This is not a complete solution -- it still does not guarantee libvirt the capability to flag non-supported options in guest XML. (Eg, an ACPI specification in a PowerPC guest XML will still get processed, even though qemu-system-ppc64 does not support it while qemu-system-x86_64 does.) This drawback exists because libvirt falls back on qemu to query supported features, and qemu '-h' blindly lists all capabilities -- irrespective of whether they are available while emulating a given architecture or not. The long-term solution would be for qemu to list out capabilities based on architecture and platform -- so that libvirt can cleanly make out what devices are supported on an arch (say 'ppc64') and platform (say, 'mac99'). Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 41 +++++++++++++++++++++++++++++++++++++---- src/qemu/qemu_command.h | 6 ++++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 22dc871..032ead1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4581,8 +4581,11 @@ qemuBuildCommandLine(virConnectPtr conn, VIR_FREE(devstr); virCommandAddArg(cmd, "-device"); - virCommandAddArgFormat(cmd, "isa-serial,chardev=char%s,id=%s", - serial->info.alias, serial->info.alias); + if (!(devstr = qemuBuildChrDeviceStr(serial, def->os.arch, + def->os.machine))) + goto error; + virCommandAddArg(cmd, devstr); + VIR_FREE(devstr); } else { virCommandAddArg(cmd, "-serial"); if (!(devstr = qemuBuildChrArgStr(&serial->source, NULL))) @@ -5469,6 +5472,34 @@ qemuBuildCommandLine(virConnectPtr conn, return NULL; } +/* This function generates the correct '-device' string for character + * devices of each architecture. + */ +char * +qemuBuildChrDeviceStr(virDomainChrDefPtr serial, + char *os_arch, + char *machine) +{ + virBuffer cmd = VIR_BUFFER_INITIALIZER; + + if (STREQ(os_arch, "ppc64") && STREQ(machine, "pseries")) + virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s", + serial->info.alias); + else + virBufferAsprintf(&cmd, "isa-serial,chardev=char%s,id=%s", + serial->info.alias, serial->info.alias); + + if (virBufferError(&cmd)) { + virReportOOMError(); + goto error; + } + + return virBufferContentAndReset(&cmd); + + error: + virBufferFreeAndReset(&cmd); + return NULL; +} /* * This method takes a string representing a QEMU command line ARGV set @@ -6680,8 +6711,7 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, def->maxvcpus = 1; def->vcpus = 1; def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_UTC; - def->features = (1 << VIR_DOMAIN_FEATURE_ACPI) - /*| (1 << VIR_DOMAIN_FEATURE_APIC)*/; + def->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART; def->onCrash = VIR_DOMAIN_LIFECYCLE_DESTROY; def->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY; @@ -6716,6 +6746,9 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, if (!def->os.arch) goto no_memory; + if (STREQ(def->os.arch, "i686")||STREQ(def->os.arch, "x86_64")) + def->features = (1 << VIR_DOMAIN_FEATURE_ACPI) + /*| (1 << VIR_DOMAIN_FEATURE_APIC)*/; #define WANT_VALUE() \ const char *val = progargv[++i]; \ if (!val) { \ diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index dbe2fb2..1fe0394 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -53,6 +53,12 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn, enum virNetDevVPortProfileOp vmop) ATTRIBUTE_NONNULL(1); +/* Generate string for arch-specific '-device' parameter */ +char * +qemuBuildChrDeviceStr (virDomainChrDefPtr serial, + char *os_arch, + char *machine); + /* With vlan == -1, use netdev syntax, else old hostnet */ char * qemuBuildHostNetStr(virDomainNetDefPtr net, char type_sep, -- 1.7.7 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

From: Bharata B Rao <bharata@linux.vnet.ibm.com> Date: Thu, 1 Dec 2011 23:15:55 +0530 Subject: [PATCH 5/5] Add ppc64 specific definitions to domain.rng ppc64 as new arch type and pseries as new machine type are added under <os> ... </os>. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> --- docs/schemas/domaincommon.rng | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 22bbd46..b8fbcf9 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -192,6 +192,7 @@ <ref name="hvmmips"/> <ref name="hvmsparc"/> <ref name="hvmppc"/> + <ref name="hvmppc64"/> </choice> </optional> <value>hvm</value> @@ -262,6 +263,22 @@ </optional> </group> </define> + <define name="hvmppc64"> + <group> + <optional> + <attribute name="arch"> + <value>ppc64</value> + </attribute> + </optional> + <optional> + <attribute name="machine"> + <choice> + <value>pseries</value> + </choice> + </attribute> + </optional> + </group> + </define> <define name="osexe"> <element name="os"> <element name="type"> -- 1.7.7 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

On 12/02/2011 11:54 AM, Prerna Saxena wrote:
Libvirt continues to be the key interface to configure and manage the KVM guest instances on x86. This patch set is an effort to enable libvirt to support KVM guest configuration and management on Power Book3S machines.
Based on community discussion around the earlier version, this patch series augments the present 'kvm' driver to support PowerPC-KVM based guests. With the CPU driver for PowerPC already merged, this patch series adds on clean-ups, and some test cases as suggested.
This series mostly focuses on cleanup and addition of testcases for base- powerpc patches. The patches for enabling spapr-vio based addressing would be sent out shortly, with the right domain schema additions.
All tests passed now on x86 and ppc64. However, I would push it once 0.9.9 development opens. Stefan

On Fri, Dec 02, 2011 at 02:31:13PM -0500, Stefan Berger wrote:
On 12/02/2011 11:54 AM, Prerna Saxena wrote:
Libvirt continues to be the key interface to configure and manage the KVM guest instances on x86. This patch set is an effort to enable libvirt to support KVM guest configuration and management on Power Book3S machines.
Based on community discussion around the earlier version, this patch series augments the present 'kvm' driver to support PowerPC-KVM based guests. With the CPU driver for PowerPC already merged, this patch series adds on clean-ups, and some test cases as suggested.
This series mostly focuses on cleanup and addition of testcases for base- powerpc patches. The patches for enabling spapr-vio based addressing would be sent out shortly, with the right domain schema additions.
All tests passed now on x86 and ppc64. However, I would push it once 0.9.9 development opens.
Agreed, there is no need to rush this into 0.9.8 Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 12/05/2011 05:08 PM, Daniel P. Berrange wrote:
On Fri, Dec 02, 2011 at 02:31:13PM -0500, Stefan Berger wrote:
On 12/02/2011 11:54 AM, Prerna Saxena wrote:
Libvirt continues to be the key interface to configure and manage the KVM guest instances on x86. This patch set is an effort to enable libvirt to support KVM guest configuration and management on Power Book3S machines.
Based on community discussion around the earlier version, this patch series augments the present 'kvm' driver to support PowerPC-KVM based guests. With the CPU driver for PowerPC already merged, this patch series adds on clean-ups, and some test cases as suggested.
This series mostly focuses on cleanup and addition of testcases for base- powerpc patches. The patches for enabling spapr-vio based addressing would be sent out shortly, with the right domain schema additions.
All tests passed now on x86 and ppc64. However, I would push it once 0.9.9 development opens.
Agreed, there is no need to rush this into 0.9.8
Now that the 0.9.8 release is out, would folks want to consider this patch series for merge ? I'm working on enhancing the testsuite for powerpc, pls let me know if more additions are needed. Thanks, -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

On 12/08/2011 03:58 AM, Prerna Saxena wrote:
On 12/05/2011 05:08 PM, Daniel P. Berrange wrote:
On Fri, Dec 02, 2011 at 02:31:13PM -0500, Stefan Berger wrote:
On 12/02/2011 11:54 AM, Prerna Saxena wrote:
Libvirt continues to be the key interface to configure and manage the KVM guest instances on x86. This patch set is an effort to enable libvirt to support KVM guest configuration and management on Power Book3S machines.
Based on community discussion around the earlier version, this patch series augments the present 'kvm' driver to support PowerPC-KVM based guests. With the CPU driver for PowerPC already merged, this patch series adds on clean-ups, and some test cases as suggested.
This series mostly focuses on cleanup and addition of testcases for base- powerpc patches. The patches for enabling spapr-vio based addressing would be sent out shortly, with the right domain schema additions. All tests passed now on x86 and ppc64. However, I would push it once 0.9.9 development opens. Agreed, there is no need to rush this into 0.9.8
Now that the 0.9.8 release is out, would folks want to consider this patch series for merge ? I'm working on enhancing the testsuite for powerpc, pls let me know if more additions are needed.
Thanks, Push.
participants (3)
-
Daniel P. Berrange
-
Prerna Saxena
-
Stefan Berger