Skip to content

iommu/hyperv: Don't free a paging domain the hypervisor did not delete

Yuho Choi linux-hyperv linux-iommu lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 7 repliesApplied
  3. v11 patch 4 repliesSuperseded

Changes in v3 from the cover letter

- Patch 1: Added Yu's Reviewed-by. No other change.
- Patch 2: Reworded the commit message and the comment to say that the current Hyper-V implementation does not adopt the page table root when HVCALL_CONFIGURE_DEVICE_DOMAIN fails, and that the change is defensive (Yu). Dropped the Fixes tag for the same reason. Added the Reviewed-by tags from Jason and Easwar. No code change other than the comment.
- Rebased on current mainline (8dac6df92a2e).

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2iommu/hyperv: Don't free a paging domain the hypervisor did not deletedrivers/iommu/hyperv/hv-iommu-guest.c+14 -50 replies
2/2iommu/hyperv: Keep a new domain's page tables if it cannot be deleteddrivers/iommu/hyperv/hv-iommu-guest.c+14 -11 reply

Reviews trailers per patch

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

PatchEaswar HariharanJason GunthorpeYu Zhang
1/2R-b R-b R-b
2/2R-b R-b R-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 v3 thread

Cover letter [PATCH v3 0/2] iommu/hyperv: Don't free a paging domain the hypervisor did not delete

The Hyper-V IOMMU driver frees a paging domain's page tables even when HVCALL_DELETE_DEVICE_DOMAIN fails and the hypervisor still has the domain. Patch 1 fixes this when a domain is freed. Patch 2 handles the same failure when the allocation of a new domain fails after the domain has been created. As Yu pointed out, the current Hyper-V implementation does not adopt the page table root in that case, so patch 2 is defensive.

Changes since v2:
- Patch 1: Added Yu's Reviewed-by. No other change.
- Patch 2: Reworded the commit message and the comment to say that the current Hyper-V implementation does not adopt the page table root when HVCALL_CONFIGURE_DEVICE_DOMAIN fails, and that the change is defensive (Yu). Dropped the Fixes tag for the same reason. Added the Reviewed-by tags from Jason and Easwar. No code change other than the comment.
- Rebased on current mainline (8dac6df92a2e).

Both are compile-tested only (x86_64 with HYPERV and HYPERV_PVIOMMU, W=1). I have no Hyper-V guest with the para-virtualized IOMMU to test them on.

v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/

Yuho Choi (2):
iommu/hyperv: Don't free a paging domain the hypervisor did not delete iommu/hyperv: Keep a new domain's page tables if it cannot be deleted

 drivers/iommu/hyperv/hv-iommu-guest.c | 34 ++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 6 deletions(-)

base-commit: 8dac6df92a2e66e2098bbc69061964cfe7e8375b

Signature · 1 line
2.56.1