From patchwork Mon Nov 13 17:53:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13454295 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 AEC4EC4332F for ; Mon, 13 Nov 2023 17:54:50 +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=dsiph/aJeq6USTyXuU4Ks1Lbwr4UdNsi55uVT4RMZbc=; b=bb1UIRFjA99wmT lhlBuIsYAnQdW1VvKX2tgPwRSuThIrBczp9+rhXLS42s3Vt0s1HEkR/HFBNxFyPVtuYaMfvDFMl/2 PosDuS8aCTgUMb82HbmYEE8L4FmKvmWcKY3VhCUG7gvJddCEfinAN9Ujjzd/hgVuXztqM+r2B0OMB VgaLyO2edCjzXpZeJqKSzp7iVeeuz9aDKBlZVNVrhseQgPtCoqLfUEfJS62CYYVP81+usxOOwE8Dc RxgoFZFUJvQYQCLgkSLukLOgdSN4OkrdSb+DxOt06sjpLNTkgn7ChZxR16+Fv+KU+VGBTSrK61bCj GN6puKqBpk6f540rQi2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2b8k-00ES6r-05; Mon, 13 Nov 2023 17:54:26 +0000 Received: from mail-mw2nam12on20629.outbound.protection.outlook.com ([2a01:111:f400:fe5a::629] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2b8G-00ERSw-0O for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2023 17:53:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m7w4K4SkZwxSbIhfUxpoe9oXu8isVggre5hmmTV9FWVtANiVDIh/5Qoz+mGSzrYmkoUSbdghn0auFQFl+K8TKGzXkj9h8dpuS8DCG2cjj+2ZS5DT/5jrTjxEF4+qsJnub+jef/ORvQhfVzimxxIUujVxhHpewkqHnx/Qtns/eVLLWWwMIWYKjOy6lD2N+QhPOTlr3HBO51bWd4mSdoDcs1e0hFSMuysG3XH2GB7Fd6Gj3/tuv2IDLJpb5f1hChJBLbXo0Ha+mm4kIVKuo2yoIwfpH0M0+/Rln2W8qB+EPEsV1Fh0lZQvRyJD+9Y8/Klb000lYAxJB3ffk+/sOYFPnw== 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=+jfjLgiQddbkGMxPnFEHgFgTjad/UVbGA26QDxIp3W8=; b=cagf9zJeboirD5IXT8Oxi5nXcheIlAClQs7qDhyam2foP7kse88MGGhYkihKsadaDToJsmW+bEWfkaCJ7DFTcCzSYIpur+1I1GuE0EQcn4i6/2Me59jbfYAEFyT8pFn86ZdPXUfxgaVOEV19u3el/ef8UUb7uCkvenbs+BBD+4jw/w2jc1FqL46F+6a3AjLFRB6i8zecXpiJSBk0Xx8P5+CIsbkNLR/WTxDNu2ks/0dXERWYqsHqw6X65w0/iX/W/0ytDTDfRGqncSCJgv8wx3bZb9hlYoydi79QyqPHx2W5UnWRrRotvHSSIIpYoru0FIfa4amnP79lSQZXHHU71A== 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=+jfjLgiQddbkGMxPnFEHgFgTjad/UVbGA26QDxIp3W8=; b=i3i/u5j73p+JWOUbMijylVqDbR8hQ4OSf+bI7d5O1PLAml6suLZfsIWGX5OmNs98jcWOV6YunybhpDlJVf9RgdxH/wxnMrHqhetOJCKiE9d/uW7Bc1CH6gCFpz6iYfCm78i84Pw5OAlVVusWKibHxwPCo8NTBce3W1xtDBZyS7dS1Zo+k3mq81wHA6ppPj2cPrDLWj7HwUd3I6UkJqxEvQjn8wd2xWqv7jeZW5egOGEAmyYyEGDE0vn2Q58Wa5Y+MCkSHS4Az5PtSEAamt+68M8aCTopE0JaiO6B67OIwF8PeTl7n49atgNIuV8MxYG2nfkYwZbLGaw6FxBKgQRS2g== 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 DM4PR12MB6038.namprd12.prod.outlook.com (2603:10b6:8:ab::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.29; Mon, 13 Nov 2023 17:53:40 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::60d4:c1e3:e1aa:8f93]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::60d4:c1e3:e1aa:8f93%4]) with mapi id 15.20.6977.029; Mon, 13 Nov 2023 17:53:40 +0000 From: Jason Gunthorpe To: iommu@lists.linux.dev, Joerg Roedel , linux-arm-kernel@lists.infradead.org, Robin Murphy , Will Deacon Cc: Michael Shavit , Nicolin Chen , Shameerali Kolothum Thodi Subject: [PATCH v2 03/19] iommu/arm-smmu-v3: Remove ARM_SMMU_DOMAIN_NESTED Date: Mon, 13 Nov 2023 13:53:10 -0400 Message-ID: <3-v2-de8b10590bf5+400-smmuv3_newapi_p1_jgg@nvidia.com> In-Reply-To: <0-v2-de8b10590bf5+400-smmuv3_newapi_p1_jgg@nvidia.com> References: X-ClientProxiedBy: BL1P223CA0025.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::30) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|DM4PR12MB6038:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ce20460-1857-42f0-24e9-08dbe4717112 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eG7FxzM5HyF1Ao8AKfJkycvjF463DZwjl4NE3W/DKxhBHQJt+w33SuX5YZ9lcF4NaK0p/H96b2ykV26KxVhCV7GSsnNp/kcJMjq+ZPcmGX6tmYzC+cbTRJ/8b3c52VB4VAd1JbUAMBFyVtKpHXmOUqVm9Dl/2c1yl1A1VIfUDwCnvsxrHctx0o0xFS32M1vtNu3yxJDeT+HqUXhG3XAx7suz2G4RV0wsY3/+BLDSniUGRaWdSkPRsQNDM2MER1QJkILCW3BQWfl+8AL7dWnpfbqL571G3/MKrzT0d8sJpPtZfkwF3e8xAK7lKNbwoc7+dZe7B3714d61kEuAfI6ogra2091mV5wf++N5GR5wVtYTMgPek0T8QOs6qpIsUIA8ladJSjPCUqMYUhEcqLA2C1iHlzvf3cINsb+TMyyg56Jvfwz436/jBd7bPfdLTETL6lQvgEPWssnsndLhacxx6AHlm6hHKLPTiru0W12jyiFGA2qmdIRMSAZYPW03pf/kTg2HQ3/g0QweOEibpn+UukMjnwMlc4/1FoBtV00LQsgoHNbPxT01tQJ3pexOHJIsPypmlfSHaaPjaNqaJqFtMWMal4hFnr2gH7gFmnUDgEQ= 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)(39860400002)(376002)(396003)(346002)(366004)(136003)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(36756003)(26005)(478600001)(6666004)(6486002)(6506007)(316002)(2616005)(6512007)(66556008)(66946007)(110136005)(38100700002)(66476007)(54906003)(5660300002)(8676002)(8936002)(4326008)(2906002)(83380400001)(86362001)(41300700001)(4216001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8vawTEXTnPADDqVf2GaL++csuEjHYL5MV2adsCthAHr6s7HzEcdN4BeN4OVEFsc3/oUyy6jglOYAiHnIr9WcN6C5FnzbWzFsIb0CkgGL3jSmDxAh3G+lj3qxMuOmzbykRh8VFNP49Vrg0YL/SMuJW/LRGlw1EfQqjqdHmkXbSEN25rVMAugkHV2CICvJ/VTedGCZp6m0tynOUSMCwpO/1v5ngFI1Vv+NgTNFkDioyob7H1QyBMUjLyazc/itW6iLJ9a6yY70G78JavQzmjYNHsFemBFfu44Pgp8kgP4Sbcr7iX/Vmo6UU3avNQ7B7l6oA18JlVqxW9bLaChKoBo++TmqCEUEXgN6f9ecONceX8uri6w0Pr/UmFKSbpYpoHKmhbPu1pYSBjr/xIAFHHdpE/3LoKV5OSWFjCbr6s3TUkKCIBttWMLbvVpmQ4K05qxVIzbCpfC4VBP1oeihmsR0pZzt7WUYjL1Fy/vD3MKunsGbjqHRhgidvDSwsMLIpEHit7lqjHqWdn2aaChdgarIDvyjRjNAuF/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change-CrossTenant-Network-Message-Id: 6ce20460-1857-42f0-24e9-08dbe4717112 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2023 17:53:28.3733 (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: lnXXt4yKP2eo1P30Mlh8IGMpQhzGbMjkZ5Pd/EXEpaem/Mmjo237uAopdB+3TDtD X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6038 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231113_095356_196755_E9D400E9 X-CRM114-Status: GOOD ( 11.05 ) 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 Currently this is exactly the same as ARM_SMMU_DOMAIN_S2, so just remove it. The ongoing work to add nesting support through iommufd will do something a little different. Signed-off-by: Jason Gunthorpe Reviewed-by: Moritz Fischer Reviewed-by: Eric Auger Reviewed-by: Nicolin Chen --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 +--- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 - 2 files changed, 1 insertion(+), 4 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 9117e769a965e1..bf7218adbc2822 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -1286,7 +1286,6 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid, cd_table = &master->cd_table; break; case ARM_SMMU_DOMAIN_S2: - case ARM_SMMU_DOMAIN_NESTED: s2_cfg = &smmu_domain->s2_cfg; break; default: @@ -2167,7 +2166,6 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain) fmt = ARM_64_LPAE_S1; finalise_stage_fn = arm_smmu_domain_finalise_s1; break; - case ARM_SMMU_DOMAIN_NESTED: case ARM_SMMU_DOMAIN_S2: ias = smmu->ias; oas = smmu->oas; @@ -2735,7 +2733,7 @@ static int arm_smmu_enable_nesting(struct iommu_domain *domain) if (smmu_domain->smmu) ret = -EPERM; else - smmu_domain->stage = ARM_SMMU_DOMAIN_NESTED; + smmu_domain->stage = ARM_SMMU_DOMAIN_S2; mutex_unlock(&smmu_domain->init_mutex); return ret; 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 03f9e526cbd92f..27ddf1acd12cea 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h @@ -715,7 +715,6 @@ struct arm_smmu_master { enum arm_smmu_domain_stage { ARM_SMMU_DOMAIN_S1 = 0, ARM_SMMU_DOMAIN_S2, - ARM_SMMU_DOMAIN_NESTED, ARM_SMMU_DOMAIN_BYPASS, };