[libvirt] [PATCH 0/3] processor frequency information on S390

Since kernel version 4.7, processor frequency information is available on S390. This patch series extends the parser for both node information and system information, respectively. Let's also add a testcase to the test suite for a S390 CPU configuration running kernel version 4.14 on LPAR. This goes on top of Andrea's changes in here: https://www.redhat.com/archives/libvir-list/2017-December/msg00519.html Bjoern Walk (3): util: virhostcpu: parse frequency information on S390 tests: virhostcputest: testcase for S390 system util: virsysinfo: parse frequency information on S390 src/util/virhostcpu.c | 2 + src/util/virsysinfo.c | 31 +++++++++++++ .../linux-s390x-with-frequency.cpuinfo | 52 ++++++++++++++++++++++ .../linux-s390x-with-frequency.expected | 1 + .../linux-with-frequency/cpu/cpu0/online | 1 + .../linux-with-frequency/cpu/cpu0/topology/book_id | 1 + .../cpu/cpu0/topology/book_siblings | 1 + .../cpu/cpu0/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu0/topology/core_id | 1 + .../cpu/cpu0/topology/core_siblings | 1 + .../cpu/cpu0/topology/core_siblings_list | 1 + .../cpu/cpu0/topology/drawer_id | 1 + .../cpu/cpu0/topology/drawer_siblings | 1 + .../cpu/cpu0/topology/drawer_siblings_list | 1 + .../cpu/cpu0/topology/physical_package_id | 1 + .../cpu/cpu0/topology/thread_siblings | 1 + .../cpu/cpu0/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu1/online | 1 + .../linux-with-frequency/cpu/cpu1/topology/book_id | 1 + .../cpu/cpu1/topology/book_siblings | 1 + .../cpu/cpu1/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu1/topology/core_id | 1 + .../cpu/cpu1/topology/core_siblings | 1 + .../cpu/cpu1/topology/core_siblings_list | 1 + .../cpu/cpu1/topology/drawer_id | 1 + .../cpu/cpu1/topology/drawer_siblings | 1 + .../cpu/cpu1/topology/drawer_siblings_list | 1 + .../cpu/cpu1/topology/physical_package_id | 1 + .../cpu/cpu1/topology/thread_siblings | 1 + .../cpu/cpu1/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu2/online | 1 + .../linux-with-frequency/cpu/cpu2/topology/book_id | 1 + .../cpu/cpu2/topology/book_siblings | 1 + .../cpu/cpu2/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu2/topology/core_id | 1 + .../cpu/cpu2/topology/core_siblings | 1 + .../cpu/cpu2/topology/core_siblings_list | 1 + .../cpu/cpu2/topology/drawer_id | 1 + .../cpu/cpu2/topology/drawer_siblings | 1 + .../cpu/cpu2/topology/drawer_siblings_list | 1 + .../cpu/cpu2/topology/physical_package_id | 1 + .../cpu/cpu2/topology/thread_siblings | 1 + .../cpu/cpu2/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu3/online | 1 + .../linux-with-frequency/cpu/cpu3/topology/book_id | 1 + .../cpu/cpu3/topology/book_siblings | 1 + .../cpu/cpu3/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu3/topology/core_id | 1 + .../cpu/cpu3/topology/core_siblings | 1 + .../cpu/cpu3/topology/core_siblings_list | 1 + .../cpu/cpu3/topology/drawer_id | 1 + .../cpu/cpu3/topology/drawer_siblings | 1 + .../cpu/cpu3/topology/drawer_siblings_list | 1 + .../cpu/cpu3/topology/physical_package_id | 1 + .../cpu/cpu3/topology/thread_siblings | 1 + .../cpu/cpu3/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu4/online | 1 + .../linux-with-frequency/cpu/cpu4/topology/book_id | 1 + .../cpu/cpu4/topology/book_siblings | 1 + .../cpu/cpu4/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu4/topology/core_id | 1 + .../cpu/cpu4/topology/core_siblings | 1 + .../cpu/cpu4/topology/core_siblings_list | 1 + .../cpu/cpu4/topology/drawer_id | 1 + .../cpu/cpu4/topology/drawer_siblings | 1 + .../cpu/cpu4/topology/drawer_siblings_list | 1 + .../cpu/cpu4/topology/physical_package_id | 1 + .../cpu/cpu4/topology/thread_siblings | 1 + .../cpu/cpu4/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu5/online | 1 + .../linux-with-frequency/cpu/cpu5/topology/book_id | 1 + .../cpu/cpu5/topology/book_siblings | 1 + .../cpu/cpu5/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu5/topology/core_id | 1 + .../cpu/cpu5/topology/core_siblings | 1 + .../cpu/cpu5/topology/core_siblings_list | 1 + .../cpu/cpu5/topology/drawer_id | 1 + .../cpu/cpu5/topology/drawer_siblings | 1 + .../cpu/cpu5/topology/drawer_siblings_list | 1 + .../cpu/cpu5/topology/physical_package_id | 1 + .../cpu/cpu5/topology/thread_siblings | 1 + .../cpu/cpu5/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu6/online | 1 + .../linux-with-frequency/cpu/cpu6/topology/book_id | 1 + .../cpu/cpu6/topology/book_siblings | 1 + .../cpu/cpu6/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu6/topology/core_id | 1 + .../cpu/cpu6/topology/core_siblings | 1 + .../cpu/cpu6/topology/core_siblings_list | 1 + .../cpu/cpu6/topology/drawer_id | 1 + .../cpu/cpu6/topology/drawer_siblings | 1 + .../cpu/cpu6/topology/drawer_siblings_list | 1 + .../cpu/cpu6/topology/physical_package_id | 1 + .../cpu/cpu6/topology/thread_siblings | 1 + .../cpu/cpu6/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu7/online | 1 + .../linux-with-frequency/cpu/cpu7/topology/book_id | 1 + .../cpu/cpu7/topology/book_siblings | 1 + .../cpu/cpu7/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu7/topology/core_id | 1 + .../cpu/cpu7/topology/core_siblings | 1 + .../cpu/cpu7/topology/core_siblings_list | 1 + .../cpu/cpu7/topology/drawer_id | 1 + .../cpu/cpu7/topology/drawer_siblings | 1 + .../cpu/cpu7/topology/drawer_siblings_list | 1 + .../cpu/cpu7/topology/physical_package_id | 1 + .../cpu/cpu7/topology/thread_siblings | 1 + .../cpu/cpu7/topology/thread_siblings_list | 1 + .../virhostcpudata/linux-with-frequency/cpu/online | 1 + .../linux-with-frequency/cpu/present | 1 + tests/virhostcputest.c | 1 + 111 files changed, 193 insertions(+) create mode 100644 tests/virhostcpudata/linux-s390x-with-frequency.cpuinfo create mode 100644 tests/virhostcpudata/linux-s390x-with-frequency.expected create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/present -- 2.13.4

