Message ID | 17-v1-e289ca9121be+2be-smmuv3_newapi_p1_jgg@nvidia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A619BCD98D9 for <linux-arm-kernel@archiver.kernel.org>; Wed, 11 Oct 2023 00:34:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xZ3xmvVhotcpoz+Sh15c+E9XSLhdGiwpSYDfXiZQa4k=; b=HTVpTS5trgpov+ hefYyfbpo50l23HnOv8y22zr3/brNOk9rz1SWk64UWAWjD6wFf03W5s/6lGHulRFI1ygVIGgVR2AO r8APE+BEcgO4D4qn075iT9xu7wdL5LUqvqytu3qay1tI/L43Cz6dadbKAYomDj02krsPLfCF6wwkQ eS4JuEuA79vuI+E/zScsQ8dcTfToFGgPmOABuwmLvtHH7lK5VSGnMIZIX9Gv/ILCSjVQIqy6zMNec odK2DbU7nmbsFWpWLwoTCviaTOaucn7ppoOP5hEPY7/zb2oIfv6j85pOaidgDm78J3ceHq2Lkq7Wo NM5vLddaZufOtVWCDXTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqNAp-00ERJV-32; Wed, 11 Oct 2023 00:34:03 +0000 Received: from mail-dm6nam04on20624.outbound.protection.outlook.com ([2a01:111:f400:7e8b::624] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqNAb-00ER5U-27 for linux-arm-kernel@lists.infradead.org; Wed, 11 Oct 2023 00:33:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TzZICpDKDO+n6rw/T/qXnADFEuUoQZDC2I96mJSDgbA30S0w4ivMBjImnVR++VHMBtKHp8SHJEj2jAFU5+a4PfCNZr9DwTxQIUBuTTxCzS2gr5THewdr8z44aAxIH3/tDjdUdFMYeNE3wqKXJ7YwGTdpjOtcEjvN1lS09Wg8cdIey10p94HB2tpqleyqTpfO/UgBw5hezjjQ+VnjwZbkdKWPKEiQkjq6XPp79sLY2kAGs0DN0o56SGDLPwZ6FN0D/9tvwXYvNlF27t0VLUQ1yS1jC0as1E5zFC/sS1xyOz6C9lvu+eARuFWDQRPrG7og8wXp98I6SPEHmzCJUMj4gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=czc5qz9bl8H0GQ6OSswFtZ82ieR3jreREUCQivMJWR0=; b=fUt48iaOzDvg4LvbXeiWKshYbP73lki+lILnE/X1/aROv4HBM4hNHPB6IcD0RJaz05alicKTWk5Nplv4+qk44bFjkEXUNMoRlUkjDHYMJGwdzM6GGC2K7SX5jkINAL/Q2a1rH1V3K8aEIQrOdeBr/bca/E5U2do6QTk3gPUD/V0dKmxYsQZcorMIhkUJy+G6LbnhP77Qs6QTm3xOA+o6CI3cXVx9m9fDybx2baVkxmLrzDA5cPBmFvOEJrHYUFzrP3md3Xz0gG4vr8vphz9QL0Tid6JbSDn6Rt0vXEVUsY68kCKNtFuG2QeD3mtQlCYLalrP7vDUjE/GystWILy3KQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=czc5qz9bl8H0GQ6OSswFtZ82ieR3jreREUCQivMJWR0=; b=ne1CJO+lJTBji7GI1nqacDExvB3hfuTpsuukW56WzJgvVsQ2bPMP3DhHBB+4UltNfqlJQxTtuhASY5y1uAWRIdtCsYiqeZ/rJe4gAAeFamhSDRgyk5d3+163xH7bTFtCe7itZklxBqkBNWJMewtG+J/rTQLjoLSm0Bhu+KCnV3+0kfSjAu96QsWi64BfO7JRS2tAszxWVhu3XfwcKHOuvnrRmwb2HNQbJ3zDYkBjHIk1PtT3VEsYVvzvQuk7AI5lPvWKxshB7MPqO8MxXRgtnFE/YZ/5RWudmaRCEfRfrv1t8E/9W1M78FSedmdnMR/HHZtTwdTFtxqDoNomoxtGzw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by IA1PR12MB6625.namprd12.prod.outlook.com (2603:10b6:208:3a3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.42; Wed, 11 Oct 2023 00:33:31 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2%6]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 00:33:31 +0000 From: Jason Gunthorpe <jgg@nvidia.com> To: iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>, linux-arm-kernel@lists.infradead.org, Robin Murphy <robin.murphy@arm.com>, Will Deacon <will@kernel.org> Cc: Michael Shavit <mshavit@google.com>, Nicolin Chen <nicolinc@nvidia.com> Subject: [PATCH 17/19] iommu/arm-smmu-v3: Use the identity/blocked domain during release Date: Tue, 10 Oct 2023 21:33:23 -0300 Message-ID: <17-v1-e289ca9121be+2be-smmuv3_newapi_p1_jgg@nvidia.com> In-Reply-To: <0-v1-e289ca9121be+2be-smmuv3_newapi_p1_jgg@nvidia.com> References: X-ClientProxiedBy: MN2PR16CA0048.namprd16.prod.outlook.com (2603:10b6:208:234::17) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|IA1PR12MB6625:EE_ X-MS-Office365-Filtering-Correlation-Id: 559e6b05-b100-4c27-e0aa-08dbc9f1af83 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BQvF0NAbXXL/eFn56C5mFyYRfW4L1IU+CyUhov43Ei6yXN9DAOX366QA0MoG6t0MTxzGkMmvXlCPYBkVcM1LafqUkvK5vKIeLZcBPkEXVOjJEcyGwp8vZxB9Rq1R42vq2k7w1qsRynW+Wdr2YiFnLJKBr87iGzCYQGquJOYolIys/m92XKCxD39pPEJWQFWMzB5+IB9Fj6BsUAUJa/qb8rSsmQrStt5RiMO/6B6KdetuaC5SFhbRdkQ6OypSGBNNHX+qIwMmdd7QmlexmuYybjSCj3ykMfRahviAeHmvaej2DofOVEnxKwcFvNg4saFx/gcNVujzyr2T0dTJVIHY6MPZemJebdTbiLDuGYpm1ihWWpMDSpYtjtwCEXRy/TUrxazTcZAtHlypftPnij14C7CYqoB6042AzFiM4W9KNT152W6yQmqM2nrre+0BIqcO6GYGzpmCv+5ejeGf+Gc1lSaVZf6w8em4Zk4PLwu3UDPOvgy+k2v3bMVjvJokyG5f8RF7f0HIrb9KhyzBaFd1WTvdz1/SoWEZeYK9ikC6vo5bRQqyeRvozzHdtvpQcDRz X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(376002)(346002)(39860400002)(136003)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(107886003)(6512007)(36756003)(38100700002)(86362001)(26005)(83380400001)(2906002)(15650500001)(6666004)(2616005)(6506007)(478600001)(6486002)(8936002)(8676002)(4326008)(316002)(41300700001)(110136005)(66946007)(66556008)(66476007)(54906003)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dR5YWavcNrBFV5hUp3X1gL2zkrWyclAMJI0s46QzMqsdyv9MnLxQuVnXAEzJ51Bp2mIMnCkvs/vOwkp3RS1i2iP/p2HASR9OC4DgC0zUEK52jD1zYhirinS2l9MKwiTUIg0zLbEEomB4DEtVp2ziBCGWVXAAAymoMu7+UF9Iy/QDlpgAFlsML6+hCPGvYfJrFDKRX6r6RfxnoO1w2m2nslPdtC9EGvwOfLyirj9ve6KepQ9VxuM4IkXhosjlGKa3nPd9TKKxpJSctsHZx4a0oan0bfvPfhf/zoAW/c8ie6Sk2GB0SS5eVZENK5v2vl553G6zQdym2LkPyGV8CJpc7HPsacxe61zuUwYGEVxXvBymPpy3toD43T7BPJvhc9cnWFfFoo+w23fD8wMevr5jAq9tySCqEd/zT+APdzFH3WgNBxvBUDmfmh/WVXfX5AGcexZt/7aDMfsgF8LZD0OpzCjQcib5TkylkRZMN0QdadXedRPvtufwlP96NRTBsQ+OiVbvnM+EEKZVgsjkigNBgz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Tenant-Network-Message-Id: 559e6b05-b100-4c27-e0aa-08dbc9f1af83 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 00:33:27.2962 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bYg3gVrxCBxBmSBP3ZQW41L8V/uPMUfh5zEuypMywoOa1E5G0jTkCWJn8UYl43fN X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6625 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231010_173349_722376_9B458879 X-CRM114-Status: UNSURE ( 9.29 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Update SMMUv3 to the modern iommu API (part 1/2)
|
expand
|
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index d42d5d0c03f812..95bb6cbe2fdb08 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2875,19 +2875,16 @@ static struct iommu_device *arm_smmu_probe_device(struct device *dev) static void arm_smmu_release_device(struct device *dev) { struct arm_smmu_master *master = dev_iommu_priv_get(dev); - struct arm_smmu_ste target; if (WARN_ON(arm_smmu_master_sva_enabled(master))) iopf_queue_remove_device(master->smmu->evtq.iopf, dev); /* Put the STE back to what arm_smmu_init_strtab() sets */ if (disable_bypass && !dev->iommu->require_direct) - arm_smmu_make_abort_ste(&target); + arm_smmu_attach_dev_blocked(&arm_smmu_blocked_domain, dev); else - arm_smmu_make_bypass_ste(&target); - arm_smmu_install_ste_for_dev(master, &target); + arm_smmu_attach_dev_identity(&arm_smmu_identity_domain, dev); - arm_smmu_detach_dev(master); arm_smmu_disable_pasid(master); arm_smmu_remove_master(master); if (master->cd_table.cdtab)
Consolidate some more core by having release call arm_smmu_attach_dev_identity/blocked() instead of open coding this. Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)