Merge lp:~dannf/cpu-checker/arm-cortex-a15 into lp:cpu-checker

Proposed by dann frazier
Status: Needs review
Proposed branch: lp:~dannf/cpu-checker/arm-cortex-a15
Merge into: lp:cpu-checker
Diff against target: 86 lines (+28/-7)
3 files modified
debian/changelog (+8/-0)
debian/control (+2/-2)
kvm-ok (+18/-5)
To merge this branch: bzr merge lp:~dannf/cpu-checker/arm-cortex-a15
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Needs Information
dann frazier (community) Needs Resubmitting
CPU-Checker Developers Pending
Review via email: mp+171667@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Kees Cook (kees) wrote :

On Wed, Jun 26, 2013 at 09:22:23PM -0000, dann frazier wrote:
> -Architecture: amd64 i386
> -Depends: msr-tools, ${shlibs:Depends}, ${misc:Depends}
> +Architecture: all
> +Depends: ${shlibs:Depends}, ${misc:Depends}
> +Recommends: msr-tools

On x86, lacking msr-tools means this package is unusable. How about making
this Arch: any, and using Depends: msr-tools [i386,amd64] instead?

--
Kees Cook @outflux.net

lp:~dannf/cpu-checker/arm-cortex-a15 updated
45. By dann frazier

Make package "Architecture: any" to allow installation on ARM, but
restrict msr-tools dependency to x86

Revision history for this message
dann frazier (dannf) wrote :

> On Wed, Jun 26, 2013 at 09:22:23PM -0000, dann frazier wrote:
> > -Architecture: amd64 i386
> > -Depends: msr-tools, ${shlibs:Depends}, ${misc:Depends}
> > +Architecture: all
> > +Depends: ${shlibs:Depends}, ${misc:Depends}
> > +Recommends: msr-tools
>
> On x86, lacking msr-tools means this package is unusable. How about making
> this Arch: any, and using Depends: msr-tools [i386,amd64] instead?

Hi Kees! Thanks for the review. Resubmitted.

review: Needs Resubmitting
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Is there a way to make this support A50 which is basically the final target anyway?

review: Needs Information
Revision history for this message
dann frazier (dannf) wrote :

On Fri, Sep 13, 2013 at 5:02 AM, Zygmunt Krynicki
<email address hidden> wrote:
> Review: Needs Information
>
> Is there a way to make this support A50 which is basically the final target anyway?

I could certainly look at adding A50 support, but I don't see why
doing so should block this MP. My target for this patch is to really
to support A15.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

> On Fri, Sep 13, 2013 at 5:02 AM, Zygmunt Krynicki
> <email address hidden> wrote:
> > Review: Needs Information
> >
> > Is there a way to make this support A50 which is basically the final target
> anyway?
>
> I could certainly look at adding A50 support, but I don't see why
> doing so should block this MP. My target for this patch is to really
> to support A15.

Fair enough, no objections from me.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

This works well as far as I can see - thanks!

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

I also tested this on Intel hardware which supports HW virtualization:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz
stepping : 6
microcode : 0x60c
cpu MHz : 800.000
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm dtherm tpr_shadow vnmi flexpriority
bogomips : 5054.15
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz
stepping : 6
microcode : 0x60c
cpu MHz : 800.000
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm dtherm tpr_shadow vnmi flexpriority
bogomips : 5054.15
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

Outcome was:

INFO: /dev/kvm exists
KVM acceleration can be used

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Also on an Intel Atom system which does not support HW virtualization:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 28
model name : Intel(R) Atom(TM) CPU N270 @ 1.60GHz
stepping : 2
microcode : 0x20a
cpu MHz : 800.000
cache size : 512 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm movbe lahf_lm dtherm
bogomips : 3192.07
clflush size : 64
cache_alignment : 64
address sizes : 32 bits physical, 32 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 28
model name : Intel(R) Atom(TM) CPU N270 @ 1.60GHz
stepping : 2
microcode : 0x20a
cpu MHz : 1600.000
cache size : 512 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 1
initial apicid : 1
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm movbe lahf_lm dtherm
bogomips : 3192.07
clflush size : 64
cache_alignment : 64
address sizes : 32 bits physical, 32 bits virtual
power management:

