[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST v6 4/5] examine: detect IOMMU availability and add it as a hostflag


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 12 Mar 2020 15:40:56 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@xxxxxxxxxx; spf=Pass smtp.mailfrom=roger.pau@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: ian.jackson@xxxxxxxxxxxxx, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 12 Mar 2020 14:41:41 +0000
  • Ironport-sdr: VKV4agR6MQohz/yTYfKmBNVpgeAOuiUU6eEKUdHXrIsYsihfXplTtKInI1fZHfQhLIRFvNJYsE xzw6ycdwUI6UnD5M1npnHmJZ9JoWnAzefJwwVHsnp8/SQBliVOY4FQzdWeTchtMlrjQMi9DIM5 pF6lzvM4JmCfrrrIrrn2UsS9x01h1E+eY5lQX5haY9Nhr+7mg4FnbU2kmDEjG5xspp/jtCp+3M mQOTYV8LuNnJ5UHRvjreXe1DUW7QtZnbr1xChrzgaA8ngAaQM2Ce83c8HYvDfNsw2DkSFFb0Rg JKI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Introduce a new test to check for iommu availability and add it as a
hostflag if found.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Changes since v5:
 - Use a more restrictive regex.
 - Place iommu test before log collection.

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..97011843 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -678,6 +678,7 @@ proc examine-host-examine {install} {
     run-ts !broken capture-logs ts-logs-capture       + host
     if {$ok} {
        run-ts -.  =           ts-examine-serial-post + host
+       run-ts .   =           ts-examine-iommu       + host
        run-ts .   =           ts-examine-logs-save   + host
        run-ts .   =           ts-examine-hostprops-save
     }
diff --git a/ts-examine-iommu b/ts-examine-iommu
new file mode 100755
index 00000000..3c28d46a
--- /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 <http://www.gnu.org/licenses/>.
+
+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 =~ /^virt_caps\s*:.*\s(hvm|pv)_directio\s.*/m;
+
+logm("$ho->{Ident} iommu: $has_iommu");
+hostflag_putative_record($ho, "iommu", $has_iommu);
-- 
2.25.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.