From patchwork Mon Apr 8 13:02:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teddy Astie X-Patchwork-Id: 13621134 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9B96CD1296 for ; Mon, 8 Apr 2024 13:02:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.701953.1096626 (Exim 4.92) (envelope-from ) id 1rtodi-0001wj-3K; Mon, 08 Apr 2024 13:02:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 701953.1096626; Mon, 08 Apr 2024 13:02:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rtodi-0001wa-0M; Mon, 08 Apr 2024 13:02:22 +0000 Received: by outflank-mailman (input) for mailman id 701953; Mon, 08 Apr 2024 13:02:21 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rtodh-0001Ba-8n for xen-devel@lists.xenproject.org; Mon, 08 Apr 2024 13:02:21 +0000 Received: from mail177-6.suw61.mandrillapp.com (mail177-6.suw61.mandrillapp.com [198.2.177.6]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3bf99a28-f5a8-11ee-afe6-a90da7624cb6; Mon, 08 Apr 2024 15:02:20 +0200 (CEST) Received: from pmta14.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail177-6.suw61.mandrillapp.com (Mailchimp) with ESMTP id 4VCq4X2hWGz2K1ttS for ; Mon, 8 Apr 2024 13:02:20 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id a3802b0a34d545169485f79ab33fff0c; Mon, 08 Apr 2024 13:02:20 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3bf99a28-f5a8-11ee-afe6-a90da7624cb6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1712581340; x=1712841840; bh=nCr/dQ7MOvz4AtUAz90cOrY6iTnWRg80lBBHOoVQiPc=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=hSZXAVC6IirS3MMUs7cOjAbhOVYpnI7RrQu17ul5SuEcYktNz8yxGCBmKNFNeRNXv 98kC/Cs7fN0Y4NRcG0kOtlsp7yVjVl3UGMaEsuVv+1YMpj0pbKuiCdqrbJnmqIbo0v uFgAjiDoyZBlR3/b68B8TsgCDLBqVG5iAJGlUdzMgAjK9YShDUJgx4gpHk5DmQ6zKe 8KTi+udlN0eihp3vrd448BB3NTT7jol1OTPBs3DTyPKs4+8HuLiO/VSw5M4OmWSb5N D0vrvi5dpHb9bL9OmhSYMEVd05lhG7m//60c3qKXrISrbX8k5xIECuRi/jMfr2NAi2 +3fRgVH/wl4AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1712581340; x=1712841840; i=teddy.astie@vates.tech; bh=nCr/dQ7MOvz4AtUAz90cOrY6iTnWRg80lBBHOoVQiPc=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=m7xAmt2QSFYru2Wp0XMobiPlRPmmJSPCVlm4j6phcKLPmWYgNdslduMxuF+BaDinS mR+/31IQ97caHtcGB6PjFUfpCU1lZNN3qTBCQSc2Q3fI/RhCD4YFPyCHxqmlWHTlyM Uz2epdGoR0csT7l1xjbqL+VQ1LN22PytPVyrV6APVxD+rw6PR5pWA8Ruhp6RDFPpLI SA7JvYU4G9tTEkLYOBsmbE2kh8FFR+NyJG1CtVt99r4vBZHc44su/2sS+y6DIbILLv 6O0xSBp/yYZ8GcWQgaOtREMIVTgxyNWCHf7jUjBHtd2ZOBGz4FWAgQqXstFCOuW3DH 9kFsCrQnAoPGA== From: Teddy Astie Subject: =?utf-8?q?=5BXEN_PATCH_v2_3/3=5D_VT-d=3A_Cleanup_MAP=5FSINGLE=5FDEV?= =?utf-8?q?ICE_and_related_code?= X-Mailer: git-send-email 2.44.0 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1712581337631 To: xen-devel@lists.xenproject.org Cc: Teddy Astie , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Message-Id: In-Reply-To: References: X-Native-Encoded: 1 X-Report-Abuse: =?utf-8?q?Please_forward_a_copy_of_this_message=2C_including?= =?utf-8?q?_all_headers=2C_to_abuse=40mandrill=2Ecom=2E_You_can_also_report_?= =?utf-8?q?abuse_here=3A_https=3A//mandrillapp=2Ecom/contact/abuse=3Fid=3D30?= =?utf-8?q?504962=2Ea3802b0a34d545169485f79ab33fff0c?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20240408:md Date: Mon, 08 Apr 2024 13:02:20 +0000 MIME-Version: 1.0 This flag was only used in case cx16 is not available, as those code paths no longer exist, this flag now does basically nothing. Suggested-by: Andrew Cooper Signed-off-by: Teddy Astie --- xen/drivers/passthrough/vtd/iommu.c | 12 +++--------- xen/drivers/passthrough/vtd/vtd.h | 5 ++--- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 47b56f37a9..4b15e6da79 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1692,15 +1692,9 @@ static int domain_context_mapping(struct domain *domain, u8 devfn, break; } - if ( domain != pdev->domain && pdev->domain != dom_io ) - { - if ( pdev->domain->is_dying ) - mode |= MAP_OWNER_DYING; - else if ( drhd && - !any_pdev_behind_iommu(pdev->domain, pdev, drhd->iommu) && - !pdev->phantom_stride ) - mode |= MAP_SINGLE_DEVICE; - } + if ( domain != pdev->domain && pdev->domain != dom_io && + pdev->domain->is_dying ) + mode |= MAP_OWNER_DYING; switch ( pdev->type ) { diff --git a/xen/drivers/passthrough/vtd/vtd.h b/xen/drivers/passthrough/vtd/vtd.h index cb2df76eed..43f06a353d 100644 --- a/xen/drivers/passthrough/vtd/vtd.h +++ b/xen/drivers/passthrough/vtd/vtd.h @@ -28,9 +28,8 @@ */ #define MAP_WITH_RMRR (1u << 0) #define MAP_OWNER_DYING (1u << 1) -#define MAP_SINGLE_DEVICE (1u << 2) -#define MAP_ERROR_RECOVERY (1u << 3) -#define UNMAP_ME_PHANTOM_FUNC (1u << 4) +#define MAP_ERROR_RECOVERY (1u << 2) +#define UNMAP_ME_PHANTOM_FUNC (1u << 3) /* Allow for both IOAPIC and IOSAPIC. */ #define IO_xAPIC_route_entry IO_APIC_route_entry