From patchwork Tue Nov 5 18:14:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13863338 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 B52EED3177E for ; Tue, 5 Nov 2024 18:20:43 +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=hZRAsBF/hB+2RjZnuVMNjcyzwXmeoBj+JAVBiTJDpvI=; b=UU3CF8qqiWnEdQ0ZWqQj1ANNbP O9cF2Pqm5Xl4tEPQBXFsucXuEuifodPCGn/dH+Ve86lIiBWnliVcaxUik6SQ888/BKv8lcKDX3S6g t1PGA6NEnZTI3WScPzez/jG8/gki9NmQAMIUdnErn4yqguzIuUvZsp8vgxFQtQTfQKpn43xAyjEfX hlxN+Ms3Ef1RsViu0joxlt97S7DjKpa4wh2z/XsUaf2ZF7Z5LWhwWz8HubB3tU41mf7iNT7+r/fCf CrCuVUrZgW+ayTiIEt7QNweQ5Q/w+/KP8yw086C3r4R5c61JpvLkRV28RmbKlcdASaFrJ/e1QTYQY N6YP4KSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t8OAI-00000000M0Y-2kTw; Tue, 05 Nov 2024 18:20:30 +0000 Received: from mail-dm6nam04on20605.outbound.protection.outlook.com ([2a01:111:f403:2409::605] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t8O4Y-00000000LGm-1qqh for linux-arm-kernel@lists.infradead.org; Tue, 05 Nov 2024 18:14:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HmVLiaP0f+B4wSR9gQcNbjbfMFiILIjgN3605gos/66sOHFBqfy1QhR7ACPVNJPoN2Fcx1d5V9MV60RU04XLDw4hJev5g2lL0F19fqIY9UIE1rhptriGDcsiNnna91Uco1IZsJfz93ksiQs79+4ELv2qCVbxw/6xYQocX9Lhm59+K33YQ7M884r+iIFZasAMQAzzv571jEMnE5HBA/kb5Zw8YRJG67PmYRyjigSajvMIFvsiW29A9r1hz4yT8xulc65G//7h3PvnCyHfsjwrFehmnPCi07rZucaGonOSxevwCBsFixVkE+lVWMubxXsiGwfGBXtZFUZrltp+3VRLZA== 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=hZRAsBF/hB+2RjZnuVMNjcyzwXmeoBj+JAVBiTJDpvI=; b=Wg6GOBHCML6CpSEvXws7osPn13M9jl5FSg8HS31SJQGWqeSBGMwX2XuB43L718Pi5KKjT1GXbXvAt3nNcp/BnaaMyFtDBSk0b9iJA6UfdsJUPt1gTLCMs8jYmZ0oPq1ZXUzMAcYUWRz8nCXNijYRtfCEat7lGixk0TO0lRoykp+cIPv8fhISwJN8tcmZikw3RDoaozIUPE/jmEVAtEJ5R1Awj4axDhhp4kgsyI+IKCGdSLJh4KcOrkQgy8P8VdZKOz7mgm9/5cbrDVAmgQ2bPHY66o+ukKW++hrlPcDQ+5u4/o/ikdKwMeMgd8HFZG6xQxgPyAgm4VYDNAdjI4Z+zQ== 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=hZRAsBF/hB+2RjZnuVMNjcyzwXmeoBj+JAVBiTJDpvI=; b=D7hUEptHCCrBs0SnpuWtf5CquSz9ZUjrenU+t3Uqzwavs7lSpZT0YByJ0f73PQTAFM50iU/t7T1SFtUC4lntkmYX1UuIQRujMI99k9XGu2MNxlOLVFtNreqaRMUoKSEtZF6ig9Uy2JFlAbo1Jru0CL0xfrZkrVsAkHKttAXUMfZbfaik3Ay7Vz9VEpXwJbuynCSHCDwLPNK0eFh6RYW9pGqbiFTlL/CCyS3UsOOcGTtiqNYGjT5NeHd8Kmn6zbLNoNfgFgpAss2trie1OU4JAWoNAJnw4BBr4yme+Xg41MJikXc2G03cCH+T7LCeSJ1Q88HYi1dlxu1mpNkuIH5iKw== 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 IA0PR12MB7508.namprd12.prod.outlook.com (2603:10b6:208:440::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Tue, 5 Nov 2024 18:14:27 +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.8137.018; Tue, 5 Nov 2024 18:14:27 +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 v3 0/3] Remove split on unmap behavior Date: Tue, 5 Nov 2024 14:14:23 -0400 Message-ID: <0-v3-b3a5b5937f56+7bb-arm_no_split_jgg@nvidia.com> X-ClientProxiedBy: MN2PR05CA0064.namprd05.prod.outlook.com (2603:10b6:208:236::33) To CH3PR12MB8659.namprd12.prod.outlook.com (2603:10b6:610:17c::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB8659:EE_|IA0PR12MB7508:EE_ X-MS-Office365-Filtering-Correlation-Id: b11e076e-bf83-4800-763e-08dcfdc5af61 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|366016; X-Microsoft-Antispam-Message-Info: +kxnLPdyS/UNWfkcxBKY9J8CD33zn/tqaOIrvQvndtbluNP65Hd+32813UBNs+jfrFgcznOSAbO9Z0cIx269NFXNW8Wq8fDVlXQbJZWaqztmwXasxc7uaacaPSNhbbh4HZ37RsDwuEI8KQNxR5PqPaflkucYvX4c4jzLiJ5CNwhj8SrcrW39p3a1fYMHAliQZMwvYymXsreNQrayadXqDxc8xXzP2l3vY2mXFjMBQZhSagDjdYk+s22TMlw460pE9xLwf+P9kDXZrU3wTLe/knQdc9IiUf2nctJUSeya8GetMrEl4oAN7/O8SPkrPusNaZGKyBs/n15KXUTCt8i85RY6ddWekAZlKwvJ82Pm6VwVYZQDsuNYz41iW4aLwT1JP1o4aW1fNz8JoEEkdW4dtwIVXS5MXaYwdqsPOnAKvcNjJOcweoBRImoZNUHuxg9nCK9Fg6mn/XnQqpyAP90fjmtt49T8977js0DVaVdeUC8XO6OUmwqUdUmKvObm1F0K24+X0wcB1r1IT7WF+wwFWHkHcRrHOlLvwAW7f25qypIdVuPGQGE5WkGvxn2ICMRYmjeWX58Rz+GZfqoYbOH1kAwGrYGUZqnNbRk+46KoBSqkS74T8QSh0oL/2Pf/Eg8ZRSpxVz8FRc8QPL9ipBLpCqlGHkgDeLdrBpLunISO/YTUHPKFUxyZ3PefjA27RSRU4CVM1II6/pyLvo7TbJTpYOU1rUZJFnWEM/h3ai/myS6VQrQkfQ3tPx5Px+GPs7NtHlnZ69VaAYTwXZ0jJl/Lmc7Rz0/ou+Btp9I+mT/1O+K0E0+AVjXd/YIiWCerJAPyn0W4FqTVfpAhXYoEVlNk9NtGjR4MeDRkgA3bDGQpUtsMppG4JzrHUYaPHjpcZ7O7yRUo+H2c4JF8+43tdr3oPXYoGMJxNHs/FgmK1ttn2IBues0miYvDshMJ+T0Py1iIBgpBNT3Hl06EMTx+I9shBfirZfozofALMLbhqj94wkZ5ASZejn7iHC5uA7iVn7Jaox2ODU+WiS9I1IIFOxcfUIA0uG368eijg7zhIZZjBS2cfoeN+1vO/7RdQe3K7rd+L5XbF4EYhks7c7xUI+jiLU7aWX/EsOrUKhfresSl1mxz5Ll2M+/rUNsIWYMFnBuVU9VmcCrwe8P0yw8bIdJZkJzMP2nCLvQS6ZvX9+LIvpM0SjDs3GZtudsFlfjdB9tGZnHCoEu++KYNCT5XgXn2/3QxqBx5InWylH769EsFHThbNrWzWPxu4nP5Ns01dfQi+UMrYmgnUK/d92Lotne230+kgeoxpQstZMJywAd7tqqsmYjkyR5/7dMnDcQeJJ3v 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)(1800799024)(7416014)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Sbe9+UQHHj3Szd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UNzwrA2xrt7qoa1NWRHpVlYysMD0LlgfSUivgGMZZmtDtJiN+zuYRSeMgL2FX9rQyqdUBh74uuacJddXSttJaFRRT+FxzRJsUocaJZZTon5lTgI7mEUqMS1czNK9Q5IXe9e/wXTxNVSsi3HvA9uXXjgFjZWkivG3ahZ3gFfWsPTa6FtvGWzRZlrVdcHMAhOz1Lzb3kvuaJIAFwTyl/Rw4ALwIIgXscNA0gvjJNkVsqjqYFK0Ravzw5Vt/95nrzUiYlQqH7dgO+TZgxmrRzBKCt3oY96lfdnqD/chDX9rJbslw1eSnxm5vAx0oRRDUaboTJoT1oRkGy61+UGMQPIhtEEbMBiKNVUIFP9XUCfpGDHpf0eV/tbknlmQcSH5N0wOGkSLTV77OR4XZOCYI4+ACLhFYTzbMTS/OnjBrmjfllATVLOFddc4xaUNOfsphuTS6ogMFrD+50C2qOY3a1Jw96ywLZkz1XXSxGUm5U1hlECDGAMlI8lWNzbACZd X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b11e076e-bf83-4800-763e-08dcfdc5af61 X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB8659.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 18:14:27.4176 (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: BnG5UM5u+48PL1fQxDFye7o8rO9t25NkMhaE0cTkDYtnB336hnZdCQpvFm24WdeB X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7508 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241105_101434_523685_15519D63 X-CRM114-Status: UNSURE ( 8.76 ) 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. v3: - Remove selftest code too - Fix copy/paste error in iommu_unmap kdoc v2: https://patch.msgid.link/r/0-v2-fd55d00a60b2+c69-arm_no_split_jgg@nvidia.com - 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 | 146 +---------------------------- drivers/iommu/io-pgtable-arm.c | 81 +--------------- drivers/iommu/iommu.c | 14 +++ 3 files changed, 21 insertions(+), 220 deletions(-) base-commit: 8e929cb546ee42c9a61d24fae60605e9e3192354