From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=13.77.154.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793908384; b=mZDI2eGpOWtYvlnEMz5l9TvIcz2SUbHaWBNf2yq3W8+spKJqz+uLs8B6yKe3QUJnOuQG IPCJmXYDJu53R+opcNXZE+GaBax7hHEEXJJejmSbr2cfKq04bYD7cLJ8omgvQJg9SrbEp NOx/0zZl/pUGJ2N01rPUAX9s9VLJz2CpjeKnt+hgG9GBaWkRulkQt1OOpROUDUNCqWNOS QL3C6poHYFwrElrDk45EcKv1IMwJuzuUrc9lDxmwrhfpyelDoU4zo5wUMWQxAnpofLKf0 OOp9wa3nXXQpbgVB7nZnrfi2zVRieH/rjYZAyDyL/DPjB9RGcYG1UPsvttvc3dhXFng== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793908384; h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:Message-ID:Date: MIME-Version:User-Agent:Cc:Subject:To:References:From: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding: X-Spam-Status:X-Spam-Checker-Version; bh=U1Jdue00BGFqywykSunZ46/p5KrmDrwoufmlu4fOFFU=; b=r2TF+7PJAUddnig5hNMmMmhxl7YCcBXJXY5eta8w9p1Ngfyl8nyNzffFdWU79PDrkfhj 2WwjNVbMq1TGJWajiDBpRwYnO7wChGVqFtCkMMJlNIanLQs/vz0L0XiPfmH27Eujjt6wL rrm9XtdjZ54PwzScWHXZFOi5/5WpibLeeVBdJ2A7jQ9VqHR3x1yw2t+rM75eq3FkoR4NQ xyoX1mUx2zGFvc0svkG1/PIt72m0InyNtdTRw3DVBB5VvfBHK4M0qqGp9BB7436UeGRR4 U/OroqyPX+UZda81t9wXvsZwfNkAPMCHZlF3J8QWR1o/LOnlHm7v+ObNv4kBA2auK7g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b="U/9eZprh"; arc=none smtp.remote-ip=13.77.154.182 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71DCA606A33C for ; Thu, 5 Nov 2026 19:53:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 71DCA606A33C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=U/9eZprh Received: from [192.168.166.159] (unknown [67.168.101.66]) by linux.microsoft.com (Postfix) with ESMTPSA id 925BD20B7166; Thu, 5 Nov 2026 11:52:46 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 925BD20B7166 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1793908367; bh=U1Jdue00BGFqywykSunZ46/p5KrmDrwoufmlu4fOFFU=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=U/9eZprh3TcyRNg4Qz70hF5sZLajLC0+MZyi0iUbPi1OEgI6Ni78c8p9K2x5Qpt70 v2E1kImuwPrbu2NlKO8zFkXcDcDInrH2PDLWiita7wac4SZgag23Z4i5AjhE0nx7uW ZWWRNpvFT1m4IpYqqmKA6TG2Kc+HRbe8Wpjedcck= Message-ID: Date: Thu, 5 Nov 2026 11:53:01 -0800 X-Mailing-List: iommu@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: "Joerg Roedel (AMD)" , Will Deacon , Wei Liu , easwar.hariharan@linux.microsoft.com, Robin Murphy , Haiyang Zhang , Dexuan Cui , Yu Zhang , Jacob Pan , Michael Kelley , Jason Gunthorpe , iommu@lists.linux.dev, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] iommu/hyperv: Don't free a paging domain the hypervisor did not delete To: Yuho Choi References: <20261105192738.70664-2-oss.patchbox@gmail.com> From: Easwar Hariharan Content-Language: en-US In-Reply-To: <20261105192738.70664-2-oss.patchbox@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/5/2026 11:27, Yuho Choi wrote: > hv_iommu_paging_domain_free() frees all page-table pages with > pt_iommu_deinit() and only then asks the hypervisor to delete the > device domain that points at them. If HVCALL_DELETE_DEVICE_DOMAIN > fails, hv_delete_device_domain() only logs the error, returns the > domain ID to the IDA, and the domain is freed anyway. > > The hypervisor then keeps a device domain whose page tables have been > freed and can be reused for anything. The ID is also handed out again > by the next paging domain allocation, while the hypervisor still has a > domain with that ID. > > Delete the domain before freeing its page tables, and keep the ID, the > page tables and the domain if the hypervisor fails to delete it. > > Fixes: 2690d4156b51 ("iommu/hyperv: Add para-virtualized IOMMU support for Hyper-V guest") > Signed-off-by: Yuho Choi > --- > 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 > it on. > > drivers/iommu/hyperv/hv-iommu-guest.c | 17 +++++++++++++---- > 1 file changed, 13 insertions(+), 4 deletions(-) > Good catch! Reviewed-by: Easwar Hariharan