From patchwork Thu Feb 17 10:28:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikos Nikoleris X-Patchwork-Id: 12749714 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 B9AA6C433F5 for ; Thu, 17 Feb 2022 10:28:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234924AbiBQK2h (ORCPT ); Thu, 17 Feb 2022 05:28:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231827AbiBQK2f (ORCPT ); Thu, 17 Feb 2022 05:28:35 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3FFAC91356 for ; Thu, 17 Feb 2022 02:28:18 -0800 (PST) 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 7C3B3D6E; Thu, 17 Feb 2022 02:28:18 -0800 (PST) Received: from Q2TWYV475D.emea.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6DAE83F718; Thu, 17 Feb 2022 02:28:17 -0800 (PST) From: Nikos Nikoleris To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, drjones@redhat.com, pbonzini@redhat.com, thuth@redhat.com Cc: jade.alglave@arm.com, Nikos Nikoleris Subject: [kvm-unit-tests PATCH] configure: arm: Fixes to build and run tests on Apple Silicon Date: Thu, 17 Feb 2022 10:28:06 +0000 Message-Id: <20220217102806.28749-1-nikos.nikoleris@arm.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On MacOS: $> uname -m returns: arm64 To unify how we handle the achitecture detection across different systems, sed it to aarch64 which is what's typically reported on Linux. In addition, when HVF is the acceleration method on aarch64, make sure we select the right processor when invoking qemu. Signed-off-by: Nikos Nikoleris --- arm/run | 3 +++ configure | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arm/run b/arm/run index 2153bd3..0629b69 100755 --- a/arm/run +++ b/arm/run @@ -27,6 +27,9 @@ if [ "$ACCEL" = "kvm" ]; then if $qemu $M,\? 2>&1 | grep gic-version > /dev/null; then M+=',gic-version=host' fi +fi + +if [ "$ACCEL" = "kvm" ] || [ "$ACCEL" = "hvf" ]; then if [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ]; then processor="host" if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then diff --git a/configure b/configure index 2d9c3e0..ff840c1 100755 --- a/configure +++ b/configure @@ -14,7 +14,7 @@ objcopy=objcopy objdump=objdump ar=ar addr2line=addr2line -arch=$(uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/') +arch=$(uname -m | sed -e 's/i.86/i386/;s/arm64/aarch64/;s/arm.*/arm/;s/ppc64.*/ppc64/') host=$arch cross_prefix= endian=""