[libvirt] [PATCH v2 3/3] cpu: Add cpu test cases for PPC CPU driver.

Shivaprasad G Bhat sbhat at linux.vnet.ibm.com
Fri Sep 6 11:51:17 UTC 2013


Verified-by: Shivaprasad
The cpu model to pvr value mappings are
    POWER7 -> '0x003f0200'
    POWER7_v2.1 -> '0x003f0201'
    POWER7_v2.3 -> '0x003f0203'
    POWER7+_v2.1 -> '0x004a0201'
    POWER8_v1.0 -> '0x004b0100'

Verified on,
libvirt version: 1.1.2
Host : Fedora 19 - 3.11.0-rc7+
Guest : Fedora 19 - 3.9.2-301.fc19.ppc64p7
qemu - version 1.6.0

Test Results :

 On Host :
[root at ltcfbl9cb libvirt]# cat ../usr/etc/libvirt/qemu/shiv.xml | grep -e
cpu  -e model
  <vcpu placement='static'>16</vcpu>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>POWER7_v2.1</model>
  </cpu>
[root at ltcfbl9cb libvirt]# ./run ./tools/virsh list --all
 Id    Name                           State
----------------------------------------------------
 13    shiv                           running
The qemu CLI has the -cpu option 
[root at ltcfbl9cb libvirt]# ps -aef | grep qemu 
root     38478     1  3 05:38 ?        00:01:45 /usr/bin/qemu-kvm -name
shiv -S -machine pseries,accel=kvm,usb=off -cpu POWER7_v2.1 -m 1024
-realtime mlock=off -smp 16,sockets=16,cores=1,threads=1 -uuid
938df102-5f9a-1d53-60f8-...

On Guest :
[root at localhost ~]# dtc -I fs /proc/device-tree/ | grep POWER
        PowerPC,POWER7_V2.1 at 3c {
[root at localhost ~]# dtc -I fs /proc/device-tree/ | grep cpu-versio[   
            cpu-version = <0x3f0201>;
==================
On Host :
[root at ltcfbl9cb libvirt]# ./run ./tools/virsh  list
 Id    Name                           State
----------------------------------------------------
 5     shiv                           running
[root at ltcfbl9cb libvirt]# cat ../usr/etc/libvirt/qemu/shiv.xml | grep -e
cpu  -e model
  <vcpu placement='static'>16</vcpu>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>POWER7+_v2.1</model>
  </cpu>
[root at localhost ~]# dtc -I fs /proc/device-tree/ | grep cpu-version
            cpu-version = <0x4a0201>;
[root at localhost ~]# dtc -I fs /proc/device-tree/ | grep POWER
        PowerPC,POWER7+_V2.1 at 3c {

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

> -------- Original Message --------
> Subject: [libvirt][PATCH v2 0/3] Improve PPC CPU driver
> Date: Tue,  3 Sep 2013 14:28:22 +0800
> From: Li Zhang <zhlcindy at gmail.com>
> To: libvir-list at redhat.com, jdenemar at redhat.com
> CC: bpradip at in.ibm.com, Li Zhang <zhlcindy at linux.vnet.ibm.com>
>
> From: Li Zhang <zhlcindy at linux.vnet.ibm.com>
>
> Currently, PPC CPU driver doesn't support to parse guest data.
> It can't pass CPU parameters to Qemu command line.
>
> This patchset is to implement .guestData to support to parse guest
> CPU configuration and .update to support host-model and
host-passthrough.
>
> The guest CPU configuration is as the following:
>    <cpu match='exact'>
>      <model>POWER7_v2.3</model>
>      <vendor>IBM</vendor>
>    </cpu>
>
> v2 -> v1:
>    * Remove features functions calling for non-x86 platform (Doug
Goldstein)
>    * Improve update code.
>    * Merge update code with guestData.
>
> Li Zhang (3):
>    Remove CPU features check for non-x86 platform.
>    cpu: Implement guestData and update for PPC
>    cpu: Add cpu test cases for PPC CPU driver.
>
>   src/cpu/cpu_powerpc.c                              | 178
++++++++++++++++++++-
>   src/qemu/qemu_command.c                            |  16 +-
>   tests/cputest.c                                    |   9 ++
>   tests/cputestdata/ppc64-baseline-1-result.xml      |   3 +
>   .../ppc64-baseline-incompatible-vendors.xml        |  14 ++
>   .../ppc64-baseline-no-vendor-result.xml            |   3 +
>   tests/cputestdata/ppc64-baseline-no-vendor.xml     |   7 +
>   tests/cputestdata/ppc64-exact.xml                  |   3 +
>   tests/cputestdata/ppc64-guest-nofallback.xml       |   4 +
>   tests/cputestdata/ppc64-guest.xml                  |   4 +
>   .../ppc64-host+guest,ppc_models-result.xml         |   5 +
>   ...st-nofallback,ppc_models,POWER7_v2.1-result.xml |   5 +
>   tests/cputestdata/ppc64-host.xml                   |   6 +
>   tests/cputestdata/ppc64-strict.xml                 |   3 +
>   .../qemuxml2argv-pseries-cpu-exact.args            |   7 +
>   .../qemuxml2argv-pseries-cpu-exact.xml             |  21 +++
>   tests/qemuxml2argvtest.c                           |   1 +
>   17 files changed, 279 insertions(+), 10 deletions(-)
>   create mode 100644 tests/cputestdata/ppc64-baseline-1-result.xml
>   create mode 100644
tests/cputestdata/ppc64-baseline-incompatible-vendors.xml
>   create mode 100644
tests/cputestdata/ppc64-baseline-no-vendor-result.xml
>   create mode 100644 tests/cputestdata/ppc64-baseline-no-vendor.xml
>   create mode 100644 tests/cputestdata/ppc64-exact.xml
>   create mode 100644 tests/cputestdata/ppc64-guest-nofallback.xml
>   create mode 100644 tests/cputestdata/ppc64-guest.xml
>   create mode 100644 tests/cputestdata/ppc64-host
+guest,ppc_models-result.xml
>   create mode 100644
> tests/cputestdata/ppc64-host
+guest-nofallback,ppc_models,POWER7_v2.1-result.xml
>   create mode 100644 tests/cputestdata/ppc64-host.xml
>   create mode 100644 tests/cputestdata/ppc64-strict.xml
>   create mode 100644
tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args
>   create mode 100644
tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.xml
>







More information about the libvir-list mailing list