Message ID | 3-v2-16665a652079+5947-smmuv3_newapi_p2_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 D869EC4167B for <linux-arm-kernel@archiver.kernel.org>; Wed, 1 Nov 2023 23:38:19 +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=lxkkbszueDzHvoALmYgxfhDtEV/5Yh+DiRMofmgq+WI=; b=Enl4SI4Eoy5V3t ypJUJYL++WnkCyAbFR2GYWED2dGnn6mVdtCgaPD1Nxl6p09hxQK3IXMj8ZRirv1duC1g0ljm4nw9f uIRjHgEqPZBoq8ZAG6u/7xxCJSm9KL5Km7zbZoawYsWX4i2pD342SRWGm4zKIsH4NsghB45AJ9x5a 9OW/iIsQi3sQ8YbvyqTYQPKHsohUJdeH75RT+Uz5ueq2GGV7XCiaEtjTmhFUtf9HogtCfrihhmiaE E0rbJPT7JngWvBuStCRSqyvHMsQA1tVYDlrfKSpIBQZRLMPUT+91gxSunzLSFq8XibMXZkTo2K3T9 NEaXJIrrRTo50DGKrAbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qyKmN-008KL3-0j; Wed, 01 Nov 2023 23:37:43 +0000 Received: from mail-bn8nam04on2061d.outbound.protection.outlook.com ([2a01:111:f400:7e8d::61d] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qyKm4-008JWb-2D for linux-arm-kernel@lists.infradead.org; Wed, 01 Nov 2023 23:37:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yl8Db7i8g9n6xNEuuPeZWZUlVYgYdMqNg61C7givzWM/Sa/fYF17Ntg6mlg5duNzboB7G3bn3yZnED5Khw2nydO/xhzDSB2xUxhAwCTKejOQFsZzg3YC8Ic4WHfzGwOOnAPBQPT1fiTaPf1fTZpWhd0nx8r//xKZ9O33tmgIcK5DUJB4ngzlPUtV8YbbCuYVlep62yv9kdY1tjOZ12qvT4+m1oudIr3K8xBP5YizaJF4tgrxpw6Hcy93lLhwqx4EdJDjTV3Jj5C/Fq7dtDq68aD/2EH73/IHs/fa3+Z3brfiYQMXR5U23rlq9YvoYEE83TFo/YGA1o3fPuph4OGqKg== 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=Ru3TDIkTKVGKaglyCTAFEoUuuVkfNmVrCBZubkA2HV4=; b=IuXUHtV4G7rqJxDGEGdwrBnvRJMN7ln80CoW4XOdjVbMKd5NEk298NPWNECaBMSGwakiOUQImSFZO2WrSGva96PElog/bnkQ0PmANGipv0eFaQshRwdRArYgvHQQzmO9CgnSWuBlQ+FbTbxQQ2aNyJIDbK3ebakB6XD1c1rgC7QC5XTOvVlgmFZ8NpPaL71XDQniM2NSmz9KoTPqWNDdYKa6prWJbkp5acwHNQ9SfO4lzwGgU5oTYCsdpuvbOrCR/oWEvBpYO6LNp9gTdOmHyWM6q/BvbUyCaZrRG5utJ9Hu/utl5EBJFPBoifcmj5qBvyshSyNhNrttxD32pg/ysw== 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=Ru3TDIkTKVGKaglyCTAFEoUuuVkfNmVrCBZubkA2HV4=; b=IvmLlphK00QAK9wcpm/bc7cAcjKvEES3QqT6krAnKwKhr6mXdokQjOON9SH4kf8NJbuJzlIgONeBkGkd6eicRTTzpKw2dW9aDrk1L9HZjuj3NvwK5Z15wwU5ljyoTFyQnkviVQMJQljUih79CoHvmycLZ6lGGz0NFb0lEIgGSR0pynMxnd16n5Iq0QTp7BRxKL9eQE4XKTXvoUDYLPtM4kyr81F2wbzjMDW5+VkDwEOGw2JUtHNVE3l/Wn4SEjg8fRuDlt3TniJifgu5p1bQ2T0SLLwLjySUwtOD2XRaxg0A9jkq4iGiF2+902lJCCHZe4b/fXbcjZmLnFUqC27Isw== 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 BN9PR12MB5338.namprd12.prod.outlook.com (2603:10b6:408:103::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Wed, 1 Nov 2023 23:36:51 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::b53a:1092:9be2:cfb9]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::b53a:1092:9be2:cfb9%4]) with mapi id 15.20.6933.027; Wed, 1 Nov 2023 23:36:51 +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: Jean-Philippe Brucker <jean-philippe@linaro.org>, Michael Shavit <mshavit@google.com>, Nicolin Chen <nicolinc@nvidia.com> Subject: [PATCH v2 03/27] iommu/arm-smmu-v3: Do not ATC invalidate the entire domain Date: Wed, 1 Nov 2023 20:36:21 -0300 Message-ID: <3-v2-16665a652079+5947-smmuv3_newapi_p2_jgg@nvidia.com> In-Reply-To: <0-v2-16665a652079+5947-smmuv3_newapi_p2_jgg@nvidia.com> References: X-ClientProxiedBy: BL1P223CA0022.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::27) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|BN9PR12MB5338:EE_ X-MS-Office365-Filtering-Correlation-Id: adf60763-feeb-4169-01f6-08dbdb336a51 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X3rmN4cp/1G/HKgY+AYTUAzzNFZaGKTcUAgRXcRKT1oQQG+cQKU2Kc+p2F8vnefbjnXCFXGikVHoA4jjY8jmH5TB3lqudqCvHG7HqR8UXqJN55MOC0IbjR/YqGfaLlbBCY2mGkFXAntkRS7gvW/eA+/Ga8vDjTQKHJOJMDcPEWz+QVoW83X8TKwwBdd1FXF24pRRALz2biSmjPX79tzKCKVihvrPin+Oyyx5uNNPalaj2eidzRAx34m/v6I9A7tEgJaprTgdzJcFy3OrPhwUgTx1TgQHKtPUKAW89HnfokdZGyUGbFEzeqTZPQH3p5RU3MmkrIu/M9TP1OHe71F+VlrjgkCyu+ErFVETooYpX4WSrSZ4H5g2vR7xJLo7Cwc9fJykM6DAySMJHloMN/xy+CRfWn3Q0hU4Zb/ggQYqsMasVnyt+krAh5hPMeNoNS+MAEOloNGgpQN1bIuqxxHLMjXgdh7FvVEm97rTp7QgnOtjPTnsCaZiQ861AX/4iMSfK3BAnQP1/BB9X9UUeb8mEdTz2LQhyz6Dk1ijFDFEwV1UU22SjeG3NrzHmBm7ACZb6wXAtNXN0be664nnMohKWbsM1zoJOCaY8X17G54r1Ps= 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)(366004)(396003)(39860400002)(136003)(346002)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(6486002)(2906002)(478600001)(36756003)(54906003)(66476007)(86362001)(110136005)(66556008)(66946007)(5660300002)(41300700001)(26005)(107886003)(2616005)(38100700002)(83380400001)(8936002)(8676002)(4326008)(6506007)(316002)(6666004)(6512007)(4216001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RR+RkkB13ecSQymDTi+sk7OzlzlGsBAJ2fWsjT4kSEUWmFPuThDH6Gk5hr4jnGpUgnZbqtgdbfscpdkMGv1gT0O0Vzi67dqldAWbRYevcb5pLP8mtI838q5kymxaj4CA4qB8FvkGhxX7Yjf2eOsFfNMmAUDesveLvygUCs+YVH8vtNhQVvsXc+ISq6k/2QANk2RCRdDlOwa+k/X7UHaD09hQDNn85xmEFT6C3jamHRyeg5m2EwQ8rwV6nCGN88RDfDrVMZJXcEapIHciJdj1l0ZSxC3UJhhytZfhzTR5XeFkNIz7wUucf/TxQNBXCqujrAu6yNE782svayao0EjcbdrmxN3OZIjedMirwdI/6vw8PZfkSZzboyeQm9jUNK6tqG5LT+ICQ0tYafO8Kh4av/jxKkFZVjj37I6S+JQgcLd2pYzrtf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j1MbrhPzfEeqjpK0yHBVqsufLTdX2Je3M1lJrEzHIZKAlNhDwN45AKsKoX82IHlJKjcLcbx4ENX0TljQtxG/ X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: adf60763-feeb-4169-01f6-08dbdb336a51 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 23:36:47.7472 (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: b0DQ/7vEr5S2sZ+nJC+DmcQQjeffeEIomtN81VaYGKhODYzx3MUjNxt6YxF79zm9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5338 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231101_163724_785250_35600065 X-CRM114-Status: GOOD ( 11.60 ) 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 2/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 43f5531795f0b0..9a0eaae586f2e1 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2416,7 +2416,10 @@ static void arm_smmu_enable_ats(struct arm_smmu_master *master, pdev = to_pci_dev(master->dev); atomic_inc(&smmu_domain->nr_ats_masters); - arm_smmu_atc_inv_domain(smmu_domain, IOMMU_NO_PASID, 0, 0); + /* + * ATC invalidation of PASID 0 causes the entire ATC to be flushed. + */ + arm_smmu_atc_inv_master(master); if (pci_enable_ats(pdev, stu)) dev_err(master->dev, "Failed to enable ATS (STU %zu)\n", stu); }
At this point we know which master we are going to change the PCI config on, this is the only device we need to invalidate. Switch arm_smmu_atc_inv_domain() for arm_smmu_atc_inv_master(). Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)