Since kernel version 4.7, processor frequency information is available on S390. Let's adjust the parser so this information shows up for virsh nodeinfo: # virsh nodeinfo CPU model: s390x CPU(s): 8 CPU frequency: 5000 MHz CPU socket(s): 1 Core(s) per socket: 8 Thread(s) per core: 1 NUMA cell(s): 1 Memory size: 16273908 KiB Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- src/util/virhostcpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 1c9ee592..24f0d936 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -598,6 +598,8 @@ virHostCPUParseFrequency(FILE *cpuinfo, prefix = "cpu MHz"; else if (ARCH_IS_PPC(arch)) prefix = "clock"; + else if (ARCH_IS_S390(arch)) + prefix = "cpu MHz dynamic"; if (!prefix) { VIR_WARN("%s is not supported by the %s parser", -- 2.13.4

On 12/19/2017 05:08 AM, Bjoern Walk wrote:
Since kernel version 4.7, processor frequency information is available on S390. Let's adjust the parser so this information shows up for virsh nodeinfo:
# virsh nodeinfo CPU model: s390x CPU(s): 8 CPU frequency: 5000 MHz CPU socket(s): 1 Core(s) per socket: 8 Thread(s) per core: 1 NUMA cell(s): 1 Memory size: 16273908 KiB
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- src/util/virhostcpu.c | 2 ++ 1 file changed, 2 insertions(+)
This one doesn't apply for me... seems we're missing something like virHostCPUParseFrequency. Probably makes the next one moot too. Although they both look reasonable even though I know nothing about S390 (other than perhaps one spelling variation ;-)). John
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 1c9ee592..24f0d936 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -598,6 +598,8 @@ virHostCPUParseFrequency(FILE *cpuinfo, prefix = "cpu MHz"; else if (ARCH_IS_PPC(arch)) prefix = "clock"; + else if (ARCH_IS_S390(arch)) + prefix = "cpu MHz dynamic";
if (!prefix) { VIR_WARN("%s is not supported by the %s parser",

On 01/04/2018 03:56 PM, John Ferlan wrote:
On 12/19/2017 05:08 AM, Bjoern Walk wrote:
Since kernel version 4.7, processor frequency information is available on S390. Let's adjust the parser so this information shows up for virsh nodeinfo:
# virsh nodeinfo CPU model: s390x CPU(s): 8 CPU frequency: 5000 MHz CPU socket(s): 1 Core(s) per socket: 8 Thread(s) per core: 1 NUMA cell(s): 1 Memory size: 16273908 KiB
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- src/util/virhostcpu.c | 2 ++ 1 file changed, 2 insertions(+)
This one doesn't apply for me... seems we're missing something like virHostCPUParseFrequency. Probably makes the next one moot too. Although they both look reasonable even though I know nothing about S390 (other than perhaps one spelling variation ;-)).
John
Doh - should have read the cover letter <facepalm> - this goes on top of Andrea's changes... Sometimes it's just better to wait and/or provide review to the series you trying to use! John
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 1c9ee592..24f0d936 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -598,6 +598,8 @@ virHostCPUParseFrequency(FILE *cpuinfo, prefix = "cpu MHz"; else if (ARCH_IS_PPC(arch)) prefix = "clock"; + else if (ARCH_IS_S390(arch)) + prefix = "cpu MHz dynamic";
if (!prefix) { VIR_WARN("%s is not supported by the %s parser",
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

John Ferlan <jferlan@redhat.com> [2018-01-05, 03:13PM -0500]:
Doh - should have read the cover letter <facepalm> - this goes on top of Andrea's changes... Sometimes it's just better to wait and/or provide review to the series you trying to use!
Ye, sorry, should have made it more clear or reply-attached it to Andrea's series. I basically sent it out last year so I won't forget now.
John

On 12/19/2017 05:08 AM, Bjoern Walk wrote:
Since kernel version 4.7, processor frequency information is available on S390. Let's adjust the parser so this information shows up for virsh nodeinfo:
# virsh nodeinfo CPU model: s390x CPU(s): 8 CPU frequency: 5000 MHz CPU socket(s): 1 Core(s) per socket: 8 Thread(s) per core: 1 NUMA cell(s): 1 Memory size: 16273908 KiB
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- src/util/virhostcpu.c | 2 ++ 1 file changed, 2 insertions(+)
OK - once Andrea has pushed... Consider this, Reviewed-by: John Ferlan <jferlan@redhat.com> John

John Ferlan <jferlan@redhat.com> [2018-01-05, 03:53PM -0500]:
On 12/19/2017 05:08 AM, Bjoern Walk wrote:
Since kernel version 4.7, processor frequency information is available on S390. Let's adjust the parser so this information shows up for virsh nodeinfo:
# virsh nodeinfo CPU model: s390x CPU(s): 8 CPU frequency: 5000 MHz CPU socket(s): 1 Core(s) per socket: 8 Thread(s) per core: 1 NUMA cell(s): 1 Memory size: 16273908 KiB
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- src/util/virhostcpu.c | 2 ++ 1 file changed, 2 insertions(+)
OK - once Andrea has pushed... Consider this,
Reviewed-by: John Ferlan <jferlan@redhat.com>
John
Thanks.

Let's add a testcase for a S390 system running kernel version 4.14 on LPAR. Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- .../linux-s390x-with-frequency.cpuinfo | 52 ++++++++++++++++++++++ .../linux-s390x-with-frequency.expected | 1 + .../linux-with-frequency/cpu/cpu0/online | 1 + .../linux-with-frequency/cpu/cpu0/topology/book_id | 1 + .../cpu/cpu0/topology/book_siblings | 1 + .../cpu/cpu0/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu0/topology/core_id | 1 + .../cpu/cpu0/topology/core_siblings | 1 + .../cpu/cpu0/topology/core_siblings_list | 1 + .../cpu/cpu0/topology/drawer_id | 1 + .../cpu/cpu0/topology/drawer_siblings | 1 + .../cpu/cpu0/topology/drawer_siblings_list | 1 + .../cpu/cpu0/topology/physical_package_id | 1 + .../cpu/cpu0/topology/thread_siblings | 1 + .../cpu/cpu0/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu1/online | 1 + .../linux-with-frequency/cpu/cpu1/topology/book_id | 1 + .../cpu/cpu1/topology/book_siblings | 1 + .../cpu/cpu1/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu1/topology/core_id | 1 + .../cpu/cpu1/topology/core_siblings | 1 + .../cpu/cpu1/topology/core_siblings_list | 1 + .../cpu/cpu1/topology/drawer_id | 1 + .../cpu/cpu1/topology/drawer_siblings | 1 + .../cpu/cpu1/topology/drawer_siblings_list | 1 + .../cpu/cpu1/topology/physical_package_id | 1 + .../cpu/cpu1/topology/thread_siblings | 1 + .../cpu/cpu1/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu2/online | 1 + .../linux-with-frequency/cpu/cpu2/topology/book_id | 1 + .../cpu/cpu2/topology/book_siblings | 1 + .../cpu/cpu2/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu2/topology/core_id | 1 + .../cpu/cpu2/topology/core_siblings | 1 + .../cpu/cpu2/topology/core_siblings_list | 1 + .../cpu/cpu2/topology/drawer_id | 1 + .../cpu/cpu2/topology/drawer_siblings | 1 + .../cpu/cpu2/topology/drawer_siblings_list | 1 + .../cpu/cpu2/topology/physical_package_id | 1 + .../cpu/cpu2/topology/thread_siblings | 1 + .../cpu/cpu2/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu3/online | 1 + .../linux-with-frequency/cpu/cpu3/topology/book_id | 1 + .../cpu/cpu3/topology/book_siblings | 1 + .../cpu/cpu3/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu3/topology/core_id | 1 + .../cpu/cpu3/topology/core_siblings | 1 + .../cpu/cpu3/topology/core_siblings_list | 1 + .../cpu/cpu3/topology/drawer_id | 1 + .../cpu/cpu3/topology/drawer_siblings | 1 + .../cpu/cpu3/topology/drawer_siblings_list | 1 + .../cpu/cpu3/topology/physical_package_id | 1 + .../cpu/cpu3/topology/thread_siblings | 1 + .../cpu/cpu3/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu4/online | 1 + .../linux-with-frequency/cpu/cpu4/topology/book_id | 1 + .../cpu/cpu4/topology/book_siblings | 1 + .../cpu/cpu4/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu4/topology/core_id | 1 + .../cpu/cpu4/topology/core_siblings | 1 + .../cpu/cpu4/topology/core_siblings_list | 1 + .../cpu/cpu4/topology/drawer_id | 1 + .../cpu/cpu4/topology/drawer_siblings | 1 + .../cpu/cpu4/topology/drawer_siblings_list | 1 + .../cpu/cpu4/topology/physical_package_id | 1 + .../cpu/cpu4/topology/thread_siblings | 1 + .../cpu/cpu4/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu5/online | 1 + .../linux-with-frequency/cpu/cpu5/topology/book_id | 1 + .../cpu/cpu5/topology/book_siblings | 1 + .../cpu/cpu5/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu5/topology/core_id | 1 + .../cpu/cpu5/topology/core_siblings | 1 + .../cpu/cpu5/topology/core_siblings_list | 1 + .../cpu/cpu5/topology/drawer_id | 1 + .../cpu/cpu5/topology/drawer_siblings | 1 + .../cpu/cpu5/topology/drawer_siblings_list | 1 + .../cpu/cpu5/topology/physical_package_id | 1 + .../cpu/cpu5/topology/thread_siblings | 1 + .../cpu/cpu5/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu6/online | 1 + .../linux-with-frequency/cpu/cpu6/topology/book_id | 1 + .../cpu/cpu6/topology/book_siblings | 1 + .../cpu/cpu6/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu6/topology/core_id | 1 + .../cpu/cpu6/topology/core_siblings | 1 + .../cpu/cpu6/topology/core_siblings_list | 1 + .../cpu/cpu6/topology/drawer_id | 1 + .../cpu/cpu6/topology/drawer_siblings | 1 + .../cpu/cpu6/topology/drawer_siblings_list | 1 + .../cpu/cpu6/topology/physical_package_id | 1 + .../cpu/cpu6/topology/thread_siblings | 1 + .../cpu/cpu6/topology/thread_siblings_list | 1 + .../linux-with-frequency/cpu/cpu7/online | 1 + .../linux-with-frequency/cpu/cpu7/topology/book_id | 1 + .../cpu/cpu7/topology/book_siblings | 1 + .../cpu/cpu7/topology/book_siblings_list | 1 + .../linux-with-frequency/cpu/cpu7/topology/core_id | 1 + .../cpu/cpu7/topology/core_siblings | 1 + .../cpu/cpu7/topology/core_siblings_list | 1 + .../cpu/cpu7/topology/drawer_id | 1 + .../cpu/cpu7/topology/drawer_siblings | 1 + .../cpu/cpu7/topology/drawer_siblings_list | 1 + .../cpu/cpu7/topology/physical_package_id | 1 + .../cpu/cpu7/topology/thread_siblings | 1 + .../cpu/cpu7/topology/thread_siblings_list | 1 + .../virhostcpudata/linux-with-frequency/cpu/online | 1 + .../linux-with-frequency/cpu/present | 1 + tests/virhostcputest.c | 1 + 109 files changed, 160 insertions(+) create mode 100644 tests/virhostcpudata/linux-s390x-with-frequency.cpuinfo create mode 100644 tests/virhostcpudata/linux-s390x-with-frequency.expected create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/physical_package_id create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/thread_siblings create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/thread_siblings_list create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/online create mode 100644 tests/virhostcpudata/linux-with-frequency/cpu/present diff --git a/tests/virhostcpudata/linux-s390x-with-frequency.cpuinfo b/tests/virhostcpudata/linux-s390x-with-frequency.cpuinfo new file mode 100644 index 00000000..0edc371d --- /dev/null +++ b/tests/virhostcpudata/linux-s390x-with-frequency.cpuinfo @@ -0,0 +1,52 @@ +vendor_id : IBM/S390 +# processors : 8 +bogomips per cpu: 20325.00 +max thread id : 1 +features : esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx sie +facilities : 0 1 2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 40 41 42 43 44 45 46 47 48 49 50 51 52 53 55 57 64 65 66 67 68 69 70 71 72 73 75 76 77 78 80 128 129 131 132 142 143 +cache0 : level=1 type=Data scope=Private size=128K line_size=256 associativity=8 +cache1 : level=1 type=Instruction scope=Private size=96K line_size=256 associativity=6 +cache2 : level=2 type=Data scope=Private size=2048K line_size=256 associativity=8 +cache3 : level=2 type=Instruction scope=Private size=2048K line_size=256 associativity=8 +cache4 : level=3 type=Unified scope=Shared size=65536K line_size=256 associativity=16 +cache5 : level=4 type=Unified scope=Shared size=491520K line_size=256 associativity=30 +processor 0: version = 00, identification = 145F07, machine = 2964 +processor 1: version = 00, identification = 145F07, machine = 2964 +processor 2: version = 00, identification = 145F07, machine = 2964 +processor 3: version = 00, identification = 145F07, machine = 2964 +processor 4: version = 00, identification = 145F07, machine = 2964 +processor 5: version = 00, identification = 145F07, machine = 2964 +processor 6: version = 00, identification = 145F07, machine = 2964 +processor 7: version = 00, identification = 145F07, machine = 2964 + +cpu number : 0 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 1 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 2 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 3 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 4 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 5 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 6 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 + +cpu number : 7 +cpu MHz dynamic : 5000 +cpu MHz static : 5000 diff --git a/tests/virhostcpudata/linux-s390x-with-frequency.expected b/tests/virhostcpudata/linux-s390x-with-frequency.expected new file mode 100644 index 00000000..aeb595a2 --- /dev/null +++ b/tests/virhostcpudata/linux-s390x-with-frequency.expected @@ -0,0 +1 @@ +CPUs: 8/8, MHz: 5000, Nodes: 1, Sockets: 1, Cores: 8, Threads: 1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/online b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/online new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/online @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_id new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_id @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/book_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_id new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_id @@ -0,0 +1 @@ +0 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/core_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_id new file mode 100644 index 00000000..b8626c4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_id @@ -0,0 +1 @@ +4 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/drawer_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/physical_package_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/physical_package_id new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/physical_package_id @@ -0,0 +1 @@ +2 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/thread_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/thread_siblings new file mode 100644 index 00000000..176d3d66 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/thread_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/thread_siblings_list new file mode 100644 index 00000000..8b0fab86 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu0/topology/thread_siblings_list @@ -0,0 +1 @@ +0-1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/online b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/online new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/online @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_id new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_id @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/book_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_id new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_id @@ -0,0 +1 @@ +0 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/core_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_id new file mode 100644 index 00000000..b8626c4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_id @@ -0,0 +1 @@ +4 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/drawer_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/physical_package_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/physical_package_id new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/physical_package_id @@ -0,0 +1 @@ +2 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/thread_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/thread_siblings new file mode 100644 index 00000000..176d3d66 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/thread_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/thread_siblings_list new file mode 100644 index 00000000..8b0fab86 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu1/topology/thread_siblings_list @@ -0,0 +1 @@ +0-1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/online b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/online new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/online @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_id new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_id @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/book_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_id new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_id @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/core_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_id new file mode 100644 index 00000000..b8626c4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_id @@ -0,0 +1 @@ +4 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/drawer_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/physical_package_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/physical_package_id new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/physical_package_id @@ -0,0 +1 @@ +2 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/thread_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/thread_siblings new file mode 100644 index 00000000..b0f137de --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/thread_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000c diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/thread_siblings_list new file mode 100644 index 00000000..7a985754 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu2/topology/thread_siblings_list @@ -0,0 +1 @@ +2-3 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/online b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/online new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/online @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_id new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_id @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/book_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_id new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_id @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/core_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_id new file mode 100644 index 00000000..b8626c4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_id @@ -0,0 +1 @@ +4 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/drawer_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/physical_package_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/physical_package_id new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/physical_package_id @@ -0,0 +1 @@ +2 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/thread_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/thread_siblings new file mode 100644 index 00000000..b0f137de --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/thread_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000c diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/thread_siblings_list new file mode 100644 index 00000000..7a985754 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu3/topology/thread_siblings_list @@ -0,0 +1 @@ +2-3 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/online b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/online new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/online @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_id new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_id @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/book_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_id new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_id @@ -0,0 +1 @@ +2 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/core_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_id new file mode 100644 index 00000000..b8626c4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_id @@ -0,0 +1 @@ +4 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/drawer_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/physical_package_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/physical_package_id new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/physical_package_id @@ -0,0 +1 @@ +2 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/thread_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/thread_siblings new file mode 100644 index 00000000..294472bc --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/thread_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000030 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/thread_siblings_list new file mode 100644 index 00000000..e66d883a --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu4/topology/thread_siblings_list @@ -0,0 +1 @@ +4-5 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/online b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/online new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/online @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_id new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_id @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/book_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_id new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_id @@ -0,0 +1 @@ +2 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/core_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_id new file mode 100644 index 00000000..b8626c4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_id @@ -0,0 +1 @@ +4 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/drawer_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/physical_package_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/physical_package_id new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/physical_package_id @@ -0,0 +1 @@ +2 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/thread_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/thread_siblings new file mode 100644 index 00000000..294472bc --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/thread_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000030 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/thread_siblings_list new file mode 100644 index 00000000..e66d883a --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu5/topology/thread_siblings_list @@ -0,0 +1 @@ +4-5 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/online b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/online new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/online @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_id new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_id @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/book_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_id new file mode 100644 index 00000000..00750edc --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_id @@ -0,0 +1 @@ +3 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/core_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_id new file mode 100644 index 00000000..b8626c4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_id @@ -0,0 +1 @@ +4 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/drawer_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/physical_package_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/physical_package_id new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/physical_package_id @@ -0,0 +1 @@ +2 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/thread_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/thread_siblings new file mode 100644 index 00000000..c885e37d --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/thread_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000c0 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/thread_siblings_list new file mode 100644 index 00000000..fdd9f375 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu6/topology/thread_siblings_list @@ -0,0 +1 @@ +6-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/online b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/online new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/online @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_id new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_id @@ -0,0 +1 @@ +1 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/book_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_id new file mode 100644 index 00000000..00750edc --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_id @@ -0,0 +1 @@ +3 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/core_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_id new file mode 100644 index 00000000..b8626c4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_id @@ -0,0 +1 @@ +4 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_siblings new file mode 100644 index 00000000..be630d4c --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_siblings_list new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/drawer_siblings_list @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/physical_package_id b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/physical_package_id new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/physical_package_id @@ -0,0 +1 @@ +2 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/thread_siblings b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/thread_siblings new file mode 100644 index 00000000..c885e37d --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/thread_siblings @@ -0,0 +1 @@ +00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000c0 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/thread_siblings_list new file mode 100644 index 00000000..fdd9f375 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/cpu7/topology/thread_siblings_list @@ -0,0 +1 @@ +6-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/online b/tests/virhostcpudata/linux-with-frequency/cpu/online new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/online @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcpudata/linux-with-frequency/cpu/present b/tests/virhostcpudata/linux-with-frequency/cpu/present new file mode 100644 index 00000000..74fc2fb6 --- /dev/null +++ b/tests/virhostcpudata/linux-with-frequency/cpu/present @@ -0,0 +1 @@ +0-7 diff --git a/tests/virhostcputest.c b/tests/virhostcputest.c index d3ee1846..cb318df6 100644 --- a/tests/virhostcputest.c +++ b/tests/virhostcputest.c @@ -247,6 +247,7 @@ mymain(void) {"subcores2", VIR_ARCH_PPC64}, /* subcores, invalid configuration */ {"subcores3", VIR_ARCH_PPC64}, + {"with-frequency", VIR_ARCH_S390X}, }; if (virInitialize() < 0) -- 2.13.4

On 12/19/2017 05:08 AM, Bjoern Walk wrote:
Let's add a testcase for a S390 system running kernel version 4.14 on LPAR.
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> ---
Reviewed-by: John Ferlan <jferlan@redhat.com> John [...]

John Ferlan <jferlan@redhat.com> [2018-01-05, 03:55PM -0500]:
On 12/19/2017 05:08 AM, Bjoern Walk wrote:
Let's add a testcase for a S390 system running kernel version 4.14 on LPAR.
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> ---
Reviewed-by: John Ferlan <jferlan@redhat.com>
John
[...]
Thanks.

Let's also parse the available processor frequency information on S390 so that it can be utilized by virsh sysinfo: # virsh sysinfo <sysinfo type='smbios'> ... <processor> <entry name='family'>2964</entry> <entry name='manufacturer'>IBM/S390</entry> <entry name='version'>00</entry> <entry name='external_clock'>5000</entry> <entry name='max_speed'>5000</entry> <entry name='serial_number'>145F07</entry> </processor> ... </sysinfo> Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- src/util/virsysinfo.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index ab81b1f7..0c2267e3 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -495,6 +495,7 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) char *tmp_base; char *manufacturer = NULL; char *procline = NULL; + char *ncpu = NULL; int result = -1; virSysinfoProcessorDefPtr processor; @@ -524,11 +525,41 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) VIR_FREE(procline); } + + /* now, for each processor found, extract the frequency information */ + tmp_base = (char *) base; + + while ((tmp_base = strstr(tmp_base, "cpu number")) && + (tmp_base = virSysinfoParseS390Line(tmp_base, "cpu number", &ncpu))) { + unsigned int n; + char *mhz = NULL; + + if (virStrToLong_ui(ncpu, NULL, 10, &n) < 0 || n >= ret->nprocessor) + goto cleanup; + + if (!(tmp_base = strstr(tmp_base, "cpu MHz dynamic")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz dynamic", &mhz) || + !mhz) + goto cleanup; + + ret->processor[n].processor_external_clock = mhz; + + if (!(tmp_base = strstr(tmp_base, "cpu MHz static")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz static", &mhz) || + !mhz) + goto cleanup; + + ret->processor[n].processor_max_speed = mhz; + + VIR_FREE(ncpu); + } + result = 0; cleanup: VIR_FREE(manufacturer); VIR_FREE(procline); + VIR_FREE(ncpu); return result; } -- 2.13.4

On 12/19/2017 05:08 AM, Bjoern Walk wrote:
Let's also parse the available processor frequency information on S390 so that it can be utilized by virsh sysinfo:
# virsh sysinfo
<sysinfo type='smbios'> ... <processor> <entry name='family'>2964</entry> <entry name='manufacturer'>IBM/S390</entry> <entry name='version'>00</entry> <entry name='external_clock'>5000</entry> <entry name='max_speed'>5000</entry> <entry name='serial_number'>145F07</entry> </processor> ... </sysinfo>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> --- src/util/virsysinfo.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index ab81b1f7..0c2267e3 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -495,6 +495,7 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) char *tmp_base; char *manufacturer = NULL; char *procline = NULL; + char *ncpu = NULL; int result = -1; virSysinfoProcessorDefPtr processor;
@@ -524,11 +525,41 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
VIR_FREE(procline); } + + /* now, for each processor found, extract the frequency information */ + tmp_base = (char *) base; + + while ((tmp_base = strstr(tmp_base, "cpu number")) && + (tmp_base = virSysinfoParseS390Line(tmp_base, "cpu number", &ncpu))) { + unsigned int n; + char *mhz = NULL; + + if (virStrToLong_ui(ncpu, NULL, 10, &n) < 0 || n >= ret->nprocessor) + goto cleanup;
Should these be split? Reason I ask is if n >= ret->nprocessor, then going to cleanup results in returning a failure. That leads to an eventual generic command failed for some reason. Of course that reason shouldn't be possible, but since this is a CYA exercise, the check should have a specific error message - similar to what one would get if other calls failed...
+ + if (!(tmp_base = strstr(tmp_base, "cpu MHz dynamic")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz dynamic", &mhz) || + !mhz)
Other virSysinfoParseS390Line callers never check whether the returned 4th argument is NULL - should they? or is the !mhz check here (and the next one) superfluous? I note the @ncpu one above doesn't have it either. In the long run, who cares if it's NULL?
+ goto cleanup; + + ret->processor[n].processor_external_clock = mhz; + + if (!(tmp_base = strstr(tmp_base, "cpu MHz static")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz static", &mhz) || + !mhz) + goto cleanup; + + ret->processor[n].processor_max_speed = mhz;
FWIW, you could remove @mhz and replace with a "virSysinfoProcessorDefPtr processor;" definition followed by an appropriately placed "processsor = &ret->processor[n];", and then and assign directly to &processor->{external_clock|processor_max_speed} John
+ + VIR_FREE(ncpu); + } + result = 0;
cleanup: VIR_FREE(manufacturer); VIR_FREE(procline); + VIR_FREE(ncpu); return result; }

John Ferlan <jferlan@redhat.com> [2018-01-04, 03:56PM -0500]:
On 12/19/2017 05:08 AM, Bjoern Walk wrote:
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index ab81b1f7..0c2267e3 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -495,6 +495,7 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) char *tmp_base; char *manufacturer = NULL; char *procline = NULL; + char *ncpu = NULL; int result = -1; virSysinfoProcessorDefPtr processor;
@@ -524,11 +525,41 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
VIR_FREE(procline); } + + /* now, for each processor found, extract the frequency information */ + tmp_base = (char *) base; + + while ((tmp_base = strstr(tmp_base, "cpu number")) && + (tmp_base = virSysinfoParseS390Line(tmp_base, "cpu number", &ncpu))) { + unsigned int n; + char *mhz = NULL; + + if (virStrToLong_ui(ncpu, NULL, 10, &n) < 0 || n >= ret->nprocessor) + goto cleanup;
Should these be split? Reason I ask is if n >= ret->nprocessor, then going to cleanup results in returning a failure. That leads to an eventual generic command failed for some reason. Of course that reason shouldn't be possible, but since this is a CYA exercise, the check should have a specific error message - similar to what one would get if other calls failed...
I don't quite follow. You want an explicit error message here if n >= ret->nprocessor? Right now, for this call sequence there is no error reporting at all. This just fills the respective driver->hostsysinfo struct and sets this to NULL in case of an error. Later on, when the hostsysinfo is used and not available, an error is generated.
+ + if (!(tmp_base = strstr(tmp_base, "cpu MHz dynamic")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz dynamic", &mhz) || + !mhz)
Other virSysinfoParseS390Line callers never check whether the returned 4th argument is NULL - should they? or is the !mhz check here (and the next one) superfluous? I note the @ncpu one above doesn't have it either. In the long run, who cares if it's NULL?
Yes, combined with the strstr call I guess this check is not necessary. I can remove it.
+ goto cleanup; + + ret->processor[n].processor_external_clock = mhz; + + if (!(tmp_base = strstr(tmp_base, "cpu MHz static")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz static", &mhz) || + !mhz) + goto cleanup; + + ret->processor[n].processor_max_speed = mhz;
FWIW, you could remove @mhz and replace with a "virSysinfoProcessorDefPtr processor;" definition followed by an appropriately placed "processsor = &ret->processor[n];", and then and assign directly to &processor->{external_clock|processor_max_speed}
True, but that would probably make the parsing line harder to read. I'll see if I can find some improvements.
John
+ + VIR_FREE(ncpu); + } + result = 0;
cleanup: VIR_FREE(manufacturer); VIR_FREE(procline); + VIR_FREE(ncpu); return result; }

On 01/08/2018 03:39 AM, Bjoern Walk wrote:
John Ferlan <jferlan@redhat.com> [2018-01-04, 03:56PM -0500]:
On 12/19/2017 05:08 AM, Bjoern Walk wrote:
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index ab81b1f7..0c2267e3 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -495,6 +495,7 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) char *tmp_base; char *manufacturer = NULL; char *procline = NULL; + char *ncpu = NULL; int result = -1; virSysinfoProcessorDefPtr processor;
@@ -524,11 +525,41 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
VIR_FREE(procline); } + + /* now, for each processor found, extract the frequency information */ + tmp_base = (char *) base; + + while ((tmp_base = strstr(tmp_base, "cpu number")) && + (tmp_base = virSysinfoParseS390Line(tmp_base, "cpu number", &ncpu))) { + unsigned int n; + char *mhz = NULL; + + if (virStrToLong_ui(ncpu, NULL, 10, &n) < 0 || n >= ret->nprocessor) + goto cleanup;
Should these be split? Reason I ask is if n >= ret->nprocessor, then going to cleanup results in returning a failure. That leads to an eventual generic command failed for some reason. Of course that reason shouldn't be possible, but since this is a CYA exercise, the check should have a specific error message - similar to what one would get if other calls failed...
I don't quite follow. You want an explicit error message here if n >= ret->nprocessor? Right now, for this call sequence there is no error reporting at all. This just fills the respective driver->hostsysinfo struct and sets this to NULL in case of an error. Later on, when the hostsysinfo is used and not available, an error is generated.
When I first read, I read it "out of context"... If the first call fails, then you get an error, if the second call fails, then there is no error so the first question that pops in my mind is - should we provide an error message in that case? I would hope that n >= ret->nprocessor couldn't be true considering what was recently read a few lines earlier and if the number was wrong here, then the cpuinfo output would be AFU'd, right? I don't have picture in my mind of what's being processed, but didn't want to ignore this possible condition. Since @result would be -1, then going to cleanup at this point would be a failure. The question thus becomes should we ignore (and return 0) when cpuinfo is bad and maybe toss out a VIR_DEBUG or should we error out and throw everything away? The one thing with waiting for some caller to determine hostsysinfo is not available and an error generated is that we lose the reason why. I defer to you to decide what the best course of action is.
+ + if (!(tmp_base = strstr(tmp_base, "cpu MHz dynamic")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz dynamic", &mhz) || + !mhz)
Other virSysinfoParseS390Line callers never check whether the returned 4th argument is NULL - should they? or is the !mhz check here (and the next one) superfluous? I note the @ncpu one above doesn't have it either. In the long run, who cares if it's NULL?
Yes, combined with the strstr call I guess this check is not necessary. I can remove it.
+ goto cleanup; + + ret->processor[n].processor_external_clock = mhz; + + if (!(tmp_base = strstr(tmp_base, "cpu MHz static")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz static", &mhz) || + !mhz) + goto cleanup; + + ret->processor[n].processor_max_speed = mhz;
FWIW, you could remove @mhz and replace with a "virSysinfoProcessorDefPtr processor;" definition followed by an appropriately placed "processsor = &ret->processor[n];", and then and assign directly to &processor->{external_clock|processor_max_speed}
True, but that would probably make the parsing line harder to read. I'll see if I can find some improvements.
It isn't that important... When I first saw I thought should there be a VIR_STEAL_PTR usage, but reading for context removed that thought quickly. John
John
+ + VIR_FREE(ncpu); + } + result = 0;
cleanup: VIR_FREE(manufacturer); VIR_FREE(procline); + VIR_FREE(ncpu); return result; }

John Ferlan <jferlan@redhat.com> [2018-01-08, 07:55AM -0500]:
On 01/08/2018 03:39 AM, Bjoern Walk wrote:
John Ferlan <jferlan@redhat.com> [2018-01-04, 03:56PM -0500]:
On 12/19/2017 05:08 AM, Bjoern Walk wrote:
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index ab81b1f7..0c2267e3 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -495,6 +495,7 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) char *tmp_base; char *manufacturer = NULL; char *procline = NULL; + char *ncpu = NULL; int result = -1; virSysinfoProcessorDefPtr processor;
@@ -524,11 +525,41 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
VIR_FREE(procline); } + + /* now, for each processor found, extract the frequency information */ + tmp_base = (char *) base; + + while ((tmp_base = strstr(tmp_base, "cpu number")) && + (tmp_base = virSysinfoParseS390Line(tmp_base, "cpu number", &ncpu))) { + unsigned int n; + char *mhz = NULL; + + if (virStrToLong_ui(ncpu, NULL, 10, &n) < 0 || n >= ret->nprocessor) + goto cleanup;
Should these be split? Reason I ask is if n >= ret->nprocessor, then going to cleanup results in returning a failure. That leads to an eventual generic command failed for some reason. Of course that reason shouldn't be possible, but since this is a CYA exercise, the check should have a specific error message - similar to what one would get if other calls failed...
I don't quite follow. You want an explicit error message here if n >= ret->nprocessor? Right now, for this call sequence there is no error reporting at all. This just fills the respective driver->hostsysinfo struct and sets this to NULL in case of an error. Later on, when the hostsysinfo is used and not available, an error is generated.
When I first read, I read it "out of context"... If the first call fails, then you get an error, if the second call fails, then there is no error so the first question that pops in my mind is - should we provide an error message in that case?
In general, yes, we should provide some information about what's happening. But I found all this code to be somewhat unsatisfactory in this regard and wanted to avoid doing to many changes in this series.
I would hope that n >= ret->nprocessor couldn't be true considering what was recently read a few lines earlier and if the number was wrong here, then the cpuinfo output would be AFU'd, right? I don't have picture in my mind of what's being processed, but didn't want to ignore this possible condition.
Since @result would be -1, then going to cleanup at this point would be a failure. The question thus becomes should we ignore (and return 0) when cpuinfo is bad and maybe toss out a VIR_DEBUG or should we error out and throw everything away?
Alright, this sounds good. I agree that we should try to gather as much information as possible and don't discard everything when one part fails. But again, this whole file has somewhat different semantics.
The one thing with waiting for some caller to determine hostsysinfo is not available and an error generated is that we lose the reason why. I defer to you to decide what the best course of action is.
+ + if (!(tmp_base = strstr(tmp_base, "cpu MHz dynamic")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz dynamic", &mhz) || + !mhz) + goto cleanup;
Now, what about those? Should we also just log and return 0 here? CPU frequency information has only recently been introduced on S390 and running this on a kernel without support for it would now discard hostsysinfo entirely. -- IBM Systems Linux on z Systems & Virtualization Development ------------------------------------------------------------------------ IBM Deutschland Schönaicher Str. 220 71032 Böblingen Phone: +49 7031 16 1819 E-Mail: bwalk@de.ibm.com ------------------------------------------------------------------------ IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On 01/09/2018 04:08 AM, Bjoern Walk wrote:
John Ferlan <jferlan@redhat.com> [2018-01-08, 07:55AM -0500]:
On 01/08/2018 03:39 AM, Bjoern Walk wrote:
John Ferlan <jferlan@redhat.com> [2018-01-04, 03:56PM -0500]:
On 12/19/2017 05:08 AM, Bjoern Walk wrote:
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index ab81b1f7..0c2267e3 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -495,6 +495,7 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) char *tmp_base; char *manufacturer = NULL; char *procline = NULL; + char *ncpu = NULL; int result = -1; virSysinfoProcessorDefPtr processor;
@@ -524,11 +525,41 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
VIR_FREE(procline); } + + /* now, for each processor found, extract the frequency information */ + tmp_base = (char *) base; + + while ((tmp_base = strstr(tmp_base, "cpu number")) && + (tmp_base = virSysinfoParseS390Line(tmp_base, "cpu number", &ncpu))) { + unsigned int n; + char *mhz = NULL; + + if (virStrToLong_ui(ncpu, NULL, 10, &n) < 0 || n >= ret->nprocessor) + goto cleanup;
Should these be split? Reason I ask is if n >= ret->nprocessor, then going to cleanup results in returning a failure. That leads to an eventual generic command failed for some reason. Of course that reason shouldn't be possible, but since this is a CYA exercise, the check should have a specific error message - similar to what one would get if other calls failed...
I don't quite follow. You want an explicit error message here if n >= ret->nprocessor? Right now, for this call sequence there is no error reporting at all. This just fills the respective driver->hostsysinfo struct and sets this to NULL in case of an error. Later on, when the hostsysinfo is used and not available, an error is generated.
When I first read, I read it "out of context"... If the first call fails, then you get an error, if the second call fails, then there is no error so the first question that pops in my mind is - should we provide an error message in that case?
In general, yes, we should provide some information about what's happening. But I found all this code to be somewhat unsatisfactory in this regard and wanted to avoid doing to many changes in this series.
I would hope that n >= ret->nprocessor couldn't be true considering what was recently read a few lines earlier and if the number was wrong here, then the cpuinfo output would be AFU'd, right? I don't have picture in my mind of what's being processed, but didn't want to ignore this possible condition.
Since @result would be -1, then going to cleanup at this point would be a failure. The question thus becomes should we ignore (and return 0) when cpuinfo is bad and maybe toss out a VIR_DEBUG or should we error out and throw everything away?
Alright, this sounds good. I agree that we should try to gather as much information as possible and don't discard everything when one part fails. But again, this whole file has somewhat different semantics.
Cannot disagree with either point!
The one thing with waiting for some caller to determine hostsysinfo is not available and an error generated is that we lose the reason why. I defer to you to decide what the best course of action is.
+ + if (!(tmp_base = strstr(tmp_base, "cpu MHz dynamic")) || + !virSysinfoParseS390Line(tmp_base, "cpu MHz dynamic", &mhz) || + !mhz) + goto cleanup;
Now, what about those? Should we also just log and return 0 here? CPU frequency information has only recently been introduced on S390 and running this on a kernel without support for it would now discard hostsysinfo entirely.
Thinking partially in terms of something Andrea posted as a result of something I commented on: https://www.redhat.com/archives/libvir-list/2018-January/msg00240.html Maybe we should take the approach of leaving it as zero if we cannot find what we're looking for... So the above changes to if ((tmp_base = strstr(tmp_base, "cpu MHz dynamic")) && (virSysinfoParseS390Line(tmp_base..., &mhz)) xxxx = mhz; IOW: Update the value if both pass and do nothing if one or the other fails. If both pass then mhz won't be leaked because we'll save it. BTW: Since Andrea has pushed and patches 1 & 2 were R-B'd, I've pushed them. So it'll just be this third patch with adjustments. John

John Ferlan <jferlan@redhat.com> [2018-01-10, 05:34PM -0500]:
Thinking partially in terms of something Andrea posted as a result of something I commented on:
https://www.redhat.com/archives/libvir-list/2018-January/msg00240.html
Maybe we should take the approach of leaving it as zero if we cannot find what we're looking for...
So the above changes to
if ((tmp_base = strstr(tmp_base, "cpu MHz dynamic")) && (virSysinfoParseS390Line(tmp_base..., &mhz)) xxxx = mhz;
IOW: Update the value if both pass and do nothing if one or the other fails. If both pass then mhz won't be leaked because we'll save it.
Actually, this is not necessary. Also my initial point was irrelevant. If no frequency information is available, we just completely skip the whole loop (since no line with "cpu number" is found) and everything works as before. So, with my changes right now, we parse liberally, the only way we bail out with error (and discard everything in the process) is when the virStrToLong_uip fails. We report a debug message for the unlikely case of n >= ret->nprocessor. I have also added a new test case to the sysinfotest with updated data for /proc/cpuinfo and /proc/sysinfo. Will send v2 shortly.
BTW: Since Andrea has pushed and patches 1 & 2 were R-B'd, I've pushed them. So it'll just be this third patch with adjustments.
Thanks a lot!
John
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Best, Bjoern -- IBM Systems Linux on z Systems & Virtualization Development ------------------------------------------------------------------------ IBM Deutschland Schönaicher Str. 220 71032 Böblingen Phone: +49 7031 16 1819 E-Mail: bwalk@de.ibm.com ------------------------------------------------------------------------ IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
participants (2)
-
Bjoern Walk
-
John Ferlan