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: 13861740 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 CCF0DD1BDD0 for ; Mon, 4 Nov 2024 17:41:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5034D10E49E; Mon, 4 Nov 2024 17:41:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.b="UrQc1Vo4"; dkim-atps=neutral Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2074.outbound.protection.outlook.com [40.107.100.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 23DED10E49E for ; Mon, 4 Nov 2024 17:41:40 +0000 (UTC) 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+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CQBT/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-0: V+TvrkY1p63cjm7BZq0xmvpiTI0n70C1gEJu74d7/1A/AxY19yvSX8lQhQknqgjUSQkYio9p1hThFvNVt3AXrn2TD4hdaUlilEcsUzlgJRi/tChVl6ntB9kigNriGUz3hXGkOvNFi8luwaMEprl5e4fSM3bIxoF+PtbaASN48UJSBQtHbIQrmXYR4TC6XMkH2M0jHmd11hfuQs7hwe7yY1a2BVy/NVSUc0eQLYhk/k29X291GcyFLCwHkxM/s6r7rjGAeHgSpuhZWHWUiCAy4kJcrK2bEJ4fq0vX8I3oFRlNIR4uxRDcqtbojxdb1qouctilNSVU9FJNQw8zt955ZUqQ0OZ2M4lzXn7lkD+3FuLBjRL5CsmiswsXhmu6LD3OddSEaEqMY9K0/J+7yTrCdouclm/j6gMWNCW1O7PBhw7Oh4/ur5fWVLVUw+Pox4DCc6nb+yo475bRCM8gnOdblQV2oWHshZa+t3eqWFYk36kB9uJWJuW2UkmwTwj024FMaCfnZU5dmiyuvJV9wKLOIQhIwG6tuGEOjcib8h0vkGrWQ1zL8BFXJAsibx9aluV3y/eLbFnXm8+9iCoEZeFarddfZOnO2rwYWeD+p+h6fYyWEZzI3qoad+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ource: 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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