Skip to content

Hyper-V: root VM iommu kernel only driver

Mukesh R linux-arch linux-hyperv linux-iommu lkml sashiko-reviews 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 10 repliesIn review
  2. v35 patches 1 replySuperseded
  3. v24 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches9 repliesSuperseded

Changes in v4 from the cover letter

- Use gfp flag in add tree function instead of GFP_KERNEL.
- Check for HV_STATUS_DEVICE_ALREADY_IN_DOMAIN in attach device.
- Don't call delete tree if unmap hypercall failed.
- Don't print error if map device pages hypercall failed with enomem.
- Minor comments fixups.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5mshv: Add gfp flags to deposit memory logicdrivers/hv/hv_proc.c include/asm-generic/mshyperv.h+22 -122 replies
2/5PCI: hv: Export hv_build_devid_type_pci() and change return typearch/x86/hyperv/irqdomain.c arch/x86/include/asm/mshyperv.h+11 -41 reply
3/5mshv: Import data structs around device domains from hyperv headersinclude/hyperv/hvgdk_mini.h include/hyperv/hvhdk_mini.h+19 -00 replies
4/5iommu/hyperv: Only call pviommu init on non-root VMsarch/x86/hyperv/hv_init.c arch/x86/include/asm/mshyperv.h drivers/iommu/hyperv/hv-iommu-guest.c+4 -31 reply
5/5x86/hyperv: Implement root partition IOMMU kernel only driverarch/x86/kernel/pci-dma.c drivers/iommu/hyperv/Kconfig drivers/iommu/hyperv/Makefile +3 more+638 -06 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchSouradeep ChakrabartiEaswar HariharanJacob Pan
1/5R-b R-b
2/5R-b R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH V4 0/5] Hyper-V: root VM iommu kernel only driver

This short series introduces hyperv root VM iommu kernel only driver. This driver acts as liason between the hypervisor and iommu layer. Details are both in the actual commits and in the comments in the file implementing it.

Thanks,
-Mukesh

V0: based on upstream hyperv-next commit be0cfab740e5

V1:
- change order of lookup tree deletions to appease all AI agents, carving out hv_iommu_hyp_unmap_pages() from hv_iommu_unmap_pages().
- change unique_id to ida subsystem management so we never ever run out of domain ids.
- change hv_max_iova_width to hv_iommu_max_iova and generate proper mask.
- some other minor changes.

V2:
- Add patch (0001) to allow gfp_flags to be passed to deposit pages function.
- In last main patch:
o remove hv_iommu_setup_skip to skip devices being managed
o remove hv_special_domain()
o Add comments around pgsize_bitmap and IOMMU capabilities.
o Add to lookup tree before mapping iova in the map callback
o Unmap iova before removing from the tree in the unmap callback

V3:
- Rebase to rc1 tag 6628e7d4c6b2 which contains both pviommu and the deposit memory redesign patches.
- Add a tiny patch to rename hv_iommu_init() to hv_pviommu_init(), and only call it for non-root.

V4:
- Use gfp flag in add tree function instead of GFP_KERNEL.
- Check for HV_STATUS_DEVICE_ALREADY_IN_DOMAIN in attach device.
- Don't call delete tree if unmap hypercall failed.
- Don't print error if map device pages hypercall failed with enomem.
- Minor comments fixups.

Mukesh R (5):
mshv: Add gfp flags to deposit memory logic
PCI: hv: Export hv_build_devid_type_pci() and change return type
mshv: Import data structs around device domains from hyperv headers iommu/hyperv: Only call pviommu init on non-root VMs x86/hyperv: Implement root partition IOMMU kernel only driver

 arch/x86/hyperv/hv_init.c             |   3 +-
 arch/x86/hyperv/irqdomain.c           |   9 +-
 arch/x86/include/asm/mshyperv.h       |   8 +-
 arch/x86/kernel/pci-dma.c             |   2 +
 drivers/hv/hv_proc.c                  |  20 +-
 drivers/iommu/hyperv/Kconfig          |  13 +
 drivers/iommu/hyperv/Makefile         |   1 +
 drivers/iommu/hyperv/hv-iommu-guest.c |   2 +-
 drivers/iommu/hyperv/hv-iommu-root.c  | 613 ++++++++++++++++++++++++++
 include/asm-generic/mshyperv.h        |  17 +-
 include/hyperv/hvgdk_mini.h           |   4 +
 include/hyperv/hvhdk_mini.h           |  15 +
 include/linux/hyperv.h                |   6 +
 13 files changed, 694 insertions(+), 19 deletions(-)
 create mode 100644 drivers/iommu/hyperv/hv-iommu-root.c
Signature · 1 line
2.51.2.vfs.0.1