Please pull IOMMUFD subsystem changes
Subsystems (3)
Hi Linus,
This PR has a few smaller updates related to iommufd. Several big topics are currently still on the mailing list in review:
- VFIO device cdev support to allow exposing all the iommufd features:
https://lore.kernel.org/kvm/[email protected]/
- iommufd page table replace operation:
https://lore.kernel.org/kvm/[email protected]/
- IOMMU driver information query:
https://lore.kernel.org/r/[email protected]
- Intel VT-d nested translation:
https://lore.kernel.org/r/[email protected]
- Draft patches for ARM SMMUv3 nested translation:
https://github.com/nicolinc/iommufd/commits/wip/iommufd-v6.2-rc5-nesting
Along with qemu patches implementing iommufd:
https://lore.kernel.org/qemu-devel/[email protected]/
And draft patches for the qemu side support for nested translation.
This PR has a shared branch with Joerg's tree changing the signature of iommu_map() to add a gfp_t. There were some conflicts with v6.2 which I've resolved in this PR and there will be a conflict against the rpmsg tree:
https://lore.kernel.org/r/[email protected]
drivers/remoteproc/qcom_q6v5_adsp.c +2 -1
@@ -367,7 +367,8 @@ static int adsp_map_carveout(struct rproc *rproc) iova = adsp->mem_phys | (sid <<32 ); ret =iommu_map (rproc->domain, iova, adsp->mem_phys, - adsp->mem_size,IOMMU_READ |IOMMU_WRITE ); + adsp->mem_size,IOMMU_READ |IOMMU_WRITE , +GFP_KERNEL );if (ret) {dev_err (adsp->dev,"Unable to map ADSP Physical Memory\n" );return ret;
Thanks,
Jason
The following changes since commit c9c3395d5e3dcc6daee66c6908354d47bf98cb0c:
Linux 6.2 (2023-02-19 14:24:22 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git tags/for-linus-iommufd
for you to fetch changes up to 939204e4df962982cbc84acc26b29b421dd530a8:
Merge tag 'v6.2' into iommufd.git for-next (2023-02-21 11:11:03 -0400)
----------------------------------------------------------------
iommufd for 6.3
Some polishing and small fixes for iommufd:
- Remove IOMMU_CAP_INTR_REMAP, instead rely on the interrupt subsystem
- Use GFP_KERNEL_ACCOUNT inside the iommu_domains
- Support VFIO_NOIOMMU mode with iommufd
- Various typos
- A list corruption bug if HWPTs are used for attach
----------------------------------------------------------------
Jason Gunthorpe (26):
genirq/msi: Add msi_device_has_isolated_msi()
iommu: Add iommu_group_has_isolated_msi()
vfio/type1: Convert to iommu_group_has_isolated_msi()
iommufd: Convert to msi_device_has_isolated_msi()
genirq/irqdomain: Remove unused irq_domain_check_msi_remap() code
genirq/msi: Rename IRQ_DOMAIN_MSI_REMAP to IRQ_DOMAIN_ISOLATED_MSI
iommu/x86: Replace IOMMU_CAP_INTR_REMAP with IRQ_DOMAIN_FLAG_ISOLATED_MSI
irq/s390: Add arch_is_isolated_msi() for s390
iommu: Remove IOMMU_CAP_INTR_REMAP
Merge branch 'isolated_msi' into iommufd.git for-next
iommu: Add a gfp parameter to iommu_map()
iommu: Remove iommu_map_atomic()
iommu: Add a gfp parameter to iommu_map_sg()
iommu/dma: Use the gfp parameter in __iommu_dma_alloc_noncontiguous()
iommufd: Use GFP_KERNEL_ACCOUNT for iommu_map()
iommu/intel: Add a gfp parameter to alloc_pgtable_page()
iommu/intel: Support the gfp argument to the map_pages op
iommu/intel: Use GFP_KERNEL in sleepable contexts
iommu/s390: Push the gfp parameter to the kmem_cache_alloc()'s
iommu/s390: Use GFP_KERNEL in sleepable contexts
Merge branch 'iommu-memory-accounting' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/joro/iommu intoiommufd/for-next
vfio: Support VFIO_NOIOMMU with iommufd
Merge branch 'vfio-no-iommu' into iommufd.git for-next
iommufd: Make sure to zero vfio_iommu_type1_info before copying to user
iommufd: Do not add the same hwpt to the ioas->hwpt_list twice
Merge tag 'v6.2' into iommufd.git for-next
Nicolin Chen (1):
selftests: iommu: Fix test_cmd_destroy_access() call in user_copy
Yi Liu (1):
iommufd: Add three missing structures in ucmd_buffer
arch/arm/mm/dma-mapping.c | 11 ++- arch/s390/include/asm/msi.h | 17 ++++ arch/s390/include/asm/pci_dma.h | 5 +- arch/s390/pci/pci_dma.c | 31 +++--- .../gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c | 3 +- drivers/gpu/drm/tegra/drm.c | 2 +- drivers/gpu/host1x/cdma.c | 2 +- drivers/infiniband/hw/usnic/usnic_uiom.c | 8 +- drivers/iommu/amd/iommu.c | 5 +- drivers/iommu/dma-iommu.c | 18 +++- drivers/iommu/intel/iommu.c | 38 ++++---- drivers/iommu/intel/iommu.h | 2 +- drivers/iommu/intel/irq_remapping.c | 3 +- drivers/iommu/intel/pasid.c | 2 +- drivers/iommu/iommu.c | 77 ++++++++------- drivers/iommu/iommufd/Kconfig | 2 +- drivers/iommu/iommufd/device.c | 8 +- drivers/iommu/iommufd/iommufd_private.h | 2 + drivers/iommu/iommufd/main.c | 3 + drivers/iommu/iommufd/pages.c | 6 +- drivers/iommu/iommufd/vfio_compat.c | 107 +++++++++++++++++---- drivers/iommu/s390-iommu.c | 17 ++-- drivers/irqchip/irq-gic-v3-its.c | 4 +- drivers/media/platform/qcom/venus/firmware.c | 2 +- drivers/net/ipa/ipa_mem.c | 6 +- drivers/net/wireless/ath/ath10k/snoc.c | 2 +- drivers/net/wireless/ath/ath11k/ahb.c | 4 +- drivers/remoteproc/remoteproc_core.c | 5 +- drivers/vfio/Kconfig | 2 +- drivers/vfio/container.c | 7 -- drivers/vfio/group.c | 7 +- drivers/vfio/iommufd.c | 19 +++- drivers/vfio/vfio.h | 8 +- drivers/vfio/vfio_iommu_type1.c | 25 ++--- drivers/vfio/vfio_main.c | 7 ++ drivers/vhost/vdpa.c | 2 +- include/linux/iommu.h | 33 ++----- include/linux/iommufd.h | 12 ++- include/linux/irqdomain.h | 29 +----- include/linux/msi.h | 17 ++++ kernel/irq/irqdomain.c | 39 -------- kernel/irq/msi.c | 27 ++++++ tools/testing/selftests/iommu/iommufd.c | 2 +- 43 files changed, 369 insertions(+), 259 deletions(-) create mode 100644 arch/s390/include/asm/msi.h
Quoted 4 lines · Jason Gunthorpe
iommufd for 6.3
Some polishing and small fixes for iommufd:
Hmm. About half the patches seem to not be about iommufd, but about 'isolated_msi', which isn't even mentioned in the pull request at all (well, it's there in the shortlog, but not in the actual "this is what happened")
I already merged it, and am not sure what I would add to the commit message, but I really would have liked to see that mentioned, considering that it wasn't some small part of it all.
Linus
Quoted 10 lines · Linus Torvalds
Quoted 4 lines · Jason Gunthorpe
iommufd for 6.3
Some polishing and small fixes for iommufd:
Hmm. About half the patches seem to not be about iommufd, but about '
isolated_msi', which isn't even mentioned in the pull request at all (well, it's there in the shortlog, but not in the actual "this is what happened")
Ah, it is perhaps somewhat cryptically mentioned in the tag:
"Remove IOMMU_CAP_INTR_REMAP, instead rely on the interrupt subsystem"
In retrospect I can see that is pretty obtuse, but from my POV that was the goal of that series :)
Quoted 3 lines
I already merged it, and am not sure what I would add to the commit message, but I really would have liked to see that mentioned, considering that it wasn't some small part of it all.
I think the missing paragraph is something like:
This PR includes some rework of MSI isolation/security capability detection that touches irq, iommu, vfio and iommufd. It consolidates two partially overlapping approaches into a single one.
Do you like this sort of explanation in the email or the tag?
Honestly, after 5 years (wow time flies) of sending PRs for rdma I'm still a bit unclear on the best way to write the tag message.
I suppose you noticed, but I've followed John Corbet's suggestion to capture the cover letters in internal merge commits. Eg isolated-msi has a lot of words in commit fc3873095a
Thanks,
Jason
Quoted 2 lines · Jason Gunthorpe
Do you like this sort of explanation in the email or the tag?
Either works, I really don't have a strong preference. Some people do one, others do the other. And some people (like Rafael) do both - with the summary list in the tag (and thus also as part of the pull request), but an overview at the top of the email.
Quoted 2 lines
Honestly, after 5 years (wow time flies) of sending PRs for rdma I'm still a bit unclear on the best way to write the tag message.
Heh. Probably because there isn't any "one correct" way. Whatever works best for you.
The thing I personally care about is just that there _is_ an explanation, and that it makes sense in the context of a human reader who looks at the merge later.
So no automatically generated stuff that you could just get with some git command anyway, but an actual overview.
And I'll edit things to make sense in a commit message anyway, so I'll remove language like "This pull request contains.." because that doesn't make sense once it's just a merge commit and no longer is a pull request.
So I'll generally edit that kind of laniage down to "This contains.." instead or something like that.
I also try to *generally* make the merge commit messages look roughly the same, so that when people use wildly different whitespace (tabs vs spaces) or use different bullet points - "-" vs "o" vs "*" etc) I generally try to make those kinds of things also be at least *somewhat* consistent.
And for that, it can certainly make my life easier if you look at what merge messages look like, and don't try to make your pull request message wildly different. But it's really not a big deal - I do that kind of reformatting as part of simply reading the message, so it's all fine.
Finally - remember that the merge message is for humans reading it later, and not everybody necessarily knows the TLA's that may be obvious to you as a maintainer of that subsystem. So try to make it somewhat legible to a general (kernel developer) public.
And then if I feel like the message doesn't cover all of the changes, I'll prod you, like I did in this case.
Linus
The pull request you sent on Tue, 21 Feb 2023 11:39:51 -0400:
The pull request you sent on Tue, 21 Feb 2023 11:39:51 -0400:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.gittags/for-linus-iommufd
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/143c7bc6496c886ce5db2a2f9cec580494690170
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html