Package: cpu-checker / 0.7-1.1

cpu-checker-s390x.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Index: cpu-checker-0.7/kvm-ok
===================================================================
--- cpu-checker-0.7.orig/kvm-ok
+++ cpu-checker-0.7/kvm-ok
@@ -42,30 +42,29 @@ verdict() {
 ARM_CPU_PART_CORTEX_A15="0xc0f" # <asm/cputype.h>
 
 # check cpu flags for capability
-if [ "$(uname -m)" = "armv7l" ]; then
-    if egrep -m1 -w '^CPU part[[:blank:]]*:' /proc/cpuinfo | \
-	egrep -wq "$ARM_CPU_PART_CORTEX_A15"; then
+case "$(uname -m)" in
+    armv7l)
+	if egrep -m1 -w '^CPU part[[:blank:]]*:' /proc/cpuinfo | \
+		egrep -wq "$ARM_CPU_PART_CORTEX_A15"; then
+	    virt="ARM"
+	    kvm_mod="kvm"
+	fi
+	;;
+    aarch64)
 	virt="ARM"
 	kvm_mod="kvm"
-    fi
-elif [ "$(uname -m)" = "aarch64" ]; then
-	virt="ARM"
-	kvm_mod="kvm"
-elif [ "$(uname -m)" = "ppc64le" ]; then
-	# FIXME: Assume that all ppc64el is kvm capable
-	exit 0
-	virt="POWER"
-	kvm_mod="kvm"
-elif [ "$(uname -m)" = "ppc64" ]; then
-	# FIXME: Assume that all ppc64 is kvm capable
-	exit 0
-	virt="POWER"
+	;;
+    ppc64le|ppc64|s390x)
+	# FIXME: Assume that all POWER and z/Systems are KVM capable
+	virt="generic"
 	kvm_mod="kvm"
-else
-    virt=$(egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo '(vmx|svm)') || true
-    [ "$virt" = "vmx" ] && kvm_mod="kvm_intel"
-    [ "$virt" = "svm" ] && kvm_mod="kvm_amd"
-fi
+	;;
+    *)
+      virt=$(egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo '(vmx|svm)') || true
+      [ "$virt" = "vmx" ] && kvm_mod="kvm_intel"
+      [ "$virt" = "svm" ] && kvm_mod="kvm_amd"
+      ;;
+esac
 
 if [ -z "$virt" ]; then
 	echo "INFO: Your CPU does not support KVM extensions"
@@ -116,8 +115,7 @@ elif [ "$virt" = "svm" ]; then
 elif [ "$virt" = "ARM" ]; then
     # Should also test that we booted in HYP mode, if detectable
     :
-elif [ "$virt" = "POWER" ]; then
-    # Should also test that we booted in HYP mode, if detectable
+elif [ "$virt" = "generic" ]; then
     :
 else
 	echo "FAIL: Unknown virtualization extension: $virt"