On 2013年04月19日 22:04, Jiri Denemark wrote:
On Thu, Mar 14, 2013 at 14:54:21 +0800, Li Zhang wrote:
From: Li Zhang <zhlci...@linux.vnet.ibm.com>

This patch adds a CPU feature "powernv" identifying IBM Power
processor that supports native hypervisor e.g. KVM. This can
be used by virtualization management software to determine
the CPU capabilities. PVR doesn't indicate whether it a
host or a guest CPU. So, we use /proc/cpuinfo to get the
platform information (PowerNV) and use that to set the
"powernv" flag.

Signed-off-by: Dipankar Sarma <dipan...@in.ibm.com>
Signed-off-by: Li Zhang <zhlci...@linux.vnet.ibm.com>
---
  src/cpu/cpu_map.xml    |    9 ++
  src/cpu/cpu_powerpc.c  |  349 ++++++++++++++++++++++++++++++++++++++----------
  src/cpu/cpu_ppc_data.h |    4 +
  src/util/sysinfo.c     |    2 +-
  4 files changed, 294 insertions(+), 70 deletions(-)
Looks like this patch was not even rebased since it was written back in
time 1.0.1 was released. Anyway, I realized I did not push my changes to
powerpc driver so I did that. And I also started rewriting this patch on
top of it since this patch is rather huge and seems to mix lots of
things. Also PowerPC CPUs seem to be quite different from x86 CPUs so
enhancing powerpc driver by copy&pasting code from x86 driver is not the
best way :-) It just makes powerpc driver unnecessarily complicated.

We hope it matches x86 driver, so most code are from x86.
There is no CPUID on powerpc, but we also need feature such as "powernv".

    <arch name='ppc64'>
     <!-- vendor definitions -->
      <vendor name='IBM' string='PowerPC'/>
+    <feature name='powernv'> <!-- SYSTEMID_POWERNV -->
+      <systemid platform='0x00000001'/>
+    </feature>
     <!-- IBM-based CPU models -->
      <model name='POWER7'>
+      <feature name='powernv'/>
+      <systemid pvr='0x003f0200'/>
        <vendor name='IBM'/>
      </model>
      <model name='POWER7_v2.1'>
+      <feature name='powernv'/>
+      <systemid pvr='0x003f0201'/>
        <vendor name='IBM'/>
      </model>
      <model name='POWER7_v2.3'>
+      <feature name='powernv'/>
+      <systemid pvr='0x003f0203'/>
        <vendor name='IBM'/>
      </model>
    </arch>
So what is this "powernv" feature used for? It won't show up in
capabilities XML as it is included in all powerpc CPU models. That also

This feature means that powerpc can support KVM.
Other platform, for example, pseries doesn't support KVM.
So we need this feature.

Currently, we haven't introduced this feature in capabilities XML yet.

means, users don't need to explicitly enable it when configuring guest
CPU. Thus it could only make sense to allow users to disable this
feature for a given guest. However, I don't see "powernv" string
anywhere in QEMU source code and thus it cannot really be used in any
way in guest CPU definition.

This feature is from sysinfo on host, not from QEMU.
QEMU haven't included this feature yet.
I am not sure whether it is necessary to introduce this to QEMU.

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to