From patchwork Thu Dec 5 15:43:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13895639 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 14B35E7716C for ; Thu, 5 Dec 2024 15:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding: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=w4t+7LEKru34zt+XUKbuXCe37jNEAPuvOcwMVuCXbEY=; b=37qUl2l7nro/UWAHbmAlBuW1ke Ay6DeGtITii/RAK/KKcVGGxp5tVG+nQJilrc/I6yo6PbInvhUhYgMgmlWaiNbLJqNrhbPwsL5DIlV uUuIvAGX1YLGdLWaH4CKwR4U0A/ePI6kSCUqDRMo0qplnBT1YuF/6s5dtKsAXIwLe7ObLWVxiet/i In9FCJsyi7XrP+wCQqSPB3e6AOkPVFH5EV43kbIbsWXstraEM99hEHl1BKwQs5s/0Ywpc1VJlfcHk /pUGyiBmwZ1VxAuaTI45y17D2FTC/3yeKvQnm0339SkUYAXgvRcEvAs0Y85aHGy0PB0RMmFyQffIL +blRuQ1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tJE3w-0000000GcTC-1ZCq; Thu, 05 Dec 2024 15:46:44 +0000 Received: from mail-dm6nam04on2061b.outbound.protection.outlook.com ([2a01:111:f403:2409::61b] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tJE0x-0000000GbZZ-2nmT for linux-arm-kernel@lists.infradead.org; Thu, 05 Dec 2024 15:43:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d8xjkY3YrTvDJ2yJo0gZxgWXxU1ldlO7hK6Hz9P6OW02UMYmMVd5OI5P0QoD8QISxriQqJNKJBc56CewIBIHHRIG3VRBrZY3x+wOLw0+P9QU48YXooGRDBVvIFzWqTiGr7Vpr4HPXral/ytjnYePxngTOoNEB+3QjkfKZdq1O5jspWHRXiOfagpllOUU8OO3qAfwh0ResRPa+LBtIJitQq9doPHfVx3JjAdphOY4MbDSc71dA+MPG/Rsu+/ij97KN3q1+1fhJrgVfSfTfkTlMMe9HaTbRnIdfRpb2WOFiXFha8SeZIIaWJ8MgjHr4a6ANXJZQyz+0twxtLfGMwS44Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=w4t+7LEKru34zt+XUKbuXCe37jNEAPuvOcwMVuCXbEY=; b=hKb4JSmZxXGQhgkAo5JOaxB921q3Bc2feb4aaQuRCnWQf2pBuynQdHaKNFP/6OLfL/Gvx0gAphvjGPnYT29Z5KDJxfYPtVhRI5Ct4Yo9MEEGW2oi0x+ULpyFq03FLqiRTCf2bFLTiQPmYV+SKHUEo900P3ZmG5pg6ztzdpiUDYvT40exZ4c07gQws4JZpeoqvaNFo+2bHNZcTn0bWIJ5G/Ucd4OkHKCL70IPxMCDm8y2cUDsg803mtBq3hte3Ju8qn6m0lZE4Oq8yMbYsmzykg1a8i5CdiRsG8JBY3v7S+CeoIx4hBbVgjvAonoN7gzO2rOcTiBJeWbmsridWDeFMA== 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=w4t+7LEKru34zt+XUKbuXCe37jNEAPuvOcwMVuCXbEY=; b=IAgV648Gp74xWgb6EQnS3UlfDavEopTFAsHPvUBOSwCqVU0sqRSJOkzx6DO9Muu4mJnlblQWx5/IDScBkd1IzDML0mQkPrZULV5c88EqydwREAGClLQABhTAlObGDeagFKxtdKrLy0eLPMrUEjxskiZwm0EsKbXl65EaDSJE7dkeJKUCXGaw2DKJLuY6Et57o5HS9N78+jyphnDxjQmSNUlS9KBd4wzn/4VdyUMkbkNLnPkAGAU06XK7wxSGcx6gBso1CwfLWGZJ1tkb/VtcWo3INLUlus7nrNADQlkGZ2ZnvHFBzALuPZ2sKKRe+GbQlu+1J39FevzcL+i2Fb3SFw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CH3PR12MB8659.namprd12.prod.outlook.com (2603:10b6:610:17c::13) by SN7PR12MB6789.namprd12.prod.outlook.com (2603:10b6:806:26b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Thu, 5 Dec 2024 15:43:31 +0000 Received: from CH3PR12MB8659.namprd12.prod.outlook.com ([fe80::6eb6:7d37:7b4b:1732]) by CH3PR12MB8659.namprd12.prod.outlook.com ([fe80::6eb6:7d37:7b4b:1732%5]) with mapi id 15.20.8230.010; Thu, 5 Dec 2024 15:43:31 +0000 From: Jason Gunthorpe To: iommu@lists.linux.dev, Joerg Roedel , linux-arm-kernel@lists.infradead.org, Robin Murphy , Will Deacon Cc: patches@lists.linux.dev Subject: [PATCH 3/3] iommu/arm-smmu-v3: Remove domain_alloc_paging() Date: Thu, 5 Dec 2024 11:43:29 -0400 Message-ID: <3-v1-0bb8d5313a27+27b-smmuv3_paging_flags_jgg@nvidia.com> In-Reply-To: <0-v1-0bb8d5313a27+27b-smmuv3_paging_flags_jgg@nvidia.com> References: X-ClientProxiedBy: BLAPR03CA0054.namprd03.prod.outlook.com (2603:10b6:208:32d::29) To CH3PR12MB8659.namprd12.prod.outlook.com (2603:10b6:610:17c::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB8659:EE_|SN7PR12MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: a09349ca-a929-43cb-ac95-08dd154391b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: 6y4rWdM22yP6U/xpIXuWZIYMVp6HgzTqGk8VyoKGH5btCQMTgAcdzeWe0xKEm8EvWC/J79iPzCLipCGxVK1m9++DBXm2x1N8f6BuCAlzbA9c1szmQJftpFyUMBYT+7CJVeqzg4fE9njGUu46EPkV0/F+ROUKWZiYXZE8yvIZqDftJ8Hqx8wRbUV+IihF0WSdUpHufKyYESwqXDe2i5RrT4mS/UEQESiclJJbZqep+z0f1sDclZIdvGQUaLQ67+n4x0dgHpvd0oo4PjI8eR5xhMwcDLjKoo6xjAbiqRMVnkNZEIvYLWXDpII3sqoXL/7GCcSwx5Ua5l7PrkPhJI64quzwZViKCL2vZv6jSifPQmwSD78HIC52+8bpiBi5VvrQCsYzyDRrW9U70BBpmG/tcCePqytykshK2MqaZemGawf38CzXyUHUsEPk0IliTaLNErYdUE1pVj0S9av07yz+jpmwkt8B8McfWhdVAqVZJo6yfODZWALaOe5xRvh28ILe4NaGg+VA2m5/dQA16CV/Lq8YTMVmZHeLWk0zhyuG5eut6zQr8AfCv0aJ6y6AkunoMDzFV6WGW0kUS6pRkBp9L8O1WcYVSzgblL0aRJMW17/cvNHlBZglOSzOvGh1MbmCbxOscCHta+GfDYgkzUAhYqMstRF6zSiLINKNl2DnMvI1TY8BTiNQwjj9TpjF+dm/xFWqaf3zYWJbxjl9Q6bna2QNFYzrTXaiSri5YtdLdhcrHt9pDK4rgYA2i6jKa7cbQ5p8xLSkXrn4EJ1NOpdc6XZH6xBXPbXId1a2R/XTzTVCIewODmCe2wr4Vcvf3w30GZgoAa4qql4tCkW38iXUBbeb5epc3SCB+Fes1esxXLzTalelJ3AbJUgGY86q4Gr0DToAzoa4kUirYXXIeRC+1qrpm9UV2OtH6YfDBo2ZIGihyau3wBtQDnDHA6M/Y+5uy2ew2drME0Qj/7atpJ3qIYwnUSXcMkFdykrjr6XDXm3WyTQ/hhwLcTcEm39qAUF7zl84SdTYtjR5MdHSQ34cbf2UJMqx/6aXfeA1p3kScT6el1OlKVb+O0h2Z3Pg7gXfpjAyGn9gqJAejI5OgHajt272cG6gfN/MbCm22WjUQ/CrcPG8UAqRcuWMRO7i/eVyfdlQ8TJC7ZRvhgaWDiYFTULrsf1nc5iHmj5DcUUs9zkunB67IOMhoJEAcHlV7x7KOvMztwPT7W0D5BhMZr7q4zfvMSjJwfnW4W6HDTJqMgJ9ta6RmKecdyhbldjqHk/3WcKSgR3nB+pF/nGVqNVVOyMXmRk3eAgsk0UVvKMyH6lBlNXyro8UGOQLVAUCse/nSHc9FPFNcmdsNvSNbub29g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR12MB8659.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: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NRiVvZP4GEB3y9EXwQE+WtJf6YSmqpd0bm6J5uxNMDbcHwCn/qj6F6wiPHxTy4yd2qZVG4N0zyft4HRZyNYC+VeQg7KeEcVeHkPKL19uj45c4GTYvigEcqKuLV4wDDPWWJnLxLe35//cCZEfhP1nUHCicA7dJq+JJW40Mj2/sD268zw3nYsPMtVXTQjTnT6uqfRCa2O+THybxASqgTeLWBcJ6EALdYhvjHKEZTZjF3VmpUYJU/oN2eYEz8D9iJaBBY2RHgzXcr/aKSVZwUq9zHu7U0ubGDxYuTt+j1giK8hcKA56mSCvEVrtZdObddivIeK5bXnpR/GmOJ9pyzv3HgSI6qEbiVo8syulOHZj15kA2VEdISUAGJruvFHLKy8gBXFct+GamXlFDi47M3bpg0CiRoyAgGZREqZMkuOffBx8e3ZXSxaRys9LjmOB3EV5r0r6Xk9e3ei0aobus5ex4lhsRLiWQsCKuXgrVfdEEG2qhPEz9aHBIJq+YZpXWYjlLfdvWFRIrR/8qkVDW85SGU2yo5WcO3+ZgLveEH8BoR4DBUB19t X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a09349ca-a929-43cb-ac95-08dd154391b5 X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB8659.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 15:43:30.9451 (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: FsOsZ1BVK/57eFnszqDgWNtVOdACr5rU1n1cKhXyST2ZaN03kF8VsW22XlHnr3vD X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6789 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241205_074339_705500_622ED0B1 X-CRM114-Status: UNSURE ( 9.70 ) 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: 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 arm_smmu_domain_alloc_paging_flags() with a flags = 0 now does the same thing as arm_smmu_domain_alloc_paging(), remove arm_smmu_domain_alloc_paging(). Signed-off-by: Jason Gunthorpe --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 31 --------------------- 1 file changed, 31 deletions(-) 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 00105ccadc8b2b..f285b98f982c14 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -83,8 +83,6 @@ static struct arm_smmu_option_prop arm_smmu_options[] = { { 0, NULL}, }; -static int arm_smmu_domain_finalise(struct arm_smmu_domain *smmu_domain, - struct arm_smmu_device *smmu, u32 flags); static int arm_smmu_alloc_cd_tables(struct arm_smmu_master *master); static void parse_driver_options(struct arm_smmu_device *smmu) @@ -2359,34 +2357,6 @@ struct arm_smmu_domain *arm_smmu_domain_alloc(void) return smmu_domain; } -static struct iommu_domain *arm_smmu_domain_alloc_paging(struct device *dev) -{ - struct arm_smmu_master *master = dev_iommu_priv_get(dev); - struct arm_smmu_domain *smmu_domain; - int ret; - - /* - * Allocate the domain and initialise some of its data structures. - * We can't really do anything meaningful until we've added a - * master. - */ - smmu_domain = arm_smmu_domain_alloc(); - if (IS_ERR(smmu_domain)) - return ERR_CAST(smmu_domain); - - if (master->smmu->features & ARM_SMMU_FEAT_TRANS_S1) - smmu_domain->stage = ARM_SMMU_DOMAIN_S1; - else - smmu_domain->stage = ARM_SMMU_DOMAIN_S2; - - ret = arm_smmu_domain_finalise(smmu_domain, master->smmu, 0); - if (ret) { - kfree(smmu_domain); - return ERR_PTR(ret); - } - return &smmu_domain->domain; -} - static void arm_smmu_domain_free_paging(struct iommu_domain *domain) { struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); @@ -3549,7 +3519,6 @@ static struct iommu_ops arm_smmu_ops = { .blocked_domain = &arm_smmu_blocked_domain, .capable = arm_smmu_capable, .hw_info = arm_smmu_hw_info, - .domain_alloc_paging = arm_smmu_domain_alloc_paging, .domain_alloc_sva = arm_smmu_sva_domain_alloc, .domain_alloc_paging_flags = arm_smmu_domain_alloc_paging_flags, .probe_device = arm_smmu_probe_device,