From patchwork Wed Mar 11 17:20:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 11432367 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C46B614B7 for ; Wed, 11 Mar 2020 17:22:37 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B61E20736 for ; Wed, 11 Mar 2020 17:22:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="efZDZSGd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B61E20736 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jC52V-00034K-Vc; Wed, 11 Mar 2020 17:21:03 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jC52V-000347-5J for xen-devel@lists.xenproject.org; Wed, 11 Mar 2020 17:21:03 +0000 X-Inumbo-ID: ae9228f8-63bc-11ea-b027-12813bfff9fa Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ae9228f8-63bc-11ea-b027-12813bfff9fa; Wed, 11 Mar 2020 17:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1583947262; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sLtREZEZlLC3yG0EYRrHTKiKUb68+Sp17JtPH4fHjhs=; b=efZDZSGdfQwcY3Ew3k8JyDqb2+7g8hUjQ5kKTZetap/qEpWQJFAU342l BCe/VfddpdYKya5m3CSRChKhaEu9kFng8a3pVUwKgcjjE1TsllKwBWm0k KPoqoCinMVyFYEcxv6n/lHhIs8imwj9zH3EK1Rb1F3eMeTiIcDatlIdgL o=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: I92wLXCwNnoqMOytSPOjtlw119r2p1RCy2ebfdZZguufx49Td7XxkzaCRVy+M3D9KZPBOT5G0E 7p0NmWTs5Th+0HEv3XbXwrRkjK1rAVOm2+cPVg4//Tc36PUqSUGX1a0nQkMbOaJ4DqR+i0WgAW hxqGwuw6LVA4jEUI9YCE4loXoHU3HzajkQo3chTsaTZyvDf8l51nY6OdOe1kMi7ssf/NYK2IBC EIebBMtwqxYjcQdYtoiTBj4Tg5khOEFcejNhYfvCzA82EldJViIiUCXIJCXZACm5/IPPshWIQv sa0= X-SBRS: 2.7 X-MesageID: 14418296 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,541,1574139600"; d="scan'208";a="14418296" From: Roger Pau Monne To: Date: Wed, 11 Mar 2020 18:20:08 +0100 Message-ID: <20200311172010.7777-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200311172010.7777-1-roger.pau@citrix.com> References: <20200311172010.7777-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH OSSTEST v5 4/5] examine: detect IOMMU availability and add it as a hostflag X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: ian.jackson@eu.citrix.com, Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Introduce a new test to check for iommu availability and add it as a hostflag if found. Signed-off-by: Roger Pau Monné --- Changes since v4: - Split out code into separate patches. Changes since v3: - Fail if `xl info` command fails. Changes since v2: - Allow flags to be removed. - Fix set_flag addition to HostBD/Static.pm. --- sg-run-job | 1 + ts-examine-iommu | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 ts-examine-iommu diff --git a/sg-run-job b/sg-run-job index 7c58d4ba..f6bfdfd5 100755 --- a/sg-run-job +++ b/sg-run-job @@ -679,6 +679,7 @@ proc examine-host-examine {install} { if {$ok} { run-ts -. = ts-examine-serial-post + host run-ts . = ts-examine-logs-save + host + run-ts . = ts-examine-iommu + host run-ts . = ts-examine-hostprops-save } } diff --git a/ts-examine-iommu b/ts-examine-iommu new file mode 100755 index 00000000..099d4be5 --- /dev/null +++ b/ts-examine-iommu @@ -0,0 +1,32 @@ +#!/usr/bin/perl -w +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2009-2020 Citrix Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +use strict qw(vars); +BEGIN { unshift @INC, qw(.); } +use Osstest; +use Osstest::TestSupport; + +tsreadconfig(); + +our ($whhost) = @ARGV; +$whhost ||= 'host'; +our $ho= selecthost($whhost); +our $info = target_cmd_output_root($ho, 'xl info', 10); +our $has_iommu = $info =~ /directio/; + +logm("$ho->{Ident} iommu: $has_iommu"); +hostflag_putative_record($ho, "iommu", $has_iommu);