Showing posts with label qclib. Show all posts
Showing posts with label qclib. Show all posts

Thursday, October 6, 2016

Linux kernel 4.8 released

Linux kernel 4.8 (available here) has been released, here are the highlights in support of KVM on z:

Nested Virtualization
This feature allows to start further KVM hosts within KVM guests, also called second level virtualization. As a prerequisite, it requires a recent, post-2.7 version of QEMU including the s390 CPU models (assumed to be included in the forthcoming QEMU 2.8 release).
Nested virtualization is currently turned off per default, and has to be enabled when loading the kvm module:

   [root ~]# modprobe kvm nested=1

or by appending kvm.nested=1 to the kernel command line.
When starting QEMU, make sure to chose the right machine ("s390-ccw-virtio-2.8" or higher) in the domain xml's os element for the guest:

   <os>
      <type arch='s390x' machine='s390-ccw-virtio-2.8'>hvm</type>
      <boot dev='hd'/>
   </os>


Finally, verify in a KVM guest that hosting further KVM guests is possible, as indicated by flag "sie" in /proc/cpuinfo as follows:

   [root ~]# cat /proc/cpuinfo | grep features
   features        : esan3 zarch stfle msa ldisp eimm dfp
edat etf3eh
                     highgprs te vx sie

STHYI Instruction available for KVM Guests
Linux kernel 4.8 saw the inclusion of an implementation of the STHYI (Store Hypervisor Information) instruction. Using Linux kernel 4.8 for the host will make the STHYI instruction available to all KVM guests of that host.
Previously available on z/VM only, this instruction provides detailed information on CPU resources on various levels (machine, LPAR, hypervisor, guest, etc.).

Use qclib to access the information. Also see this blog post for further details regarding qclib and KVM on z.

Friday, June 10, 2016

qclib v1.2.0 released

New version qclib v1.2.0 was released on IBM developerWorks here.
Among others, this version adds additional counts for KVM hosts and guests as follows:
  • For KVM hosts: Counts for CPs, IFLs and CPUs (sum of CPs and IFLs)
  • For KVM guests: CP and IFL counts
Below is some (edited) output of the sample program qc_test (part of the library), highlighting the new attributes for a KVM host with 4 IFLs and a guest with 2 virtual IFLs. See the README for documentation and further details.
        ===== Layer 3: KVM-hypervisor ==========================
                 qc_layer_type [n/a]: KVM-hypervisor
             qc_layer_category [n/a]: HOST
             qc_layer_type_num [n/a]: 6
         qc_layer_category_num [n/a]: 2
         qc_control_program_id [S  ]: KVM/Linux
                 qc_adjustment [S  ]: 1000

              qc_num_cpu_total [  V]: 4
          qc_num_cpu_dedicated [SHV]: 0
             qc_num_cpu_shared [SHV]: 4
               qc_num_cp_total [ HV]: 0
           qc_num_cp_dedicated [ hV]: 0
              qc_num_cp_shared [ hV]: 0
              qc_num_ifl_total [SHV]: 4
          qc_num_ifl_dedicated [ShV]: 0
             qc_num_ifl_shared [ShV]: 4

        ===================================================

          ===== Layer 4: KVM-guest
    ==========================
                   qc_layer_type [n/a]: KVM-guest
               qc_layer_category [n/a]: GUEST
               qc_layer_type_num [n/a]: 7
           qc_layer_category_num [n/a]: 1
                   qc_layer_name [S  ]: u1604
          qc_layer_extended_name [S  ]: u1604
                   qc_layer_uuid [S  ]: 407d134c-7d93-4a7b-bd27-4568ef10e85a

                qc_num_cpu_total [S  ]: 2
           qc_num_cpu_configured [S  ]: 2
              qc_num_cpu_standby [S  ]: 0
             qc_num_cpu_reserved [S  ]: 0
            qc_num_cpu_dedicated [S  ]: 0
               qc_num_cpu_shared [S  ]: 2
                qc_num_ifl_total [S  ]: 2
            qc_num_ifl_dedicated [S  ]: 0
               qc_num_ifl_shared [S  ]: 2
            qc_ifl_dispatch_type [SHV]: 3

         
    ===================================================

    qclib is a C library providing access to system information on the various layers of virtualization on z Systems.