On Thu, Mar 14, 2013 at 14:54:21 +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy(a)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 <dipankar(a)in.ibm.com>
Signed-off-by: Li Zhang <zhlcindy(a)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.
<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
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.
Jirka