[scripts][do-qemuarm] add support for using HVF on mac
Detect if it's being run on a darwin host and try to use HVF if the -k switch is passed.
This commit is contained in:
@@ -2,12 +2,30 @@
|
|||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
# host operating system
|
||||||
|
readonly HOST_OS=$(uname -s)
|
||||||
|
|
||||||
|
# host architecture
|
||||||
|
HOST_OS_ARCH=$(uname -m)
|
||||||
|
case $HOST_OS_ARCH in
|
||||||
|
aarch64*|arm64)
|
||||||
|
# flatten either aarch64 or arm64 to arm64 to keep it simple
|
||||||
|
readonly HOST_ARCH="arm64"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
readonly HOST_ARCH
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
#echo HOST_OS = $HOST_OS
|
||||||
|
#echo HOST_OS_ARCH = $HOST_OS_ARCH
|
||||||
|
|
||||||
function HELP {
|
function HELP {
|
||||||
echo "help:"
|
echo "help:"
|
||||||
echo "-6 : 64bit arm"
|
echo "-6 : 64bit arm"
|
||||||
echo "-3 : cortex-m3 based platform"
|
echo "-3 : cortex-m3 based platform"
|
||||||
echo "-v : boot kernel at EL2"
|
echo "-v : boot kernel at EL2"
|
||||||
echo "-k : use KVM"
|
echo "-k : use KVM or HVF acceleration if present (only on 64bit)"
|
||||||
echo "-m <memory in MB>"
|
echo "-m <memory in MB>"
|
||||||
echo "-s <number of cpus>"
|
echo "-s <number of cpus>"
|
||||||
echo
|
echo
|
||||||
@@ -75,7 +93,11 @@ if [ $DO_64BIT == 1 ]; then
|
|||||||
MACHINE="virt"
|
MACHINE="virt"
|
||||||
if [ $DO_KVM == 1 ]; then
|
if [ $DO_KVM == 1 ]; then
|
||||||
CPU="host"
|
CPU="host"
|
||||||
MACHINE+=",gic_version=host,accel=kvm"
|
if [ $HOST_OS == "Darwin" ]; then
|
||||||
|
MACHINE+=",gic_version=2,accel=hvf"
|
||||||
|
elif [ $HOST_OS == "Linux" ]; then
|
||||||
|
MACHINE+=",gic_version=host,accel=kvm"
|
||||||
|
fi
|
||||||
elif [ $DO_VIRT == 1 ]; then
|
elif [ $DO_VIRT == 1 ]; then
|
||||||
MACHINE+=",virtualization=on"
|
MACHINE+=",virtualization=on"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user