tests/test-kvm-explicit-cpu.sh \
tests/test-linux-vserver.sh \
tests/test-lkvm.sh \
+ tests/test-lkvm-arm.sh \
tests/test-lxc.sh \
tests/test-lx86.sh \
tests/test-parallels-desktop.sh \
tests/test-qemu.sh \
+ tests/test-qemu-arm.sh \
tests/test-rhel5-xen-dom0.sh \
tests/test-rhel5-xen-domU-hvm.sh \
tests/test-rhel5-xen-domU-hvm-ia64.sh \
tests/test-rhel5-xen-domU-pv.sh \
+ tests/test-xen-arm.sh \
tests/test-zvm.sh
EXTRA_DIST = \
tests/lkvm/sbin/dmidecode \
tests/lkvm/sbin/uname \
tests/lkvm/sbin/virt-what-cpuid-helper \
+ tests/lkvm-arm/proc/cpuinfo \
+ tests/lkvm-arm/proc/device-tree/compatible \
+ tests/lkvm-arm/proc/self/status \
+ tests/lkvm-arm/sbin/dmidecode \
+ tests/lkvm-arm/sbin/uname \
+ tests/lkvm-arm/sbin/virt-what-cpuid-helper \
tests/lxc/proc/1/environ \
tests/lxc/proc/cpuinfo \
tests/lxc/proc/self/status \
tests/qemu/sbin/dmidecode \
tests/qemu/sbin/uname \
tests/qemu/sbin/virt-what-cpuid-helper \
+ tests/qemu-arm/proc/cpuinfo \
+ tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible \
+ tests/qemu-arm/proc/self/status \
+ tests/qemu-arm/sbin/dmidecode \
+ tests/qemu-arm/sbin/uname \
+ tests/qemu-arm/sbin/virt-what-cpuid-helper \
tests/rhel5-xen-dom0/proc/cpuinfo \
tests/rhel5-xen-dom0/proc/self/status \
tests/rhel5-xen-dom0/proc/xen/balloon \
tests/rhel5-xen-domU-pv/sys/hypervisor/compilation/compiled_by \
tests/rhel5-xen-domU-pv/sys/hypervisor/compilation/compile_date \
tests/rhel5-xen-domU-pv/sys/hypervisor/uuid \
+ tests/xen-arm/proc/cpuinfo \
+ tests/xen-arm/proc/device-tree/compatible \
+ tests/xen-arm/proc/self/status \
+ tests/xen-arm/sbin/dmidecode \
+ tests/xen-arm/sbin/uname \
+ tests/xen-arm/sbin/virt-what-cpuid-helper \
tests/zvm/proc/cpuinfo \
tests/zvm/proc/self/status \
tests/zvm/proc/sysinfo \
--- /dev/null
+processor : 0
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 1
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 2
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 3
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 4
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 5
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 6
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 7
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
--- /dev/null
+linux,dummy-virt
--- /dev/null
+Name: cat
+State: R (running)
+Tgid: 8307
+Ngid: 0
+Pid: 8307
+PPid: 1415
+TracerPid: 0
+Uid: 0 0 0 0
+Gid: 0 0 0 0
+FDSize: 256
+Groups:
+VmPeak: 109696 kB
+VmSize: 109696 kB
+VmLck: 0 kB
+VmPin: 0 kB
+VmHWM: 832 kB
+VmRSS: 832 kB
+VmData: 320 kB
+VmStk: 256 kB
+VmExe: 64 kB
+VmLib: 1536 kB
+VmPTE: 192 kB
+VmSwap: 0 kB
+Threads: 1
+SigQ: 0/5821
+SigPnd: 0000000000000000
+ShdPnd: 0000000000000000
+SigBlk: 0000000000000000
+SigIgn: 0000000000000000
+SigCgt: 0000000000000000
+CapInh: 0000000000000000
+CapPrm: 0000003fffffffff
+CapEff: 0000003fffffffff
+CapBnd: 0000003fffffffff
+Seccomp: 0
+Cpus_allowed: ff
+Cpus_allowed_list: 0-7
+Mems_allowed: 1
+Mems_allowed_list: 0
+voluntary_ctxt_switches: 1
+nonvoluntary_ctxt_switches: 1
--- /dev/null
+#!/bin/sh -
+exit 1
--- /dev/null
+#!/bin/sh -
+echo aarch64
--- /dev/null
+#!/bin/sh -
+# nothing
--- /dev/null
+processor : 0
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 1
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 2
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 3
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 4
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 5
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 6
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 7
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
--- /dev/null
+qemu,fw-cfg-mmio
--- /dev/null
+Name: cat
+State: R (running)
+Tgid: 8307
+Ngid: 0
+Pid: 8307
+PPid: 1415
+TracerPid: 0
+Uid: 0 0 0 0
+Gid: 0 0 0 0
+FDSize: 256
+Groups:
+VmPeak: 109696 kB
+VmSize: 109696 kB
+VmLck: 0 kB
+VmPin: 0 kB
+VmHWM: 832 kB
+VmRSS: 832 kB
+VmData: 320 kB
+VmStk: 256 kB
+VmExe: 64 kB
+VmLib: 1536 kB
+VmPTE: 192 kB
+VmSwap: 0 kB
+Threads: 1
+SigQ: 0/5821
+SigPnd: 0000000000000000
+ShdPnd: 0000000000000000
+SigBlk: 0000000000000000
+SigIgn: 0000000000000000
+SigCgt: 0000000000000000
+CapInh: 0000000000000000
+CapPrm: 0000003fffffffff
+CapEff: 0000003fffffffff
+CapBnd: 0000003fffffffff
+Seccomp: 0
+Cpus_allowed: ff
+Cpus_allowed_list: 0-7
+Mems_allowed: 1
+Mems_allowed_list: 0
+voluntary_ctxt_switches: 1
+nonvoluntary_ctxt_switches: 1
--- /dev/null
+#!/bin/sh -
+exit 1
--- /dev/null
+#!/bin/sh -
+echo aarch64
--- /dev/null
+#!/bin/sh -
+# nothing
--- /dev/null
+# Test for LKVM on ARM
+# Copyright (C) 2015 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+root=tests/lkvm-arm
+
+output="$(./virt-what --test-root=$root 2>&1)"
+expected="lkvm"
+
+if [ "$output" != "$expected" ]; then
+ echo "$0: test failed because output did not match expected"
+ echo "Expected output was:"
+ echo "----------------------------------------"
+ echo "$expected"
+ echo "----------------------------------------"
+ echo "But the actual output of the program was:"
+ echo "----------------------------------------"
+ echo "$output"
+ echo "----------------------------------------"
+ exit 1
+fi
--- /dev/null
+# Test for qemu on ARM
+# Copyright (C) 2015 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+root=tests/qemu-arm
+
+output="$(./virt-what --test-root=$root 2>&1)"
+expected="qemu"
+
+if [ "$output" != "$expected" ]; then
+ echo "$0: test failed because output did not match expected"
+ echo "Expected output was:"
+ echo "----------------------------------------"
+ echo "$expected"
+ echo "----------------------------------------"
+ echo "But the actual output of the program was:"
+ echo "----------------------------------------"
+ echo "$output"
+ echo "----------------------------------------"
+ exit 1
+fi
--- /dev/null
+# Test for Xen on ARM
+# Copyright (C) 2015 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+root=tests/xen-arm
+
+output="$(./virt-what --test-root=$root 2>&1)"
+expected="xen"
+
+if [ "$output" != "$expected" ]; then
+ echo "$0: test failed because output did not match expected"
+ echo "Expected output was:"
+ echo "----------------------------------------"
+ echo "$expected"
+ echo "----------------------------------------"
+ echo "But the actual output of the program was:"
+ echo "----------------------------------------"
+ echo "$output"
+ echo "----------------------------------------"
+ exit 1
+fi
--- /dev/null
+processor : 0
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 1
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 2
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 3
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 4
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 5
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 6
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
+
+processor : 7
+Features : fp asimd evtstrm
+CPU implementer : 0x50
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0x000
+CPU revision : 0
--- /dev/null
+Name: cat
+State: R (running)
+Tgid: 8307
+Ngid: 0
+Pid: 8307
+PPid: 1415
+TracerPid: 0
+Uid: 0 0 0 0
+Gid: 0 0 0 0
+FDSize: 256
+Groups:
+VmPeak: 109696 kB
+VmSize: 109696 kB
+VmLck: 0 kB
+VmPin: 0 kB
+VmHWM: 832 kB
+VmRSS: 832 kB
+VmData: 320 kB
+VmStk: 256 kB
+VmExe: 64 kB
+VmLib: 1536 kB
+VmPTE: 192 kB
+VmSwap: 0 kB
+Threads: 1
+SigQ: 0/5821
+SigPnd: 0000000000000000
+ShdPnd: 0000000000000000
+SigBlk: 0000000000000000
+SigIgn: 0000000000000000
+SigCgt: 0000000000000000
+CapInh: 0000000000000000
+CapPrm: 0000003fffffffff
+CapEff: 0000003fffffffff
+CapBnd: 0000003fffffffff
+Seccomp: 0
+Cpus_allowed: ff
+Cpus_allowed_list: 0-7
+Mems_allowed: 1
+Mems_allowed_list: 0
+voluntary_ctxt_switches: 1
+nonvoluntary_ctxt_switches: 1
--- /dev/null
+#!/bin/sh -
+exit 1
--- /dev/null
+#!/bin/sh -
+echo aarch64
--- /dev/null
+#!/bin/sh -
+# nothing
# Architecture.
# Note for the purpose of testing, we only call uname with -p option.
-arch=$(uname -p)
+arch=$(uname -p | sed -e 's/i.86/i386/' | sed -e 's/arm.*/arm/')
# Check for VMware.
# cpuid check added by Chetan Loke.
# enough information at present to tell whether this is dom0
# or domU. XXX
echo xen
+elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then
+ if [ -d "${root}/proc/device-tree/hypervisor" ] &&
+ grep -q "xen" "${root}/proc/device-tree/hypervisor/compatible"; then
+ echo xen
+ skip_qemu_kvm=true
+ skip_lkvm=true
+ fi
elif [ "$arch" = "ia64" ]; then
if [ -d "${root}/sys/bus/xen" -a ! -d "${root}/sys/bus/xen-backend" ]; then
# PV-on-HVM drivers installed in a Xen guest.
if ! "$skip_qemu_kvm"; then
if [ "$cpuid" = "KVMKVMKVM" ]; then
echo kvm
+ elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then
+ if [ -d "${root}/proc/device-tree" ] &&
+ ls "${root}/proc/device-tree" | grep -q "fw-cfg"; then
+ # We don't have enough information to determine if we're
+ # using KVM acceleration or not.
+ echo qemu
+ skip_lkvm=true
+ fi
else
# XXX This is known to fail for qemu with the explicit -cpu
# option, since /proc/cpuinfo will not contain the QEMU
if ! "$skip_lkvm"; then
if [ "$cpuid" = "LKVMLKVMLKVM" ]; then
echo lkvm
+ elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then
+ if [ -d "${root}/proc/device-tree" ] &&
+ grep -q "dummy-virt" "${root}/proc/device-tree/compatible"; then
+ echo lkvm
+ fi
fi
fi