From patchwork Fri Jan 26 18:15:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13533104 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 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 83EE1C47422 for ; Fri, 26 Jan 2024 18:16:04 +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=d9lEaYxKDsFv0zamBlLd1VVeq9dmLPHZkHDGotW2RCw=; b=4USYTLAcQ73kBY E5nN3OFb3ObKa+/Cy5BNqsCc2pw2bwp3ZMmK0e/WixMf4Ov48bBu/wgxuGFjpHh5r0PqcoVO9KQeY 4zTjZy7wWl8BgDL1i3CZ1cGrVFPbz8hzEESDkQj/+PhZgXXnb7Aht/yTxK+BbTjua4wrQgWUqGL6n UPHQPqJBGFZPTfEu3EIyjk7ap1nqyc2al/ka3PCI62cT01gFLWciLgGER+7R9w7qDRAUifIDqxcQ0 JvDUogoViP5fz/dGhDiWQj3ntn3IGsQq9tNJZKG+vFm5n5HJriW9zfTHqqmbysAyuslnkGEWYhDJ/ jslhHJ9tYaoAW3xaWssQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTQk2-000000051bF-3V2B; Fri, 26 Jan 2024 18:15:50 +0000 Received: from mail-bn7nam10on20601.outbound.protection.outlook.com ([2a01:111:f403:2009::601] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTQjx-000000051UQ-199L for linux-arm-kernel@lists.infradead.org; Fri, 26 Jan 2024 18:15:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EKlXhVsXKgM83O0AhSlSHQ2SBsrx7N//PozAB0aeIVzy9H0CkLotR1Z9BZszlTaoQmLx9zwmQtLq5RZIBNXL0rWkk5XNeT9WN815+IHpFX8Hr2xupcE9Xfiq53XKXQBpl+I2r8TVyFHl/yHhx3SlW9AUuYDlTz71oHw7cCamI92GxYiXy3cgSZIVpOLfWwnpHtsbZ4QPZpjwTB/tzfRaz+StKe6ls5x4fMC2ucSzM3htdH1Wd5D8Y2bwLuTAp39UPwKy7B+YTHMP8vGZQBRn046T3UzUX74YFitPQtIsXWpWjBA/Vw0XYFhH00kPT4OVsIOyILllahpWUdXIOsdUHQ== 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=o9BTvMUZH5hSgv/bpXNVHGWCN+MUXvdNLoc8gNQOuRY=; b=Eww4s+3zkF83sfJhpqGu7REx7INBo+GyHzuh0ThjdGPey7iQRFGxyYZUztXjD3Kxpt9J8mt5NI79+3wqJMG0G9LoF4pBKXISBbzN56QocqLBhsaivZs2UYYqJvW7xUk7t/V9R48yjIa8pD/NjdY/akPBjnGMs2Buubc1KcBNJ1yNSNLtenV5TTGoOfTfeaVXPBbzXweMiztF+XkPPIVn4uF4EfdZFCt34moGd/QZa12RG3rhuAKLQO3cB0G8e7RsMay5CyT1fmiV3m2wKCOC5uyjY364LQUQs5Ww5dqHE8XcDCtx5BctH058tawMcFeKRr9ps6RvBMGhIGw6weKceg== 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=o9BTvMUZH5hSgv/bpXNVHGWCN+MUXvdNLoc8gNQOuRY=; b=T3fWv1lmbqn1OSgC84oTHR1rqj29XiRNja5/iuFK0sxjK1LwlIjgOfOLwC5AaxLglDsfVFN8iWdXsFOzB5J6PZlbWEobFyau9jvoOIX9hT9uMaVMVH6w5MhdYOZ5zhEmT/CW4BPFmduSfGUZNujNnEJnxuNVf+NfYcqocSxEKiLBtXCpHVvr6LuzW0DYVEdzTPDtsMGGur4G1RPeRTXA+KRFc+NmJA3XH1ZD08Ljt4nh6jagGVCUJ2r9Z77NLUww7beNrHATY3GRfaATZP7VVYEsErwD255I0veErH1+T2Qj3jXywYCazqQgpCU8askS0PmUiExzMqBmoxVWeQvFTg== 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 PH7PR12MB7185.namprd12.prod.outlook.com (2603:10b6:510:201::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.29; Fri, 26 Jan 2024 18:15:36 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::96dd:1160:6472:9873]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::96dd:1160:6472:9873%6]) with mapi id 15.20.7228.022; Fri, 26 Jan 2024 18:15:36 +0000 From: Jason Gunthorpe To: iommu@lists.linux.dev, Joerg Roedel , linux-arm-kernel@lists.infradead.org, Robin Murphy , Will Deacon Cc: Eric Auger , Jean-Philippe Brucker , Moritz Fischer , Michael Shavit , Nicolin Chen , patches@lists.linux.dev, Shameerali Kolothum Thodi Subject: [PATCH v4 23/27] iommu/arm-smmu-v3: Move the arm_smmu_asid_xa to per-smmu like vmid Date: Fri, 26 Jan 2024 14:15:25 -0400 Message-ID: <23-v4-e7091cdd9e8d+43b1-smmuv3_newapi_p2_jgg@nvidia.com> In-Reply-To: <0-v4-e7091cdd9e8d+43b1-smmuv3_newapi_p2_jgg@nvidia.com> References: X-ClientProxiedBy: SN7PR18CA0018.namprd18.prod.outlook.com (2603:10b6:806:f3::10) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|PH7PR12MB7185:EE_ X-MS-Office365-Filtering-Correlation-Id: 855a518a-02b1-47cc-eba3-08dc1e9ac875 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z3/zntsMh1i/MWtqwx5iQh04k7XlazYH+gMi5fgKIulhV/t6uKsLcki+cFGC9JwQBwUm221hTkthq4wfey955n032HEpdMDhg9YLXf4wh18zh576x1w6wjUtQIRnzHBywiBpFFKCYEGgUkLSYuQ9PPqIgxcrqFnbhOtiSVMiUOm8EBUEmrZhWrs/Shsb+5UryYCiG12vbLzwwVF2UQh3EtSZmMmipRHrk5Dco56qSVjjecSYxDk5csop+u8fGL3I70pdkmVPLwExv0Ks6YzgbiM8vh59+pR3tjuO/QjmwzflnReKewLfaaL4f4AxZmOqZwFlycuxZLRh48rtx8KX9FAnhDCqleDo9ZMvyX5zm2No3lZ7lBhE/BBs9rSN2EjyoQKEX85ubRm+9S6RLgkkAy4PQBodKU5yYoCzKsTn9KHqahZkDB2SPFwpRTPAhCROE6TevwYsuLfdPB7WN0KPUlGcVjkEHlZq86KcQMdJTxZB51f+nKNBnmwrT/jMT906WEfxqJ7czbPRgWQWZpYEUhGkW7M3il+lbqW6IcHqXKlKzOiruiL8HLlsSzX7LBDw 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(8676002)(5660300002)(66946007)(316002)(66476007)(478600001)(110136005)(54906003)(26005)(6486002)(6512007)(6666004)(2906002)(8936002)(7416002)(2616005)(66556008)(4326008)(6506007)(36756003)(38100700002)(83380400001)(41300700001)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tgCrSyTT5EG/Fux3Kf+4bwSgGY/fdoQsvmYsZkN6MdrTv5CHzINwu7pig1GswwEv1UvJJLXeAI1SVMW0GjeMfDdr1SfIg/EGcJEWiDTd2Rm2y7Y4edLLNjEk8iqICtIT5MNRmjAbarRcNY3HCququXIGqbHpwSE63m+CVNX4bsBCr3mGdhqi1mIMOqur7w0xmtgMRQW4+xb2FqPSeTHg47mh89qXSbaPPcqR3tXTSPty5pU1ywpcaP50xR+OoXANFoe19MOfTUiTnskIGclyVFzhpJ4YW1LfiyOM4vX1mM7s1A8dSWC0CULcacssdznpwmSuLsPyVKrWSQpnEjvPjXAyICdzxmBqioxACvnuaWdHpLwi80JHchuhggQFMGBOCpzZMwX1j4rweqEUYycdqYscZdMx8+zBH1kPfAk+YsvW9FZ+iJXAS1i8DiIhdtyCErY98oC6R5QyjG/B3H5w8qL5xW8a1GaDpL+pT30XQnZ67cc5La6W9iirkVAPWLZkiE+zH6dGLBPigglSPy2ygTmvEtdlbw61Bg7ro9EBKV6aQCEVQEPaWmtZcMSM/GHu1++mq2CytPaslqJeNKvu5iGwq39lipnnP5Exr4R0/SQGMCZHdK8cRaghgLMMZnwPhfA/eF7nLyVJ5VaZAcYiuwtngV7saAMPwyhJft5j8DlW82P9SsOFDmeUpQcEJUw1TA1uz7wZ0PU9C8dnKH0Oa7koAc0yTyXCqV04Q4bjE5T/gh0AYDYXWzD7zA9yvi4tuxhw/gZMzFvBeAsafb+ml3F6NwYmFysKPIgDQEvUHPa4ZVnar48ITRN4850iwJCbMpNcYhqwIlNMiq2ldff1j+3zCot+XUXzz8WPhpzJVB2uuE3d5lfILUKsjjW+HbKSlAcku3RCcj0EvUnEzZux0sCYZyCqEVOwDkhtQYOU+BPHlnD9LCYqeCZ/mWeJIoUZmG6OOFVKwpnuwzSvX/9JHaG/aqGzgMaKOXPpdMRJRYx3GHfem5TgrkVA776snyYicvyE3FEcbjePioj62ThfrYjMKd0N5wgGf/70Vr6os5sIhs+e+kgc+xkSUdR4LjZWkCsI7zEOjUWOjiIkTS4BnfvxHxlf6Kh+QM9ztWjJkrmk++aNat77BkYuEpFd2TnA+VVHuSnPsVWNxLvsHkyt+P4v6ERBAiLUcmk2MSfTsJtgsw5uzZcDlOVmfGjIirKdVcLDCzhgWlBEPrMpt4c3w2UXI+mpYJMeQ4Ey5dbTfzVgPFrgfXlpJ7CFj4LThbcSVzNukRcMyuEuLY5i1R4z+t/CaOXAlbtpdd/sDGv7v3SQTNBuwDv6wS8Ujwt5wkUuPA37OILoJsr1EmuSw965wpuVbNZIsm0GA3J/YjVkvcIKZVicrwOMQF1Sz/En8rVtd3nX+BLDqox3bxU8PYbwzzApzbvPWhv09eEKOPE9F+HH6+5Zb85QZnClYVC04JmSmgrCrAjTL6cE07EjhJlIl/ow51D3hm9KxCS7hkSVoWvUwUkrOS3DKhjbQLRGgczluUPaeZvPb7mS5VL1wsqVkeA2LPz2Eg98/LMt+g7WzfMxSst0q+wQIZhC9onaII2s X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 855a518a-02b1-47cc-eba3-08dc1e9ac875 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 18:15:31.8789 (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: DzphO6KTqVkotlEhJtSjgqSLvfDoBm18YMPN1iwntTdt+/1xNV+jERqPlzcLIHsc X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7185 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240126_101545_429105_EB56D5BA X-CRM114-Status: GOOD ( 18.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The SVA BTM and shared cd code was the only thing keeping this as a global array. Now that is out of the way we can move it to per-smmu. Signed-off-by: Jason Gunthorpe --- .../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 2 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 39 +++++++++---------- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 5 +-- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c index 46b4b7626a7c2d..080b84a3b78ce4 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c @@ -418,7 +418,7 @@ struct iommu_domain *arm_smmu_sva_domain_alloc(struct device *dev, smmu_domain->domain.ops = &arm_smmu_sva_domain_ops; smmu_domain->smmu = smmu; - ret = xa_alloc(&arm_smmu_asid_xa, &asid, smmu_domain, + ret = xa_alloc(&smmu->asid_map, &asid, smmu_domain, XA_LIMIT(1, (1 << smmu->asid_bits) - 1), GFP_KERNEL); if (ret) goto err_free; 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 fc7824c8decb50..be95f29e80df6a 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -89,9 +89,6 @@ struct arm_smmu_option_prop { const char *prop; }; -DEFINE_XARRAY_ALLOC1(arm_smmu_asid_xa); -DEFINE_MUTEX(arm_smmu_asid_lock); - static struct arm_smmu_option_prop arm_smmu_options[] = { { ARM_SMMU_OPT_SKIP_PREFETCH, "hisilicon,broken-prefetch-cmd" }, { ARM_SMMU_OPT_PAGE0_REGS_ONLY, "cavium,cn9900-broken-page1-regspace"}, @@ -2299,9 +2296,9 @@ void arm_smmu_domain_free_id(struct arm_smmu_domain *smmu_domain) arm_smmu_tlb_inv_asid(smmu, smmu_domain->cd.asid); /* Prevent SVA from touching the CD while we're freeing it */ - mutex_lock(&arm_smmu_asid_lock); - xa_erase(&arm_smmu_asid_xa, smmu_domain->cd.asid); - mutex_unlock(&arm_smmu_asid_lock); + mutex_lock(&smmu->asid_lock); + xa_erase(&smmu->asid_map, smmu_domain->cd.asid); + mutex_unlock(&smmu->asid_lock); } else if (smmu_domain->stage == ARM_SMMU_DOMAIN_S2 && smmu_domain->s2_cfg.vmid) { struct arm_smmu_cmdq_ent cmd = { @@ -2331,11 +2328,11 @@ static int arm_smmu_domain_finalise_s1(struct arm_smmu_device *smmu, struct arm_smmu_ctx_desc *cd = &smmu_domain->cd; /* Prevent SVA from modifying the ASID until it is written to the CD */ - mutex_lock(&arm_smmu_asid_lock); - ret = xa_alloc(&arm_smmu_asid_xa, &asid, smmu_domain, + mutex_lock(&smmu->asid_lock); + ret = xa_alloc(&smmu->asid_map, &asid, smmu_domain, XA_LIMIT(1, (1 << smmu->asid_bits) - 1), GFP_KERNEL); cd->asid = (u16)asid; - mutex_unlock(&arm_smmu_asid_lock); + mutex_unlock(&smmu->asid_lock); return ret; } @@ -2622,7 +2619,7 @@ static int arm_smmu_attach_prepare(struct arm_smmu_master *master, * arm_smmu_master_domain contents otherwise it could randomly write one * or the other to the CD. */ - lockdep_assert_held(&arm_smmu_asid_lock); + lockdep_assert_held(&master->smmu->asid_lock); state->want_ats = !state->disable_ats && arm_smmu_ats_supported(master); @@ -2674,7 +2671,7 @@ static int arm_smmu_attach_prepare(struct arm_smmu_master *master, static void arm_smmu_attach_commit(struct arm_smmu_master *master, struct attach_state *state) { - lockdep_assert_held(&arm_smmu_asid_lock); + lockdep_assert_held(&master->smmu->asid_lock); if (state->want_ats && !master->ats_enabled) { arm_smmu_enable_ats(master); @@ -2736,11 +2733,11 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) * This allows the STE and the smmu_domain->devices list to * be inconsistent during this routine. */ - mutex_lock(&arm_smmu_asid_lock); + mutex_lock(&smmu->asid_lock); ret = arm_smmu_attach_prepare(master, domain, &state); if (ret) { - mutex_unlock(&arm_smmu_asid_lock); + mutex_unlock(&smmu->asid_lock); return ret; } @@ -2765,7 +2762,7 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) } arm_smmu_attach_commit(master, &state); - mutex_unlock(&arm_smmu_asid_lock); + mutex_unlock(&smmu->asid_lock); return 0; } @@ -2795,7 +2792,7 @@ int arm_smmu_set_pasid(struct arm_smmu_master *master, if (!cdptr) return -ENOMEM; - mutex_lock(&arm_smmu_asid_lock); + mutex_lock(&master->smmu->asid_lock); ret = arm_smmu_attach_prepare(master, &smmu_domain->domain, &state); if (ret) goto out_unlock; @@ -2805,7 +2802,7 @@ int arm_smmu_set_pasid(struct arm_smmu_master *master, arm_smmu_attach_commit(master, &state); out_unlock: - mutex_unlock(&arm_smmu_asid_lock); + mutex_unlock(&master->smmu->asid_lock); return ret; } @@ -2821,12 +2818,12 @@ static void arm_smmu_remove_dev_pasid(struct device *dev, ioasid_t pasid) smmu_domain = to_smmu_domain(domain); - mutex_lock(&arm_smmu_asid_lock); + mutex_lock(&master->smmu->asid_lock); arm_smmu_clear_cd(master, pasid); if (master->ats_enabled) arm_smmu_atc_inv_master(master, pasid); arm_smmu_remove_master_domain(master, &smmu_domain->domain, pasid); - mutex_unlock(&arm_smmu_asid_lock); + mutex_unlock(&master->smmu->asid_lock); } static int arm_smmu_attach_dev_ste(struct iommu_domain *domain, @@ -2842,7 +2839,7 @@ static int arm_smmu_attach_dev_ste(struct iommu_domain *domain, * Do not allow any ASID to be changed while are working on the STE, * otherwise we could miss invalidations. */ - mutex_lock(&arm_smmu_asid_lock); + mutex_lock(&master->smmu->asid_lock); /* * The SMMU does not support enabling ATS with bypass/abort. When the @@ -2855,7 +2852,7 @@ static int arm_smmu_attach_dev_ste(struct iommu_domain *domain, arm_smmu_attach_prepare(master, domain, &state); arm_smmu_install_ste_for_dev(master, ste); arm_smmu_attach_commit(master, &state); - mutex_unlock(&arm_smmu_asid_lock); + mutex_unlock(&master->smmu->asid_lock); /* * This has to be done after removing the master from the @@ -3509,6 +3506,8 @@ static int arm_smmu_init_strtab(struct arm_smmu_device *smmu) smmu->strtab_cfg.strtab_base = reg; ida_init(&smmu->vmid_map); + xa_init_flags(&smmu->asid_map, XA_FLAGS_ALLOC1); + mutex_init(&smmu->asid_lock); return 0; } diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h index 4e8806862ebeeb..e8aa78fc0b8a0e 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h @@ -675,6 +675,8 @@ struct arm_smmu_device { #define ARM_SMMU_MAX_ASIDS (1 << 16) unsigned int asid_bits; + struct xarray asid_map; + struct mutex asid_lock; #define ARM_SMMU_MAX_VMIDS (1 << 16) unsigned int vmid_bits; @@ -753,9 +755,6 @@ static inline struct arm_smmu_domain *to_smmu_domain(struct iommu_domain *dom) return container_of(dom, struct arm_smmu_domain, domain); } -extern struct xarray arm_smmu_asid_xa; -extern struct mutex arm_smmu_asid_lock; - struct arm_smmu_domain *arm_smmu_domain_alloc(void); void arm_smmu_clear_cd(struct arm_smmu_master *master, int ssid);