Message ID | 17-v3-d794f8d934da+411a-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 49ACBC4167B for <linux-arm-kernel@archiver.kernel.org>; Tue, 5 Dec 2023 19:16:05 +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=0EfBzjasBKHs6UUKd1/GT82mA0tddQHZdv3YdqAPF2E=; b=p1YI1qJDq5fC8o WJdBoaNZDRL47qeITjHsgVKNKFQ1x5K3NfDNl+tfcBVgj6dfIbvFV2sY978G6fzbk2QPW17QxHUxR gXrSbA/XR+m3VATOvCzzZnwIBYiWIkkg43bNC0Q+NKmt1tYqBiQIefoRN0+ZX4yG39mYxNsj6/KoU NUnAo/3bb4YTcwdDf9+eTe2ezxvsnUoK1YRYWSeI/M0UhHou9SQN3jBk/e3Ev+A08G8qYzYmZVSgA TNf64xh8kg5uC3Pjjcw9tKP8taQhK9Bd4DiAJwixFj2rlU7g1dgbTd5w8bErwxBO8TVQ1uk+UfBip woqpbIWbldNK6ik0CdxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rAatH-008FRL-1t; Tue, 05 Dec 2023 19:15:31 +0000 Received: from mail-mw2nam12on2062d.outbound.protection.outlook.com ([2a01:111:f400:fe5a::62d] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rAasv-008F29-2j for linux-arm-kernel@lists.infradead.org; Tue, 05 Dec 2023 19:15:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SxDrX3MZAvL4pqd6MNlXSFcvchhWyUGipLbXzlf7D7QMOtXIscliQ40K2iF00VUzV9lCRHLlCCfT34g4JUjAsIF7f152qFSBWpfIxt/nWuOL26kr8T/BP3rdIk1MHwopV5AUk0rR57eNDy6l/e9XDQAZ21S/QWU24eRAbs/Pw8ZGYnMT2Rm254dXPrC0aoUqE8BzdRNo/hUZezuQadYcuX0szoivYb/X75JQLKcqO1b3tRFD0fhw0hb3s+Xggf3lFg63l3VZPK2qyjAjXVWBbv3eQD+G59frUDT0ByHdDVl7NVUVbY7wMRaESq7gFpwOejCH60YQpJ6vfpiwU+AC1w== 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=hC5SwMIpqNeU8mteD41KXKEMKQt5VX7GFjjFy3njBsc=; b=QEQbhLFyld/xEWlxbBXsEVPEVdtG1UCShVtyqbYk4RK49p3pUpP6wP+pp4zEsGuQRiovSJwbtms5PNTUjczPPnGP5PINKRSlx8C8PvC9vQu2LrOzVJCATPSBY6fSApNNwPWoZfh6VJZS7OYWExPXinq5BZPSB1r2E/AFw+k5BbSzWqFGwoUAewI7EWpOc45/BLS22RKO97J5qs9wnvF3PdXDagw5YxCEXnE7bl7jxSzoJzgnC0hZD8U/h/MNj5t+rXNlOg3aFb3gsZ1oTMeRfMcUVTnLdAkMtNUpW1sm9o7AzzGcGGYaLquk4GDCB1T2OtCc+hZK5CuIoV9bEOumCw== 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=hC5SwMIpqNeU8mteD41KXKEMKQt5VX7GFjjFy3njBsc=; b=a5ew4ncH0KpOjkH7+Ulra4mMw1rXyorCb0C1fd+6mEIiQM9wg/6NQS1R1Vfq/J4+64RFVLTQzFk5/HscA8tv+A3UUSiEomns9jwibuHdt8h+iLcLANTIEJzlc/jpqcvec1MVDCUfxXHoUfoOXQ/jIxi+63F61YfXIFL6Bfn1JaTpj2MTkukFnwR7gVmlIpc4BXQ5qnReUPvTfwksq0/NLrsHvhKT5e0P2U8kcqtC156+826PLtEFoNdEkouK6egZtfpiNWuStT7yEcR5mWAYH8RM4Pf3+vNXADZOmXV+LMTokdpZAvBsiTyr8KFc96b37igtvPcZF+ZKkWDgIqvHNw== 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 PH7PR12MB6588.namprd12.prod.outlook.com (2603:10b6:510:210::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Tue, 5 Dec 2023 19:14:58 +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.7046.034; Tue, 5 Dec 2023 19:14:58 +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: Eric Auger <eric.auger@redhat.com>, Moritz Fischer <mdf@kernel.org>, Michael Shavit <mshavit@google.com>, Nicolin Chen <nicolinc@nvidia.com>, patches@lists.linux.dev, Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Subject: [PATCH v3 17/19] iommu/arm-smmu-v3: Use the identity/blocked domain during release Date: Tue, 5 Dec 2023 15:14:49 -0400 Message-ID: <17-v3-d794f8d934da+411a-smmuv3_newapi_p1_jgg@nvidia.com> In-Reply-To: <0-v3-d794f8d934da+411a-smmuv3_newapi_p1_jgg@nvidia.com> References: X-ClientProxiedBy: BLAPR03CA0127.namprd03.prod.outlook.com (2603:10b6:208:32e::12) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|PH7PR12MB6588:EE_ X-MS-Office365-Filtering-Correlation-Id: a03bc92f-562b-418d-aec0-08dbf5c67580 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SKjkQfUCxYyiqJy2uQ6QCe0TGqSKDV3DN0TUADrkqB4vwLjrDeu2kN0vG4yp89Xac5PcAVrZy5BexYnNH371J2c3laLDReVUgNJDrAO6Atjyxhzrl8NIRFTRYg8vKoAYR6V/HLopvhJCV513daHHeUR7ZM0NEJ3d5gCagLYaah1SYaaBus83DTVKn+cN2hrw2KmoAjw/EUC8khyuEmrBOY1WD5kNH0PwyGkKJhchuxDXJGTiRTgD3bSC/LeLVCTu8znPim9nqAaRAuvfGCpSkFApktONbrmGNfSiADQ/dJRLQYhr12ityOx+Tj6ig4HVW5EUarBUhkt2DPjmKJ8lNmN5xFxRHQgMroY2vy5ZLHayUSbppbPmPDvG2W59s9re79zxJC2UErUbVR1ttmJhyV6edYGuSoAMoIXCWqrUymZ+U//6lAfD9A5gI1hjJeONFM1RqL/bU/83VuNARp5u5TGrw5Mmp6ISJwbCTypXyoSDJ3TX1RiVhN/yieDIZC1n7xTvzzIuhKB7Iinl9OTDdFXkWnLtNAR7F/PhHhthhNk6rkrQ+qbitJbOzQGWPWjf 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)(366004)(136003)(396003)(346002)(376002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(478600001)(6512007)(6506007)(8936002)(6486002)(2616005)(26005)(6666004)(54906003)(66476007)(110136005)(66556008)(8676002)(66946007)(4326008)(316002)(83380400001)(38100700002)(7416002)(36756003)(15650500001)(5660300002)(2906002)(86362001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zFkqZqDhwmMqk+JWlwP1+x2fzgF6NDCLPrgCcgo7RryuhnfK0Gf9cvDNoH6ci8N27EAmcigCH3JRXfwSYK/JshkesW/w8toxPQhN5yCxovOcr+P6oZzNvl6A3jXk/NVOj8l4YY0pyqQaRQANschhFZ8owcP/mdl3D4ipWPopKBqZkzpqhcJyFqIhxwx8JkCwMAkMB25n4zBrc2oZ/hERm5kF+Fimm+t8XIXLia/vMOY7DWMafI2woKUVpQjn8kL6jN6fvRnd2WcOr86j8L3Lxz1c9J01yWz+JSkpU4XwUDsJsDVKIadntDpJRCRG7I8vbk/MIso2gEPP8c0gJ6BsmAZxI1fpNGp3MSe5uwdNi1sYuPlfWwMvtbKuSzN10G75IP+al8wdOC58sHmP0dDeXnkYZAtdl95vWEWV/AAsn/3+eChg2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F9pG+s3/WX+Pe0RqFxsD98INFIebsha0+RzRbe79tMRyxLPL1XyBmLqyEHPGCRcKNRzT8WLxCIVH5XdHNLsR9UvHd0I7Fuvunpteoytq X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a03bc92f-562b-418d-aec0-08dbf5c67580 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2023 19:14:52.8253 (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: jo5CPGpjxc9fC4awmXGwZLqL/Kl0Dj7+tHFEcePdvohKBDDu5UBUPu+ysPVw6u+1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6588 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231205_111509_909887_2AA5ABE4 X-CRM114-Status: UNSURE ( 8.79 ) 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/3)
|
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 386bf954542e7d..8269e2fed6038b 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2901,19 +2901,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)