All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: ian.jackson@eu.citrix.com, Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH OSSTEST v5 4/5] examine: detect IOMMU availability and add it as a hostflag
Date: Wed, 11 Mar 2020 18:20:08 +0100	[thread overview]
Message-ID: <20200311172010.7777-4-roger.pau@citrix.com> (raw)
In-Reply-To: <20200311172010.7777-1-roger.pau@citrix.com>

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@citrix.com>
---
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 <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 =~ /directio/;
+
+logm("$ho->{Ident} iommu: $has_iommu");
+hostflag_putative_record($ho, "iommu", $has_iommu);
-- 
2.25.0


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

  parent reply	other threads:[~2020-03-11 17:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 17:20 [Xen-devel] [PATCH OSSTEST v5 1/5] host: introduce modify_host Roger Pau Monne
2020-03-11 17:20 ` [Xen-devel] [PATCH OSSTEST v5 2/5] host: introduce a helper to modify hostflags Roger Pau Monne
2020-03-12 10:57   ` Ian Jackson
2020-03-11 17:20 ` [Xen-devel] [PATCH OSSTEST v5 3/5] ts-examine-hostprops-save: record hostflags also Roger Pau Monne
2020-03-12 10:58   ` Ian Jackson
2020-03-11 17:20 ` Roger Pau Monne [this message]
2020-03-12 11:02   ` [Xen-devel] [PATCH OSSTEST v5 4/5] examine: detect IOMMU availability and add it as a hostflag Ian Jackson
2020-03-12 11:12   ` Ian Jackson
2020-03-12 14:40   ` [Xen-devel] [PATCH OSSTEST v6 " Roger Pau Monne
2020-03-12 14:54     ` Ian Jackson
2020-03-11 17:20 ` [Xen-devel] [PATCH OSSTEST v5 5/5] make-flight: add dom0 PVH test Roger Pau Monne
2020-03-12 10:56 ` [Xen-devel] [PATCH OSSTEST v5 1/5] host: introduce modify_host Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200311172010.7777-4-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.