262 lines
20 KiB
HTML
262 lines
20 KiB
HTML
<!DOCTYPE html>
|
|
<html class="writer-html5" lang="en" data-content_root="../../">
|
|
<head>
|
|
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Subchannel passthrough via vfio-ccw — QEMU Debian 1:8.2.2+ds-0ubuntu1.11 documentation</title>
|
|
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
|
|
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=86f27845" />
|
|
<link rel="stylesheet" type="text/css" href="../../_static/theme_overrides.css?v=08e6c168" />
|
|
|
|
|
|
<link rel="shortcut icon" href="../../_static/qemu_32x32.png"/>
|
|
|
|
<script src="../../_static/jquery.js?v=8dae8fb0"></script>
|
|
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
|
<script src="../../_static/documentation_options.js?v=802af9f6"></script>
|
|
<script src="../../_static/doctools.js?v=888ff710"></script>
|
|
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
<script src="../../_static/custom.js?v=2ab9f71d"></script>
|
|
<script src="../../_static/js/theme.js"></script>
|
|
<link rel="index" title="Index" href="../../genindex.html" />
|
|
<link rel="search" title="Search" href="../../search.html" />
|
|
<link rel="next" title="PCI devices on s390x" href="pcidevices.html" />
|
|
<link rel="prev" title="3270 devices" href="3270.html" />
|
|
</head>
|
|
|
|
<body class="wy-body-for-nav">
|
|
<div class="wy-grid-for-nav">
|
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
<div class="wy-side-scroll">
|
|
<div class="wy-side-nav-search" style="background: #802400" >
|
|
|
|
|
|
|
|
<a href="../../index.html" class="icon icon-home">
|
|
QEMU
|
|
<img src="../../_static/qemu_128x128.png" class="logo" alt="Logo"/>
|
|
</a>
|
|
<div class="version">
|
|
8.2.2
|
|
</div>
|
|
<div role="search">
|
|
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
|
|
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
</div>
|
|
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
|
<ul class="current">
|
|
<li class="toctree-l1"><a class="reference internal" href="../../about/index.html">About QEMU</a></li>
|
|
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">System Emulation</a><ul class="current">
|
|
<li class="toctree-l2"><a class="reference internal" href="../introduction.html">Introduction</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../invocation.html">Invocation</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../device-emulation.html">Device Emulation</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../keys.html">Keys in the graphical frontends</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../mux-chardev.html">Keys in the character backend multiplexer</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../monitor.html">QEMU Monitor</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../images.html">Disk Images</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../virtio-net-failover.html">QEMU virtio-net standby (net_failover)</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../linuxboot.html">Direct Linux Boot</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../generic-loader.html">Generic Loader</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../guest-loader.html">Guest Loader</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../barrier.html">QEMU Barrier Client</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../vnc-security.html">VNC security</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../tls.html">TLS setup for network services</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../secrets.html">Providing secret data to QEMU</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../authz.html">Client authorization</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../gdb.html">GDB usage</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../replay.html">Record/replay</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../managed-startup.html">Managed start up options</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../bootindex.html">Managing device boot order with bootindex properties</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../cpu-hotplug.html">Virtual CPU hotplug</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../pr-manager.html">Persistent reservation managers</a></li>
|
|
<li class="toctree-l2 current"><a class="reference internal" href="../targets.html">QEMU System Emulator Targets</a><ul class="current">
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-arm.html">Arm System emulator</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-avr.html">AVR System emulator</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-m68k.html">ColdFire System emulator</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-mips.html">MIPS System emulator</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-ppc.html">PowerPC System emulator</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-openrisc.html">OpenRISC System emulator</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-riscv.html">RISC-V System emulator</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-rx.html">RX System emulator</a></li>
|
|
<li class="toctree-l3 current"><a class="reference internal" href="../target-s390x.html">s390x System emulator</a><ul class="current">
|
|
<li class="toctree-l4 current"><a class="reference internal" href="../target-s390x.html#device-support">Device support</a></li>
|
|
<li class="toctree-l4"><a class="reference internal" href="../target-s390x.html#architectural-features">Architectural features</a></li>
|
|
</ul>
|
|
</li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-sparc.html">Sparc32 System emulator</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-sparc64.html">Sparc64 System emulator</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-i386.html">x86 System emulator</a></li>
|
|
<li class="toctree-l3"><a class="reference internal" href="../target-xtensa.html">Xtensa System emulator</a></li>
|
|
</ul>
|
|
</li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../security.html">Security</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../multi-process.html">Multi-process QEMU</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../confidential-guest-support.html">Confidential Guest Support</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../vm-templating.html">QEMU VM templating</a></li>
|
|
</ul>
|
|
</li>
|
|
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User Mode Emulation</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="../../tools/index.html">Tools</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="../../interop/index.html">System Emulation Management and Interoperability</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="../../specs/index.html">System Emulation Guest Hardware Specifications</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="../../devel/index.html">Developer Information</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" style="background: #802400" >
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
<a href="../../index.html">QEMU</a>
|
|
</nav>
|
|
|
|
<div class="wy-nav-content">
|
|
<div class="rst-content">
|
|
<div role="navigation" aria-label="Page navigation">
|
|
<ul class="wy-breadcrumbs">
|
|
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
|
<li class="breadcrumb-item"><a href="../index.html">System Emulation</a></li>
|
|
<li class="breadcrumb-item"><a href="../targets.html">QEMU System Emulator Targets</a></li>
|
|
<li class="breadcrumb-item"><a href="../target-s390x.html">s390x System emulator</a></li>
|
|
<li class="breadcrumb-item active">Subchannel passthrough via vfio-ccw</li>
|
|
<li class="wy-breadcrumbs-aside">
|
|
<a href="https://gitlab.com/qemu-project/qemu/blob/master/docs/system/s390x/vfio-ccw.rst" class="fa fa-gitlab"> Edit on GitLab</a>
|
|
</li>
|
|
</ul>
|
|
<hr/>
|
|
</div>
|
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
<div itemprop="articleBody">
|
|
|
|
<section id="subchannel-passthrough-via-vfio-ccw">
|
|
<h1>Subchannel passthrough via vfio-ccw<a class="headerlink" href="#subchannel-passthrough-via-vfio-ccw" title="Link to this heading"></a></h1>
|
|
<p>vfio-ccw (based upon the mediated vfio device infrastructure) allows to
|
|
make certain I/O subchannels and their devices available to a guest. The
|
|
host will not interact with those subchannels/devices any more.</p>
|
|
<p>Note that while vfio-ccw should work with most non-QDIO devices, only ECKD
|
|
DASDs have really been tested.</p>
|
|
<section id="example-configuration">
|
|
<h2>Example configuration<a class="headerlink" href="#example-configuration" title="Link to this heading"></a></h2>
|
|
<section id="step-1-configure-the-host-device">
|
|
<h3>Step 1: configure the host device<a class="headerlink" href="#step-1-configure-the-host-device" title="Link to this heading"></a></h3>
|
|
<p>As every mdev is identified by a uuid, the first step is to obtain one:</p>
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">root</span><span class="nd">@host</span> <span class="o">~</span><span class="p">]</span><span class="c1"># uuidgen</span>
|
|
<span class="mf">7e270</span><span class="n">a25</span><span class="o">-</span><span class="n">e163</span><span class="o">-</span><span class="mi">4922</span><span class="o">-</span><span class="n">af60</span><span class="o">-</span><span class="mi">757</span><span class="n">fc8ed48c6</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>Note: it is recommended to use the <code class="docutils literal notranslate"><span class="pre">mdevctl</span></code> tool for actually configuring
|
|
the host device.</p>
|
|
<p>To define the same device as configured below to be started
|
|
automatically, use</p>
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">root</span><span class="nd">@host</span> <span class="o">~</span><span class="p">]</span><span class="c1"># driverctl -b css set-override 0.0.0313 vfio_ccw</span>
|
|
<span class="p">[</span><span class="n">root</span><span class="nd">@host</span> <span class="o">~</span><span class="p">]</span><span class="c1"># mdevctl define -u 7e270a25-e163-4922-af60-757fc8ed48c6 \</span>
|
|
<span class="o">-</span><span class="n">p</span> <span class="mf">0.0.0313</span> <span class="o">-</span><span class="n">t</span> <span class="n">vfio_ccw</span><span class="o">-</span><span class="n">io</span> <span class="o">-</span><span class="n">a</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>If using <code class="docutils literal notranslate"><span class="pre">mdevctl</span></code> is not possible or wanted, follow the manual procedure
|
|
below.</p>
|
|
<ul>
|
|
<li><p>Locate the subchannel for the device (in this example, <code class="docutils literal notranslate"><span class="pre">0.0.2b09</span></code>):</p>
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">root</span><span class="nd">@host</span> <span class="o">~</span><span class="p">]</span><span class="c1"># lscss | grep 0.0.2b09 | awk '{print $2}'</span>
|
|
<span class="mf">0.0.0313</span>
|
|
</pre></div>
|
|
</div>
|
|
</li>
|
|
<li><p>Unbind the subchannel (in this example, <code class="docutils literal notranslate"><span class="pre">0.0.0313</span></code>) from the standard
|
|
I/O subchannel driver and bind it to the vfio-ccw driver:</p>
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">root</span><span class="nd">@host</span> <span class="o">~</span><span class="p">]</span><span class="c1"># echo 0.0.0313 > /sys/bus/css/devices/0.0.0313/driver/unbind</span>
|
|
<span class="p">[</span><span class="n">root</span><span class="nd">@host</span> <span class="o">~</span><span class="p">]</span><span class="c1"># echo 0.0.0313 > /sys/bus/css/drivers/vfio_ccw/bind</span>
|
|
</pre></div>
|
|
</div>
|
|
</li>
|
|
<li><p>Create the mediated device (identified by the uuid):</p>
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">root</span><span class="nd">@host</span> <span class="o">~</span><span class="p">]</span><span class="c1"># echo "7e270a25-e163-4922-af60-757fc8ed48c6" > \</span>
|
|
<span class="o">/</span><span class="n">sys</span><span class="o">/</span><span class="n">bus</span><span class="o">/</span><span class="n">css</span><span class="o">/</span><span class="n">devices</span><span class="o">/</span><span class="mf">0.0.0313</span><span class="o">/</span><span class="n">mdev_supported_types</span><span class="o">/</span><span class="n">vfio_ccw</span><span class="o">-</span><span class="n">io</span><span class="o">/</span><span class="n">create</span>
|
|
</pre></div>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section id="step-2-configure-qemu">
|
|
<h3>Step 2: configure QEMU<a class="headerlink" href="#step-2-configure-qemu" title="Link to this heading"></a></h3>
|
|
<ul>
|
|
<li><p>Reference the created mediated device and (optionally) pick a device id to
|
|
be presented in the guest (here, <code class="docutils literal notranslate"><span class="pre">fe.0.1234</span></code>, which will end up visible
|
|
in the guest as <code class="docutils literal notranslate"><span class="pre">0.0.1234</span></code>:</p>
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span><span class="n">device</span> <span class="n">vfio</span><span class="o">-</span><span class="n">ccw</span><span class="p">,</span><span class="n">devno</span><span class="o">=</span><span class="n">fe</span><span class="mf">.0.1234</span><span class="p">,</span><span class="n">sysfsdev</span><span class="o">=</span>\
|
|
<span class="o">/</span><span class="n">sys</span><span class="o">/</span><span class="n">bus</span><span class="o">/</span><span class="n">mdev</span><span class="o">/</span><span class="n">devices</span><span class="o">/</span><span class="mf">7e270</span><span class="n">a25</span><span class="o">-</span><span class="n">e163</span><span class="o">-</span><span class="mi">4922</span><span class="o">-</span><span class="n">af60</span><span class="o">-</span><span class="mi">757</span><span class="n">fc8ed48c6</span>
|
|
</pre></div>
|
|
</div>
|
|
</li>
|
|
<li><p>Start the guest. The device (here, <code class="docutils literal notranslate"><span class="pre">0.0.1234</span></code>) should now be usable:</p>
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">root</span><span class="nd">@guest</span> <span class="o">~</span><span class="p">]</span><span class="c1"># lscss -d 0.0.1234</span>
|
|
<span class="n">Device</span> <span class="n">Subchan</span><span class="o">.</span> <span class="n">DevType</span> <span class="n">CU</span> <span class="n">Type</span> <span class="n">Use</span> <span class="n">PIM</span> <span class="n">PAM</span> <span class="n">POM</span> <span class="n">CHPID</span>
|
|
<span class="o">----------------------------------------------------------------------</span>
|
|
<span class="mf">0.0.1234</span> <span class="mf">0.0.0007</span> <span class="mi">3390</span><span class="o">/</span><span class="mi">0</span><span class="n">e</span> <span class="mi">3990</span><span class="o">/</span><span class="n">e9</span> <span class="n">f0</span> <span class="n">f0</span> <span class="n">ff</span> <span class="mi">1</span><span class="n">a2a3a0a</span> <span class="mi">00000000</span>
|
|
<span class="p">[</span><span class="n">root</span><span class="nd">@guest</span> <span class="o">~</span><span class="p">]</span><span class="c1"># chccwdev -e 0.0.1234</span>
|
|
<span class="n">Setting</span> <span class="n">device</span> <span class="mf">0.0.1234</span> <span class="n">online</span>
|
|
<span class="n">Done</span>
|
|
<span class="p">[</span><span class="n">root</span><span class="nd">@guest</span> <span class="o">~</span><span class="p">]</span><span class="c1"># dmesg -t</span>
|
|
<span class="p">(</span><span class="o">...</span><span class="p">)</span>
|
|
<span class="n">dasd</span><span class="o">-</span><span class="n">eckd</span> <span class="mf">0.0.1234</span><span class="p">:</span> <span class="n">A</span> <span class="n">channel</span> <span class="n">path</span> <span class="n">to</span> <span class="n">the</span> <span class="n">device</span> <span class="n">has</span> <span class="n">become</span> <span class="n">operational</span>
|
|
<span class="n">dasd</span><span class="o">-</span><span class="n">eckd</span> <span class="mf">0.0.1234</span><span class="p">:</span> <span class="n">New</span> <span class="n">DASD</span> <span class="mi">3390</span><span class="o">/</span><span class="mi">0</span><span class="n">E</span> <span class="p">(</span><span class="n">CU</span> <span class="mi">3990</span><span class="o">/</span><span class="mi">01</span><span class="p">)</span> <span class="k">with</span> <span class="mi">10017</span> <span class="n">cylinders</span><span class="p">,</span> <span class="mi">15</span> <span class="n">heads</span><span class="p">,</span> <span class="mi">224</span> <span class="n">sectors</span>
|
|
<span class="n">dasd</span><span class="o">-</span><span class="n">eckd</span> <span class="mf">0.0.1234</span><span class="p">:</span> <span class="n">DASD</span> <span class="k">with</span> <span class="mi">4</span> <span class="n">KB</span><span class="o">/</span><span class="n">block</span><span class="p">,</span> <span class="mi">7212240</span> <span class="n">KB</span> <span class="n">total</span> <span class="n">size</span><span class="p">,</span> <span class="mi">48</span> <span class="n">KB</span><span class="o">/</span><span class="n">track</span><span class="p">,</span> <span class="n">compatible</span> <span class="n">disk</span> <span class="n">layout</span>
|
|
<span class="n">dasda</span><span class="p">:</span><span class="n">VOL1</span><span class="o">/</span> <span class="mh">0X2B09</span><span class="p">:</span> <span class="n">dasda1</span>
|
|
</pre></div>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
</section>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
|
<a href="3270.html" class="btn btn-neutral float-left" title="3270 devices" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
<a href="pcidevices.html" class="btn btn-neutral float-right" title="PCI devices on s390x" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
</div>
|
|
|
|
<hr/>
|
|
|
|
<div role="contentinfo">
|
|
<p>© Copyright 2025, The QEMU Project Developers.</p>
|
|
</div>
|
|
|
|
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
|
|
|
<!-- Empty para to force a blank line after "Built with Sphinx ..." -->
|
|
<p></p>
|
|
|
|
<p>This documentation is for QEMU version 8.2.2.</p>
|
|
|
|
|
|
<p><a href="../../about/license.html">QEMU and this manual are released under the
|
|
GNU General Public License, version 2.</a></p>
|
|
|
|
|
|
|
|
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<script>
|
|
jQuery(function () {
|
|
SphinxRtdTheme.Navigation.enable(true);
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html> |