xref: /kvm-unit-tests/powerpc/run (revision 8ad8b8cd4f289b8c7ed00d4c98f99efabb9e3222)
11b7dd7d3SSergey Bronnikov#!/usr/bin/env bash
28c85a478SAndrew Jones
357ab5a6dSThomas Huthif [ -z "$KUT_STANDALONE" ]; then
48c85a478SAndrew Jones	if [ ! -f config.mak ]; then
58c85a478SAndrew Jones		echo "run ./configure && make first. See ./configure -h"
68c85a478SAndrew Jones		exit 2
78c85a478SAndrew Jones	fi
88c85a478SAndrew Jones	source config.mak
9b2a2aa5dSAndrew Jones	source scripts/arch-run.bash
108c85a478SAndrew Jonesfi
118c85a478SAndrew Jones
1201e047d0SGavin Shanset_qemu_accelerator || exit $?
138c85a478SAndrew Jones
14fcf4e0d9SRadim Krčmářqemu=$(search_qemu_binary) ||
15fcf4e0d9SRadim Krčmář	exit $?
168c85a478SAndrew Jones
178c85a478SAndrew Jonesif ! $qemu -machine '?' 2>&1 | grep 'pseries' > /dev/null; then
1804fcca42SBalamuruhan S	echo "$qemu doesn't support pSeries ('-machine pseries'). Exiting."
198c85a478SAndrew Jones	exit 2
208c85a478SAndrew Jonesfi
218c85a478SAndrew Jones
228c85a478SAndrew JonesM='-machine pseries'
2301e047d0SGavin ShanM+=",accel=$ACCEL$ACCEL_PROPS"
24*8ad8b8cdSNicholas Piggin
25*8ad8b8cdSNicholas Pigginif [[ "$ACCEL" == "tcg" ]] ; then
26*8ad8b8cdSNicholas Piggin	M+=",cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,cap-ccf-assist=off"
27*8ad8b8cdSNicholas Pigginfi
28*8ad8b8cdSNicholas Piggin
293695c93aSAndrew Jonescommand="$qemu -nodefaults $M -bios $FIRMWARE"
308b13a5b5SRadim Krčmářcommand+=" -display none -serial stdio -kernel"
3137abdda9SThomas Huthcommand="$(migration_cmd) $(timeout_cmd) $command"
328c85a478SAndrew Jones
33b2a2aa5dSAndrew Jones# powerpc tests currently exit with rtas-poweroff, which exits with 0.
34b2a2aa5dSAndrew Jones# run_qemu treats that as a failure exit and returns 1, so we need
35b2a2aa5dSAndrew Jones# to fixup the fixup below by parsing the true exit code from the output.
36b2a2aa5dSAndrew Jones# The second fixup is also a FIXME, because once we add chr-testdev
37b2a2aa5dSAndrew Jones# support for powerpc, we won't need the second fixup.
38e0a8391eSRadim Krčmářrun_qemu_status $command "$@"
39