From patchwork Thu Mar 17 16:56:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12784328 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 422B0C433EF for ; Thu, 17 Mar 2022 16:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236687AbiCQQ5C (ORCPT ); Thu, 17 Mar 2022 12:57:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236685AbiCQQ5B (ORCPT ); Thu, 17 Mar 2022 12:57:01 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 78D6C19E39E for ; Thu, 17 Mar 2022 09:55:43 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 34B161682; Thu, 17 Mar 2022 09:55:43 -0700 (PDT) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 797993F7B4; Thu, 17 Mar 2022 09:55:42 -0700 (PDT) From: Alexandru Elisei To: drjones@redhat.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: [kvm-unit-tests PATCH] arm/run: Use TCG with qemu-system-arm on arm64 systems Date: Thu, 17 Mar 2022 16:56:01 +0000 Message-Id: <20220317165601.356466-1-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Andrew Jones If the user sets QEMU=qemu-system-arm on arm64 systems, the tests can only be run by using the TCG accelerator. In this case use TCG instead of KVM. Signed-off-by: Andrew Jones [ Alex E: Added commit message ] Signed-off-by: Alexandru Elisei --- arm/run | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arm/run b/arm/run index 28a0b4ad2729..128489125dcb 100755 --- a/arm/run +++ b/arm/run @@ -10,16 +10,24 @@ if [ -z "$KUT_STANDALONE" ]; then fi processor="$PROCESSOR" -ACCEL=$(get_qemu_accelerator) || +accel=$(get_qemu_accelerator) || exit $? -if [ "$ACCEL" = "kvm" ]; then +if [ "$accel" = "kvm" ]; then QEMU_ARCH=$HOST fi qemu=$(search_qemu_binary) || exit $? +if [ "$QEMU" ] && [ -z "$ACCEL" ] && + [ "$HOST" = "aarch64" ] && [ "$ARCH" = "arm" ] && + [ "$(basename $QEMU)" = "qemu-system-arm" ]; then + accel=tcg +fi + +ACCEL=$accel + if ! $qemu -machine '?' 2>&1 | grep 'ARM Virtual Machine' > /dev/null; then echo "$qemu doesn't support mach-virt ('-machine virt'). Exiting." exit 2