From patchwork Fri Jan 25 14:00:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 156588 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp406961jaa; Fri, 25 Jan 2019 06:13:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN6VBviqN5n64xPcQHMgwnB2tpoby6ltoHyydL2gzuEQW4vkSdG0wpDwAnm3rFx0hYYD+5Yv X-Received: by 2002:a1c:414:: with SMTP id 20mr7065115wme.67.1548425584754; Fri, 25 Jan 2019 06:13:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548425584; cv=none; d=google.com; s=arc-20160816; b=iyAn3z6A+rjNeobEHt6+/08jLtinRjn90yJJlTUy0z0BbpWPYpiGYhgFEDhVCH/S+5 yLl1kNKfav4ct2nDrJeonwdwR2pk28qWBasiLWIzVSkemLmrJ1y7fy75LJguLDPZDky9 VvvBVp7fZKiTURA9aSsvr+VYWfDm0UF5m8Y5Rx71ILWluKbLUieHr+wBkaOsiOsQLWl7 dbkozil1yO9CqDuIhGMkdLq6ld/T5LI03alylQiwAgB9gwoAIeWGu3l6+ZpSS28gG2rX 6gfy47xhdr1l84Cn7jVmTwhImdJZmuwUaU41XZWkZ9DtOVUTuiyT2Ug5CGiDXk8S3NCn fmJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=c+KjY4GXbPnP7Qx/tQakWL6Rvb+riTHS2+DauNnbB1I=; b=tbS2WKc8pyq30uUEu1/6Opaw7EmneyBH67j2MVV5WF+urP4fK6M1GSWiNK5MiHJz/p T6tVHs0tUITXhDUbW/zQ+4Xf3WNtA9voKx6U0vB1d5JdmVXrq2Q1DbUM2sIiYs1fFhR8 3ZgzErcYo6hI2KHsIOCQ4pAG2Lp/jcorqyYBOelsooV4b4YGJUvHMLAO4TociQ1ns2Mt yCEAxI70owj5+ig/VoIC65JCLqd/1mj3a2d3odp9Gt5IHt83PaOmHqrJZoKIrvzCUz0a 9/EsIX6rN/gGcOVI5BAAjge1GTavnn8R5ad08/m4afPiPUYXRWOA06wt0IL49peq0HLw dKsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EsZu9yBB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r3si74853217wrn.416.2019.01.25.06.13.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 25 Jan 2019 06:13:04 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EsZu9yBB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:45351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn2EB-0005AX-4A for patch@linaro.org; Fri, 25 Jan 2019 09:13:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn28z-0000nH-PB for qemu-devel@nongnu.org; Fri, 25 Jan 2019 09:07:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gn28x-0004Yd-UD for qemu-devel@nongnu.org; Fri, 25 Jan 2019 09:07:41 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:47029) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gn28w-0004Q9-Gk for qemu-devel@nongnu.org; Fri, 25 Jan 2019 09:07:39 -0500 Received: by mail-wr1-x442.google.com with SMTP id l9so10385441wrt.13 for ; Fri, 25 Jan 2019 06:07:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c+KjY4GXbPnP7Qx/tQakWL6Rvb+riTHS2+DauNnbB1I=; b=EsZu9yBBx2lHQ5j0mHDyNVG7wh1YLfrGjODiUUjEX41tehjroCZgEIUXqB3+2G7DlN TbtaLWCAc3HITmGbPPnFEadywdx1M3KZ1Xa8995yTc+t1oCLMFqQZPKuVQ/KCd1L4on5 t0szoO27jqHAcPUz37cfxJCnXBgnIf9jkhE5k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c+KjY4GXbPnP7Qx/tQakWL6Rvb+riTHS2+DauNnbB1I=; b=A89rxOWI5XNSdVHTcpkn2C6oPHLl+1aNzD9QBS8Bh0yUAo//50SSmBhz0vec5cg3PX 99V18beAf/AtjlVAAwpZ8gKskCL0SrwagPBy1r6exMoXtMMfasz1gGl8chzsfsVPGmjc pJJKdozNqNvEmJizDrV0pwtQ5crpwlE8mDXIwDRvnDZ6CIyi3YX8gcqMcjIW2tysqt5F c0wIuDVEbAdw8vgSC70Ld1dRaTsxTIX3An5fOzl76nNmBwMCYadZbkPkwZevhyyZOJLV au2U+1PX3DkLO+bYnOm/5agg9l2o76L/Onw3sKYXV7BC9nHvFetUO1jh8Kvv4qVHjKn2 kn4Q== X-Gm-Message-State: AJcUukeeOv0Kqdye4EYrTyQDNZxKKrOVYwb74Ij/oBDhy3fjfTMWDBve yBUCNRgE+VJOCzQ/FPRfUitZ3A== X-Received: by 2002:a5d:6b81:: with SMTP id n1mr12445757wrx.149.1548425249102; Fri, 25 Jan 2019 06:07:29 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x81sm65370534wmg.17.2019.01.25.06.07.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 06:07:28 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id C03C03E0B02; Fri, 25 Jan 2019 14:00:18 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 25 Jan 2019 14:00:17 +0000 Message-Id: <20190125140017.6092-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190125140017.6092-1-alex.bennee@linaro.org> References: <20190125140017.6092-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PATCH v1 14/14] scripts/qemu.py: allow arches use KVM for their 32bit cousins X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Eduardo Habkost , Cleber Rosa Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" A lot of architectures can run their 32 bit cousins on KVM so the kvm_available function needs to be a little less restricting when deciding if KVM is available. Signed-off-by: Alex Bennée --- scripts/qemu.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/scripts/qemu.py b/scripts/qemu.py index 0a5e02eb56..2934ee12c5 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -25,9 +25,18 @@ import tempfile LOG = logging.getLogger(__name__) +# Mapping host architecture to any additional architectures it can +# support which often includes its 32 bit cousin. +ADDITIONAL_ARCHES = { + "x86_64" : "i386", + "aarch64" : "armhf" +} def kvm_available(target_arch=None): - if target_arch and target_arch != os.uname()[4]: + host_arch = os.uname()[4] + if target_arch and target_arch != host_arch: + if target_arch == ADDITIONAL_ARCHES[host_arch]: + return True return False return os.access("/dev/kvm", os.R_OK | os.W_OK)