From patchwork Fri Apr 12 12:33:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teddy Astie X-Patchwork-Id: 13627695 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 026CAC4345F for ; Fri, 12 Apr 2024 12:34:10 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.704626.1101122 (Exim 4.92) (envelope-from ) id 1rvG6V-0001e7-DI; Fri, 12 Apr 2024 12:34:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 704626.1101122; Fri, 12 Apr 2024 12:34:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rvG6V-0001dv-A9; Fri, 12 Apr 2024 12:34:03 +0000 Received: by outflank-mailman (input) for mailman id 704626; Fri, 12 Apr 2024 12:34:02 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rvG6U-0001cV-45 for xen-devel@lists.xenproject.org; Fri, 12 Apr 2024 12:34:02 +0000 Received: from mail5.us4.mandrillapp.com (mail5.us4.mandrillapp.com [205.201.136.5]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ef6bb7f3-f8c8-11ee-94a3-07e782e9044d; Fri, 12 Apr 2024 14:33:59 +0200 (CEST) Received: from pmta15.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail5.us4.mandrillapp.com (Mailchimp) with ESMTP id 4VGGFy4x2RzDRHxKP for ; Fri, 12 Apr 2024 12:33:58 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 7f450573211144e0aec62194d55493a9; Fri, 12 Apr 2024 12:33:58 +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: ef6bb7f3-f8c8-11ee-94a3-07e782e9044d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1712925238; x=1713185738; bh=jU9EIjA+Qc+4GFuonLz2lNzv0PHDDy6bVljleTMmQTg=; 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=nc8xqp/35GetuhBJQJjPLkLi5tZMDM5mTqP/1CBTduxPpxHIlJjnNlY1rNjvqWciG bBhx1yX6noYaZBoUegxslF3VJAS55GONBjiNIjzY5f0CGRQj8KFBjm2iECXP037DWx Q/1NozbBaxJYbF80rDfF3bxmigkeXMuwZaHvkf5GWulJ+k85X6CycjqKqjM1IDN4OE RxaGvbOGAcs1RxaCl7V9kuMi/61xJS0H/Uz4autL/xE6ydPvIcrzfMC37gZ0ESnYyL n3slKQcSrpqxxkx9YSsblx4G6aSWWRA33AUqBozXV6AIajxtP3QJJayGoDB/558Lke J2chHzpDf9QCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1712925238; x=1713185738; i=teddy.astie@vates.tech; bh=jU9EIjA+Qc+4GFuonLz2lNzv0PHDDy6bVljleTMmQTg=; 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=w9XJtm9zyllT/y7qrGykkrvF7yakOvKued0Su6x2MT/S38R5WB+YX+PMsD7iu+/q/ xNcHSh2KglsUpe09TJPy3F0baHQ0llhaSuq4UjBkz4E0Kx0Bnky89HdQkaNE4+JEnC sctCXNfTrH5vJBxh/OLH4gN4wAvoXI6YkgcA15auPz8y6CH7IE+tKwNmTk3N2wJ0H9 1CU1KiES9YRD44bofE++1Jp8KuYvbSzN9tVr4v5nE+DzygF68dpXOIL5uG6V4RIOma RUVIWQ2b7SRF/UWdsP83YMMaYUqzwZFvRCflqnpoNNmAFn1zM926nhCsOaSGOPy4JU M6LKXNXR5J1EA== From: Teddy Astie Subject: =?utf-8?q?=5BXEN_PATCH_v3_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: 1712925235934 To: xen-devel@lists.xenproject.org Cc: Teddy Astie , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Message-Id: <71875378aca7cbd6a03655c48a741060ff20cf2a.1712915011.git.teddy.astie@vates.tech> 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=2E7f450573211144e0aec62194d55493a9?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20240412:md Date: Fri, 12 Apr 2024 12:33:58 +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 ef9380ed6a..a1bd3c5ff6 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