From: Shivaprasad G Bhat <sbhat@linux.ibm.com>
To: mpe@ellerman.id.au, tpearson@raptorengineering.com,
alex.williamson@redhat.com, linuxppc-dev@lists.ozlabs.org,
aik@amd.com
Cc: svaidy@linux.ibm.com, robh@kernel.org, jroedel@suse.de,
sbhat@linux.ibm.com, gbatra@linux.vnet.ibm.com, jgg@ziepe.ca,
aik@ozlabs.ru, sanastasio@raptorengineering.com,
linux-kernel@vger.kernel.org, christophe.leroy@csgroup.eu,
mahesh@linux.ibm.com, aneesh.kumar@kernel.org,
brking@linux.vnet.ibm.com, oohall@gmail.com, npiggin@gmail.com,
kvm@vger.kernel.org, ruscur@russell.cc,
naveen.n.rao@linux.ibm.com, vaibhav@linux.ibm.com,
msuchanek@suse.de, joel@jms.id.au
Subject: [PATCH v4 0/6] powerpc: pSeries: vfio: iommu: Re-enable support for SPAPR TCE VFIO
Date: Mon, 24 Jun 2024 12:38:07 +0000 [thread overview]
Message-ID: <171923268781.1397.8871195514893204050.stgit@linux.ibm.com> (raw)
The patches reimplement the iommu table_group_ops for pSeries
for VFIO SPAPR TCE sub-driver thereby bringing consistency with
PowerNV implementation and getting rid of limitations/bugs which
were emanating from these differences on the earlier approach on
pSeries.
Structure of the patchset:
-------------------------
The first and fifth patches just code movements.
Second patch takes care of collecting the TCE and DDW information
for the vfio_iommu_spapr_tce_ddw_info during probe.
Third patch fixes the convention of using table[1] for VFs on
pSeries when used by the host driver.
Fourth patch fixes the VFIO to call TCE clear before unset window.
The last patch has the API reimplementations, please find the
details on its commit description.
Testing:
-------
Tested with nested guest for NVME card, Mellanox multi-function
card by attaching them to nested kvm guest running on a pSeries
lpar.
Also vfio-test [2] by Alex Willamson, was forked and updated to
add support for pSeries guest and used to test these patches[3].
Limitations/Known Issues:
------------------------
* The DMA window restrictions with SRIOV VF scenarios of having
maximum 1 dma window is taken care in the current patches itself.
However, the necessary changes required in
vfio_iommu_spapr_tce_ddw_info to expose the default window being
a 64-bit one and the qemu changes handle the same will be taken
care in future versions.
References:
----------
[1] https://lore.kernel.org/linuxppc-dev/171026724548.8367.8321359354119254395.stgit@linux.ibm.com/
[2] https://github.com/awilliam/tests
[3] https://github.com/nnmwebmin/vfio-ppc-tests/tree/vfio-ppc-ex
---
Changelog:
v3: https://lore.kernel.org/linuxppc-dev/171810893836.1721.2640631616827396553.stgit@linux.ibm.com/
- Rebased to top of the tree.
- In the first patch, spapr_tce_table_group_ops is only used locally in
the pseries/iommu.c file. So, made it static.
- Fixed the test robot reported issues 202406121640.yr6LK5HJ-lkp@intel.com
and 202406142110.r97Ts8Xm-lkp@intel.com
- Updated the commit messages
v2: https://lore.kernel.org/linuxppc-dev/171450753489.10851.3056035705169121613.stgit@linux.ibm.com/
- Rebased to upstream. So, required the explicit vmalloc.h inclusion as its
removed from the system header io.h now.
- Fixed the DLPAR hotplugged device assignment case. The dma window
property is backed up before removal. That copy is restored when required.
- Cleaned up bit more. Removed leftover debug prints and dump_stack()s.
- The warning at remap_pfn_range_notrack() during kvm guest boot is no longer
seen after the rebase.
v1: https://lore.kernel.org/linuxppc-dev/171026724548.8367.8321359354119254395.stgit@linux.ibm.com/
- Rewrite as to stop borrowing the DMA windows and implemented
the table_group_ops for pSeries.
- Cover letter and Patch 6 has more details as this was a rewrite.
Shivaprasad G Bhat (6):
powerpc/iommu: Move pSeries specific functions to pseries/iommu.c
powerpc/pseries/iommu: Fix the VFIO_IOMMU_SPAPR_TCE_GET_INFO ioctl output
powerpc/pseries/iommu: Use the iommu table[0] for IOV VF's DDW
vfio/spapr: Always clear TCEs before unsetting the window
powerpc/iommu: Move dev_has_iommu_table() to iommu.c
powerpc/iommu: Reimplement the iommu_table_group_ops for pSeries
arch/powerpc/include/asm/iommu.h | 14 +-
arch/powerpc/kernel/eeh.c | 16 -
arch/powerpc/kernel/iommu.c | 170 +-----
arch/powerpc/platforms/powernv/pci-ioda.c | 6 +-
arch/powerpc/platforms/pseries/iommu.c | 704 +++++++++++++++++++++-
drivers/vfio/vfio_iommu_spapr_tce.c | 13 +-
6 files changed, 718 insertions(+), 205 deletions(-)
--
Signature
next reply other threads:[~2024-06-24 12:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-24 12:38 Shivaprasad G Bhat [this message]
2024-06-24 12:38 ` [PATCH v4 1/6] powerpc/iommu: Move pSeries specific functions to pseries/iommu.c Shivaprasad G Bhat
2024-06-24 12:38 ` [PATCH v4 2/6] powerpc/pseries/iommu: Fix the VFIO_IOMMU_SPAPR_TCE_GET_INFO ioctl output Shivaprasad G Bhat
2024-06-24 12:38 ` [PATCH v4 3/6] powerpc/pseries/iommu: Use the iommu table[0] for IOV VF's DDW Shivaprasad G Bhat
2024-06-24 12:38 ` [PATCH v4 4/6] vfio/spapr: Always clear TCEs before unsetting the window Shivaprasad G Bhat
2024-06-24 12:39 ` [PATCH v4 5/6] powerpc/iommu: Move dev_has_iommu_table() to iommu.c Shivaprasad G Bhat
2024-06-24 12:39 ` [PATCH v4 6/6] powerpc/iommu: Reimplement the iommu_table_group_ops for pSeries Shivaprasad G Bhat
2024-07-06 23:10 ` [PATCH v4 0/6] powerpc: pSeries: vfio: iommu: Re-enable support for SPAPR TCE VFIO Michael Ellerman
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=171923268781.1397.8871195514893204050.stgit@linux.ibm.com \
--to=sbhat@linux.ibm.com \
--cc=aik@amd.com \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=aneesh.kumar@kernel.org \
--cc=brking@linux.vnet.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=gbatra@linux.vnet.ibm.com \
--cc=jgg@ziepe.ca \
--cc=joel@jms.id.au \
--cc=jroedel@suse.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=naveen.n.rao@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=oohall@gmail.com \
--cc=robh@kernel.org \
--cc=ruscur@russell.cc \
--cc=sanastasio@raptorengineering.com \
--cc=svaidy@linux.ibm.com \
--cc=tpearson@raptorengineering.com \
--cc=vaibhav@linux.ibm.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).