From: Zhenzhong Duan <zhenzhong.duan@intel.com>
To: eric.auger@redhat.com
Cc: qemu-devel@nongnu.org, mst@redhat.com, jean-philippe@linaro.org,
pbonzini@redhat.com, yu.c.zhang@intel.com,
chuanxiao.dong@intel.com, tina.zhang@intel.com
Subject: [PATCH 0/3] Add bypass mode support to assigned device
Date: Mon, 13 Jun 2022 14:10:07 +0800 [thread overview]
Message-ID: <20220613061010.2674054-1-zhenzhong.duan@intel.com> (raw)
Currently virtio-iommu's logic to support bypass mode works only for
emulated device. For assigned device, no GPA -> HPA mapping is setup
in IOMMU page table.
Host report below error:
[3713481.750944] dmar_fault: 191 callbacks suppressed
[3713481.750953] DMAR: DRHD: handling fault status reg 302
[3713481.750962] DMAR: [DMA Read NO_PASID] Request device [2f:00.1] fault addr 0x7ebb0000 [fault reason 0x06] PTE Read access is not set
[3713481.751003] DMAR: DRHD: handling fault status reg 402
[3713481.751007] DMAR: [DMA Read NO_PASID] Request device [2f:00.1] fault addr 0x7ebb0000 [fault reason 0x06] PTE Read access is not set
[3713481.751023] DMAR: DRHD: handling fault status reg 502
[3713481.751026] DMAR: [DMA Write NO_PASID] Request device [2f:00.1] fault addr 0x7ebb0000 [fault reason 0x05] PTE Write access is not set
[3713481.751072] DMAR: DRHD: handling fault status reg 602
Guest kernel report below error:
[ 3.461716] i40e: Intel(R) Ethernet Connection XL710 Network Driver
[ 3.462605] i40e: Copyright (c) 2013 - 2019 Intel Corporation.
[ 3.464630] i40e 0000:00:04.0: Adding to iommu group 5
[ 3.482093] i40e 0000:00:04.0: fw 0.0.00000 api 0.0 nvm 0.00 0x176953ce 28.50.1 [8086:37d3] [8086:35d0]
[ 3.484295] i40e 0000:00:04.0: eeprom check failed (-62), Tx/Rx traffic disabled
[ 3.487268] i40e 0000:00:04.0: configure_lan_hmc failed: -49
[ 3.489066] i40e: probe of 0000:00:04.0 failed with error -2
Fix it by adding switch beween bypass and iommu address space just like
the virtual VT-d implementation, so that in bypass mode, vfio mapping
is setup.
Tested with four combination of qemu's virtio-iommu.boot-bypass=true/false
with guest kernel's iommu=pt/nopt on x86_64 platform.
Zhenzhong Duan (3):
virtio-iommu: Add bypass mode support to assigned device
virtio-iommu: Use recursive lock to avoid deadlock
virtio-iommu: Add an assert check in translate routine
hw/virtio/trace-events | 1 +
hw/virtio/virtio-iommu.c | 135 ++++++++++++++++++++++++++++---
include/hw/virtio/virtio-iommu.h | 4 +-
3 files changed, 130 insertions(+), 10 deletions(-)
--
2.25.1
next reply other threads:[~2022-06-13 6:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 6:10 Zhenzhong Duan [this message]
2022-06-13 6:10 ` [PATCH 1/3] virtio-iommu: Add bypass mode support to assigned device Zhenzhong Duan
2022-06-23 16:52 ` Eric Auger
2022-06-24 8:28 ` Duan, Zhenzhong
2022-06-13 6:10 ` [PATCH 2/3] virtio-iommu: Use recursive lock to avoid deadlock Zhenzhong Duan
2022-06-13 6:10 ` [PATCH 3/3] virtio-iommu: Add an assert check in translate routine Zhenzhong Duan
2022-06-23 16:52 ` [PATCH 0/3] Add bypass mode support to assigned device Eric Auger
2022-06-24 7:36 ` Duan, Zhenzhong
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=20220613061010.2674054-1-zhenzhong.duan@intel.com \
--to=zhenzhong.duan@intel.com \
--cc=chuanxiao.dong@intel.com \
--cc=eric.auger@redhat.com \
--cc=jean-philippe@linaro.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=tina.zhang@intel.com \
--cc=yu.c.zhang@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).