The output is:

INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used

Unmerged revisions

45. By dann frazier

Make package "Architecture: any" to allow installation on ARM, but
restrict msr-tools dependency to x86

44. By dann frazier

Avoid magic number

43. By dann frazier

Add support ARM Cortex-A15 systems (LP: #1194632)

42. By dann frazier

Return package to "Architecture: all" by demoting msr-tools to Recommends

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-11-18 18:44:31 +0000
3+++ debian/changelog 2013-06-27 17:03:26 +0000
4@@ -1,3 +1,11 @@
5+cpu-checker (0.8-0ubuntu1) UNRELEASED; urgency=low
6+
7+ * Make package "Architecture: any" to allow installation on ARM, but
8+ restrict msr-tools dependency to x86
9+ * Add support ARM Cortex-A15 systems (LP: #1194632)
10+
11+ -- dann frazier <dann.frazier@canonical.com> Wed, 26 Jun 2013 15:10:16 -0600
12+
13 cpu-checker (0.7-0ubuntu1) precise; urgency=low
14
15 [ Colin Watson ]
16
17=== modified file 'debian/control'
18--- debian/control 2011-11-18 18:12:36 +0000
19+++ debian/control 2013-06-27 17:03:26 +0000
20@@ -9,8 +9,8 @@
21 Vcs-Bzr: lp:~cpu-checker-dev/cpu-checker/trunk
22
23 Package: cpu-checker
24-Architecture: amd64 i386
25-Depends: msr-tools, ${shlibs:Depends}, ${misc:Depends}
26+Architecture: any
27+Depends: msr-tools [amd64 i386], ${shlibs:Depends}, ${misc:Depends}
28 Conflicts: qemu-kvm (<< 0.12.3-0ubuntu13)
29 Replaces: qemu-kvm (<< 0.12.3-0ubuntu13)
30 Description: tools to help evaluate certain CPU (or BIOS) features
31
32=== modified file 'kvm-ok'
33--- kvm-ok 2011-09-07 23:21:19 +0000
34+++ kvm-ok 2013-06-27 17:03:26 +0000
35@@ -39,10 +39,20 @@
36 fi
37 }
38
39+ARM_CPU_PART_CORTEX_A15="0xc0f" # <asm/cputype.h>
40+
41 # check cpu flags for capability
42-virt=$(egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo '(vmx|svm)') || true
43-[ "$virt" = "vmx" ] && brand="intel"
44-[ "$virt" = "svm" ] && brand="amd"
45+if [ "$(uname -m)" = "armv7l" ]; then
46+ if egrep -m1 -w '^CPU part[[:blank:]]*:' /proc/cpuinfo | \
47+ egrep -wq "$ARM_CPU_PART_CORTEX_A15"; then
48+ virt="ARM"
49+ kvm_mod="kvm"
50+ fi
51+else
52+ virt=$(egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo '(vmx|svm)') || true
53+ [ "$virt" = "vmx" ] && kvm_mod="kvm_intel"
54+ [ "$virt" = "svm" ] && kvm_mod="kvm_amd"
55+fi
56
57 if [ -z "$virt" ]; then
58 echo "INFO: Your CPU does not support KVM extensions"
59@@ -56,7 +66,7 @@
60 verdict 0
61 else
62 echo "INFO: /dev/kvm does not exist"
63- echo "HINT: sudo modprobe kvm_$brand"
64+ echo "HINT: sudo modprobe $kvm_mod"
65 fi
66
67 assert_root
68@@ -66,7 +76,7 @@
69 if [ ! -r "$msr" ]; then
70 modprobe msr
71 fi
72-if [ ! -r "$msr" ]; then
73+if [ -e "$msr" -a ! -r "$msr" ]; then
74 echo "You must be root to run this check." >&2
75 exit 2
76 fi
77@@ -90,6 +100,9 @@
78 if [ "$BIT" = "1" ]; then
79 disabled=1
80 fi
81+elif [ "$virt" = "ARM" ]; then
82+ # Should also test that we booted in HYP mode, if detectable
83+ :
84 else
85 echo "FAIL: Unknown virtualization extension: $virt"
86 verdict 1

Subscribers

People subscribed via source and target branches

to all changes: