build_library: Update qemu script to run on arm64 machines

Signed-off-by: Geoff Levand <geoff@infradead.org>
This commit is contained in:
Geoff Levand 2017-07-28 14:39:53 -07:00
parent 5e94a55069
commit e76030e0e9

View File

@ -147,14 +147,18 @@ if [ "${SAFE_ARGS}" -eq 1 ]; then
# Disable KVM, for testing things like UEFI which don't like it
set -- -machine accel=tcg "$@"
else
case "${VM_BOARD}" in
amd64-usr)
case "${VM_BOARD}+$(uname -m)" in
amd64-usr+x86_64)
# Emulate the host CPU closely in both features and cores.
set -- -machine accel=kvm -cpu host -smp "${VM_NCPUS}" "$@" ;;
arm64-usr)
#FIXME(andrejro): tune the smp parameter
set -- -machine virt -cpu cortex-a57 -machine type=virt -smp 1 "$@" ;;
*) die "Unsupported arch" ;;
amd64-usr+*)
set -- -machine pc-q35-2.8 -cpu kvm64 -smp 1 -nographic "$@" ;;
arm64-usr+aarch64)
set -- -machine virt,accel=kvm,gic-version=3 -cpu host -smp "${VM_NCPUS}" -nographic "$@" ;;
arm64-usr+*)
set -- -machine virt -cpu cortex-a57 -smp 1 -nographic "$@" ;;
*)
die "Unsupported arch" ;;
esac
fi
@ -218,7 +222,7 @@ case "${VM_BOARD}" in
"$@"
;;
arm64-usr)
qemu-system-aarch64 -nographic \
qemu-system-aarch64 \
-name "$VM_NAME" \
-m ${VM_MEMORY} \
-netdev user,id=eth0,hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \