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, and patch 2 when the allocation of a new domain fails after the domain has been created.
Changes since v1: - Patch 1: WARN when HVCALL_DELETE_DEVICE_DOMAIN fails (Jason). Kept the Reviewed-by tags from Easwar and Jason. Rebased on current mainline (067c5c24cef2). - Patch 2: new. Handle the same failure in the error path of hv_iommu_domain_alloc_paging() (Jacob). 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. 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 | 29 +++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) base-commit: 067c5c24cef23d913b67eaaf71ae67e7169a6620 -- 2.43.0
