From patchwork Mon Nov 4 17:41:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13861796 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 E6CDAD1BDD8 for ; Mon, 4 Nov 2024 18:04:14 +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: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:In-Reply-To:References:List-Owner; bh=NxDCkgbT5dHZOmdk1TCC/CwuNM4sI/Ox9Ymy3HvdqoA=; b=HcRS/DNrDhu5N5TRMIj+MQZxDV 9ylayNNc3NXabdPsH/uuPfV07rsGjJ8pbOuk5+W8BU9rnUZumtH6ygCwcy1sFqbydzdrsoO+DQ8l/ 2ghSQoYENIJoXzB+5wynluXSBJgyayDFqB08FvMk9NXkkuHP6Oa+x6Urjm9P8C9J0LvQNVh852/ha PSaPrEQN0dfHl/m8JrfOLXsNZ9jnDGeALTuP5Tlk4iYgzADMISyvhrlCIYxL2nNjbLQA3eX0sMFeB FLUYixBSBIVLOjxCmm/2R/CfykMxtqbwgsZy+2R4OtvmCw2O5vanZsf0t2/rkXtdKl/BGU0RkI1eM p0liu3mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t81Qn-0000000Ee8H-3ehg; Mon, 04 Nov 2024 18:04:01 +0000 Received: from mail-mw2nam04on20629.outbound.protection.outlook.com ([2a01:111:f403:240a::629] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t815D-0000000EZBq-0d0n for linux-arm-kernel@lists.infradead.org; Mon, 04 Nov 2024 17:41:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uOifjqCxv/yojaPVHMQhmYra9rY8cDB1ixa5CVppuKr+2bONc1mDobcLbInciD4llbuPo5QThR+KNLpXKbKNPXgTvTXGWhCGpYlqgLeC4uIz9YaAGMegPpx1RmpC/DaW7o9kmNn7M57KksUuG0FZT97OT5VpbpdpJ0RInTWSPQnoA4O9B2DZrWm5FuUKiuXrzSHt9r42rw3/YiIvfq9bmSgKv0skaRX+mDmLDYuE17aWSY8fn6xuk648wcRC5KOjst7m19cqYYwriWsOBWK108CVet2RVaNjalKfRSJKIGrHYSaXgn7WbZzwtOgf9o0KZTf3c/1XwBCfeu72gBENnw== 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=NxDCkgbT5dHZOmdk1TCC/CwuNM4sI/Ox9Ymy3HvdqoA=; b=PPjjOP6g7tFhkQivIYKhiO2DwRMvJ40Liys+BDaMFE25Y826uvDqD0HogFdb1q00qXTUMKmuoQQB9xSTNud+r7n2Hz5Vn2fh6MXwNgup8fC56waTo5I/LEOwZRdHsCJ7FdegFS8OFQXW5s3pteEb75MWh7DY67JJAJwEWT7zHcXckAqd6HtYWXk/E1FH0Fytw+s/YQiwsQXYpvHXg2bebgDz0Ea6UY70a+oV6yX7WvN0VaaNR7ZVvSU0N+y1C7rFi1WeWU/IAHRFhLCSbyLyxl0UJbq/ouIkmhWB9IvQehBSPXJDYPgiGcD/K2Be2d8AcbQd4f9H1B5yM/xmPksvLQ== 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=NxDCkgbT5dHZOmdk1TCC/CwuNM4sI/Ox9Ymy3HvdqoA=; b=UrQc1Vo4LvKoKhXRt7dHnnCQtRM2F9AuCnnyMMOM9tc1bi4MZ8pv+Kl3rDvazFCBOYeptruUoOymWrzeF5VMUDgLdgjKadtoMAKQYMjJnrM+m6UC/njGWtrJctczd/lGABtCbtjtpwPkhK0XgzziROaYk/glc3OAKuwNUs8RBx0Y8wo+E9+uKUES665zXH4twG51aXOZRxoASFRzxbeWjKCWewKKgs9k7kQdLMAXc8rLI6DIx/jLz6R6Ax39LkdFDY+Andz6JTkwGR1G1+53oHct33OEtD2S2FDiH2Fx57xoLgQPQDI3BRBX2SwCiOKyU7FPF/bJRMkbug4imcxQZQ== 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 CY8PR12MB7195.namprd12.prod.outlook.com (2603:10b6:930:59::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.29; Mon, 4 Nov 2024 17:41:32 +0000 Received: from CH3PR12MB8659.namprd12.prod.outlook.com ([fe80::6eb6:7d37:7b4b:1732]) by CH3PR12MB8659.namprd12.prod.outlook.com ([fe80::6eb6:7d37:7b4b:1732%4]) with mapi id 15.20.8114.015; Mon, 4 Nov 2024 17:41:32 +0000 From: Jason Gunthorpe To: iommu@lists.linux.dev, Joerg Roedel , linux-arm-kernel@lists.infradead.org, Robin Murphy , Will Deacon Cc: Boris Brezillon , dri-devel@lists.freedesktop.org, Liviu Dudau , patches@lists.linux.dev, Steven Price Subject: [PATCH v2 0/3] Remove split on unmap behavior Date: Mon, 4 Nov 2024 13:41:28 -0400 Message-ID: <0-v2-fd55d00a60b2+c69-arm_no_split_jgg@nvidia.com> X-ClientProxiedBy: BN9PR03CA0416.namprd03.prod.outlook.com (2603:10b6:408:111::31) To CH3PR12MB8659.namprd12.prod.outlook.com (2603:10b6:610:17c::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB8659:EE_|CY8PR12MB7195:EE_ X-MS-Office365-Filtering-Correlation-Id: 9da33614-15b9-438b-18c9-08dcfcf7ebd6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|366016|1800799024; X-Microsoft-Antispam-Message-Info: xeMgYsdKa9kcD7vz8qW5MpJHVKigo7sfluFmujjN4P8+A7o9kBxCM4wsOlotApaY/F41b9jIIWiDi4EJu86ZsVPrHsWcY6Iuv+fkSSayD5Xe5O8aoSs8kDKc+Gx+oXrHVQACSOIkAo+uSaPbogZZJfVUcDBSOPxEkxUWhoUBAsg87XCIT2Ga8EYXbhqZwCeSJCNgsRTzsnqwgUlkejGh/3W/5SKnWudaXvveA4IwX5HG7UuJklYO/5U7OumfVLpFWbeikJySs/ChNtHqpk4AIdX4tbsE5Q1/3UVS/ciFa3TBzV8Pdvv+KQw0lJpb7RR8yyJzqjSsSB4OLf4sPAasnD0ymNP/5ozfVap8892XaosOhLP5s5suqkasQxR5etyQLT8uFoB+xFOf7/rZg1XdYLjY2qf4g3b6LqIwo2v+uN/9eD/yp6CAd34EBKXl2jBx+cYUWd6kU7u4j5k3FeBJMQbFHwbDVoNQXtU58+hXiFtxHkqWA60MZhBrZsk89WqQvsL1fuXNyiF1A9ImWKqw7tgBzuAIgKRQhLyVhvbFLlaEUB9vo5bGJSzYL4Xwoh+HaFZa91d/SXj8A8MZRVdIqXkXqggDd4gKH7pGbvstJjBtnd7FJzdw8CEiDqwYHCbe5ksKoy+FwhiBb8MD6AI8xy6EiWWk9jrjC21vYK86VFPUz4/pj6SNJI1KmziuRnHmJ/lcJfnNghnrzulUO9r4Gi3ygFrMJ8S2/mc4ZjXMV9iY4sjMhE+aA+mM50vFtJKT/PbLju5wCdD3EhHCVOmVlUGxi7NQEgaGSQPLjP02QSVwWooZhMpHcNvZfyitFpp2IRYyPM/BoQJDEhcEcbRi2//0HU/fWve2VUua4NEz7JCYpaq37wEBSdzeO1S21KBgE4QAWv7mnTleeWDTrUaHuMuuzkxQHbVNaxXYkgILaRCvwEdCNwhH3L0S87jvF8ZKRY9Uz7NyCOdOERJ03n1JOp12J1AaSvHWjG3LZVP1+yIDPqgqNyPiJeCy3mLOee28wNPTLM5PtCWtPs7xjeNXP4Tl96EC/if25WtTP1CqvQBcBRzO5+qaitHavnm7ESZWSqPoYzL6rEWt/psIsKPosURdqCQBT/KERMaTCvIhIKRys7Ulus40QC1DaBB4eWYFP0HxeObfgOAVCv5EtRpJ5xk3hg10+LRvlWzsm6+mehoQYp8ERfTmIvJCUpeJrDppvnwrqH0jtnTcxjOIj1CwFaVnfw3LMBi5cLGStnY3iB8Z/5ZpJiY8nQKsYjWzw2zoRzlkq/isKTbkwAOFSUCiKOjCjDkevkYqrHLzTXjdwqTaRhCQqB+vjbivGHb2wqX3 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)(376014)(7416014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData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U1WJlQVYBLF3laFCQf2ae+VzNtuH7y74HA3BdvA2xMUnO2cL1AnNl7D3GMUa5Sdj+7FZ20G767CcEbC2Hyl4PJwVw809Q8tRe1yaLL/MKKaaBO1y+zMOz/3x5QpZOXMVbcbgWWDEvYDh5BTJzAG+FH6oOmdY5tWsyAE1KnizAuyzJSlL0U/Y1lbe1SYin2PgxL4t6ZLkOO4HS2rwLRsfiTwmET1cxApPlwPsPWAcTltPncQGXV9yOktt6PDTsVrXfD/0XUNHDhrOPHqARU5jwgPySVYmFclL4crO9afapjVWEdYmJ9teGPWdK4p5DD0MhL9T0zSvzjSV2aZEX8x/47kn2CAwpC9jnBfzLBlyFb0zMn7x82GuTqHPaOPXofveVBG8/TeCGN6wjf+o+SU08vriQs2DVl+fQjmoKzXTEBkIWV9X/vlaMu/AKAKeOpAwz9avVvKLjcjgslv6seAVWyRP9r3Zzez2yyHnHYE54GTs7JCi9klM6nfoPR9vp9fnb9ZBoLHwltowF2RTL X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9da33614-15b9-438b-18c9-08dcfcf7ebd6 X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB8659.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2024 17:41:32.5657 (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: nPJIPodCfXaQW8vu83i802Af4nR6LvMRwyUr5bfYLuDyAnSgZiPLyrAANQYZk8ab X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7195 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241104_094143_214243_899A7274 X-CRM114-Status: UNSURE ( 8.49 ) 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 This is the result of the discussion on removing split. We agreed that split is not required, and no application should ask for anything that would not unmap a full large IOPTE. Instead of split the two ARM drivers will now WARN_ON and return 0. This is in contrast to what several other drivers do of removing the whole IOPTE and returning 0. The kdoc is updated to describe this. v2: - Use WARN_ON instead of duplicating AMD behavior - Add arm-v7s patch - Write a kdoc for iommu_unmap() v1: https://patch.msgid.link/r/0-v1-8c5f369ec2e5+75-arm_no_split_jgg@nvidia.com Jason Gunthorpe (3): iommu/io-pgtable-arm: Remove split on unmap behavior iommu/io-pgtable-arm-v7s: Remove split on unmap behavior iommu: Add a kdoc to iommu_unmap() drivers/iommu/io-pgtable-arm-v7s.c | 125 +---------------------------- drivers/iommu/io-pgtable-arm.c | 68 +--------------- drivers/iommu/iommu.c | 14 ++++ 3 files changed, 20 insertions(+), 187 deletions(-) base-commit: 8e929cb546ee42c9a61d24fae60605e9e3192354