From patchwork Wed Nov 2 12:51:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 1698133 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=P2OzNl67; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=EgDkb9Ce; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N2RcT6h60z23lK for ; Wed, 2 Nov 2022 23:52:25 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=zn5sFsuzD4/Wl+4Uaom0jeJaEbrkuuoeir74yx6Pe4A=; b=P2O zNl67N0ylwM14prBvnKFTzUz0hpoSY1x/mW96XKpnuHfBSk7a+/Vk6Q31SCF/MzoEyb638DfJz+YC yYEFhy3Ebw4Sv/BTQ/0E/NYUfFS9jICEbSDaHJeZG2ir05H6h/xlY2Y1h/gYL/M+Ijo0Kw0NvWPjO tmm7+z9dGIZirWy1JrnTJ2vAdflNu4s6SSFuwLPXl0MuQXp4bl8xGwPyfXWSBFbzlHfRBs7EsixQP c/XHBjZwHlSHcc93/dSLcnCkjGskKztTJI/MM4oiVk6ei58iJbH8VaHF8bpVmSNVi1tvb9o1/kMBo r7T0o1Z7Y+Rz69T/5+IVYh9cfZwXwLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqDDz-00B5gh-CW; Wed, 02 Nov 2022 12:52:07 +0000 Received: from mail-mw2nam04on2057.outbound.protection.outlook.com ([40.107.101.57] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqDDu-00B5d3-EE; Wed, 02 Nov 2022 12:52:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T4GecxCeESLLBRoHN4DK9yrhSW9QHt1Cc0FXIp5jv0Gany9t778AzDlVEEfEl7GJW3LqRJ+eBa7MU9nmacc44nJmKaEk2Ip+EwDuzJOpv3fqQ7m8oscPq/2PhVlSgCLq7vQ0H7cS/SoLr/pKq0PAPBa/20Rva12tIxqyvYlsVDVkqVuFZI0MP+ZgeLEo70jz9c9Kv3Gyp8ANxWIhyW2F2Dk0hA4Bl/JT86g/SA/SyV2EMYiuNdFJikABsNwzAX+2mggEA6I/6eDuFoVKo846WU79uJw0mZb/eIMrirBmpDy3Gof0ainqlfzw5K3FKVBMfwDPm1BuRVtbgeLzKOVPfQ== 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=ZLn5sm9jB4iChIy9YVdBNcIz/Kc3dpqgq4R0HzGWXFE=; b=eusigoItp5nWKIK0O6MnVrC1OQzXwGz1gjwrg22SP2m2Y/hM/LirzB0C9xj+kLNpEu4InYuXbAthIZtU6Exs/b+bIt5Aj5rouqFTyGKPjgCDPPALGd/fYSSx8nfVcfRC2nS5oyJBtwBSXdpUxHRqsnd/wAeQNOCO61HmCaX+FlM5occ/imcJdoN9BMwQ9T4F3K/mR+6ZnqyFP1rc55RXRFg3vobR3WKrmIiy5j7XfuUrP8+CpIWOkTU/Q+OlnhCVqpgfLgMCm8lFkUt9A6TLTVxmQfLucZzFgWc0tUifHkrd7dSAzlFkWPw/9vlBKqInkXCrZqlnhYEasx4tkqvWmw== 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=ZLn5sm9jB4iChIy9YVdBNcIz/Kc3dpqgq4R0HzGWXFE=; b=EgDkb9Ce6HiMCWPOUcf+W8k2g8ia576DbpgXMuMraoLsIpEgUqpNWmX7n73lARaZJI7v+aCTBW0xdm0hWRWj03Iy4wqNHgKSWb2Hg0x9BLzGHsuUTIb90lxBHTEQtj+kOtqugcRdR2oaWlbDzVajhtgjVoeS7QgsxpoEFE68r4X5llHlnrw/8ZPF6Pi/Fbo2qwBpGyNLwIBMM4W3jPfzECrBBJiJCMRXmYRPgN5kcCFJHgMNwZHFWR8wIrY8iLt9BtBAFGRh4xBGyaZpf3mjKbLP7cVHsdSyZKZx0PqmwJIa1mL6SryxcVUQJK+dadjvVBWa+KDz425jmybbxBgtyg== 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 BY5PR12MB4067.namprd12.prod.outlook.com (2603:10b6:a03:212::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.21; Wed, 2 Nov 2022 12:51:58 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::7a81:a4e4:bb9c:d1de]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::7a81:a4e4:bb9c:d1de%6]) with mapi id 15.20.5769.015; Wed, 2 Nov 2022 12:51:57 +0000 Date: Wed, 2 Nov 2022 09:51:56 -0300 From: Jason Gunthorpe To: Nicolin Chen , joro@8bytes.org Subject: [GIT PULL iommu] Please pull iommu errno changes Message-ID: X-ClientProxiedBy: BL0PR01CA0027.prod.exchangelabs.com (2603:10b6:208:71::40) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|BY5PR12MB4067:EE_ X-MS-Office365-Filtering-Correlation-Id: b10d7d34-15e9-4218-36b7-08dabcd10705 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ARK3huCaEMhr5z2Ic1nE43p3WsDZXRkRM97w4iKFpBahUdzxskIKC7KMPzslZYLkHsRkL+pghhlG3T2ncrAyfMsUDybrimHVwsN2Lc8rfV/t5oy6K9dggZir51xm/JPd+fyvsu2V2SApBNRiyssS18Vm0/WMJX5RzSK0gdT9ydKe29ZTHC/qgEETFEz89ruvoeq3/Na2/+lb95JiOxaoibPKHCDJhiQiNG1rIPNymfSdxIA6ia8sC0X1sVORw/FvVtlE68ymuRtKw32ChPhNzWoSllrsP/SdS3R8kIqauYKbzkDPxMCn8eMru7xSS5X5bEObav1JXaMlNjBCKUTINWnJOHweRObMIbW3EKGKLXsVAZ9lFnsVSaquK3rFiaA/HnIaG/wlb2IBdlJTilLzWMUZiURurDukAXi5YS/ESkbDYsclIhbkzvo9mca3pJTjzJODiSZOs/2tw4LLl+ICf4dK5ff8yzCM6hx1nSagfpTPCROp7Sno7kRP7yzyjLND9Z+X2K2AsipYXQjo8NDEWoT34o+U+Bh1Pd201WUZRocdsoG5TURviw3aWcXEY50dAaHCJYFNKnBuCx9EXMUbfwFrdVXrq+XZ0OXav4iKNH6T/9LMkARF0p3m0kjwfd7eJ6DCn7foS8sbwHt9xK8LpS+vBGFcx7Q7Cpj8ikeZo8pkldfhUoe/0TzJ1Q+8uxVrbAJfZyZbQs4iVpkFFoVCKv+QeI9KBxoAxjEvFra9cVQDUuyOzSUaR1DcFyZ898rARXX9M5w2O+udIwTrrkboF4xJZ614k6d+ZsNT/vKUJvBxIPjkOJUCyW6bwaP64w5DDCA0PBlhQBk1+4sILt0rGk+epZeH3kTFePyaJ52P7fI8KsLbfFkXDBiXJETQkXoH 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:(13230022)(4636009)(376002)(366004)(396003)(346002)(39860400002)(136003)(451199015)(2616005)(26005)(44144004)(966005)(6512007)(6506007)(83380400001)(21480400003)(186003)(478600001)(2906002)(4001150100001)(316002)(66946007)(5660300002)(6486002)(8676002)(7406005)(8936002)(66556008)(7416002)(66476007)(4326008)(41300700001)(36756003)(86362001)(38100700002)(2700100001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TPZJsHVeouuiYW5XvGOo42jp9d5dkFhSoMCVJLI2Sw3LW2Kj63Y0aOV4v10dfHvfr4uLfSXL7My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kfYqDOR3tVOohL5BRkYJUiZgJgXeV2Ab7hZ3LIkrFGIb6Ls23QQy2evBjYe/NAx1M29Gf4F1QYTRpfDetfgEC3G46nOXbuEZ4wkWfaYC3hEkH4vBb0tGXhVfjSH+CPsxZmnAkjWC0+jZy6zotqHVmsUzhwHA1QKBSkht6VLsYCZhtEfYJkaJD1s7lZTcYkJPR0tvstgBd/ZbR1bu8w8JS8zOWA5xrCPr8hFf5nAYsQywY3XgAOnHhICBvsosawuRAD1F1Z8ldqj4ldboubK8beM++ex70Y4diPBGstxBsJcA7DCTTkfLfLbzvAfScMTZv6u1beE3lNs3/EC2oOcmIma4VhgWg/t/JyA6VBGAVGCp6lcfRFlEGkDHt05xZwF9bKEZVUkRgqRQIA= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b10d7d34-15e9-4218-36b7-08dabcd10705 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2022 12:51:57.9096 (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: qPIODLA6cxMKQoeY5mqiiUMadmsHrL2eYQMqaoyudGEeXLEYQWQQ8OmPBs1qg+85 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4067 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_055202_536047_D0435F0A X-CRM114-Status: GOOD ( 15.40 ) X-Spam-Score: 0.6 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Joerg, Here is a PR for a shared branch with Nicolin's series. I will be putting this in the iommufd tree right away and Alex will need it for vfio as well to progress this cycle. Please grab it to the iommu [...] Content analysis details: (0.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.101.57 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.101.57 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 1.0 FORGED_SPF_HELO No description available. -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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: , Cc: quic_saipraka@quicinc.com, yangyicong@hisilicon.com, linux-tegra@vger.kernel.org, thierry.reding@gmail.com, will@kernel.org, jean-philippe@linaro.org, zhang.lyra@gmail.com, jon@solid-run.com, jonathanh@nvidia.com, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, yangyingliang@huawei.com, orsonzhai@gmail.com, dwmw2@infradead.org, kevin.tian@intel.com, linux-arm-msm@vger.kernel.org, christophe.jaillet@wanadoo.fr, baolin.wang@linux.alibaba.com, matthias.bgg@gmail.com, tglx@linutronix.de, virtualization@lists.linux-foundation.org, yong.wu@mediatek.com, robin.murphy@arm.com, linux-kernel@vger.kernel.org, shameerali.kolothum.thodi@huawei.com, robdclark@gmail.com, suravee.suthikulpanit@amd.com, linux-mediatek@lists.infradead.org, quic_jjohnson@quicinc.com, baolu.lu@linux.intel.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org Hi Joerg, Here is a PR for a shared branch with Nicolin's series. I will be putting this in the iommufd tree right away and Alex will need it for vfio as well to progress this cycle. Please grab it to the iommu tree, thanks Jason The following changes since commit 30a0b95b1335e12efef89dd78518ed3e4a71a763: Linux 6.1-rc3 (2022-10-30 15:19:28 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git tags/for-joerg for you to fetch changes up to 04cee82e04d2aff3d177ef0021ecdff228daf7b8: iommu: Propagate return value in ->attach_dev callback functions (2022-11-01 14:39:59 -0300) ---------------------------------------------------------------- iommu: Define EINVAL as device/domain incompatibility This series is to replace the previous EMEDIUMTYPE patch in a VFIO series: https://lore.kernel.org/kvm/Yxnt9uQTmbqul5lf@8bytes.org/ The purpose is to regulate all existing ->attach_dev callback functions to use EINVAL exclusively for an incompatibility error between a device and a domain. This allows VFIO and IOMMUFD to detect such a soft error, and then try a different domain with the same device. Among all the patches, the first two are preparatory changes. And then one patch to update kdocs and another three patches for the enforcement effort. Link: https://lore.kernel.org/r/cover.1666042872.git.nicolinc@nvidia.com ---------------------------------------------------------------- Nicolin Chen (5): iommu/amd: Drop unnecessary checks in amd_iommu_attach_device() iommu: Add return value rules to attach_dev op and APIs iommu: Regulate EINVAL in ->attach_dev callback functions iommu: Use EINVAL for incompatible device/domain in ->attach_dev iommu: Propagate return value in ->attach_dev callback functions drivers/iommu/amd/iommu.c | 12 ++---------- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 11 +---------- drivers/iommu/arm/arm-smmu/arm-smmu.c | 3 --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 7 +------ drivers/iommu/fsl_pamu.c | 2 +- drivers/iommu/fsl_pamu_domain.c | 4 ++-- drivers/iommu/intel/iommu.c | 10 +++------- drivers/iommu/intel/pasid.c | 6 ++++-- drivers/iommu/iommu.c | 24 ++++++++++++++++++++++++ drivers/iommu/ipmmu-vmsa.c | 2 -- drivers/iommu/mtk_iommu.c | 4 ++-- drivers/iommu/omap-iommu.c | 6 +++--- drivers/iommu/sprd-iommu.c | 4 +--- drivers/iommu/tegra-gart.c | 2 +- drivers/iommu/virtio-iommu.c | 7 +++---- include/linux/iommu.h | 12 ++++++++++++ 16 files changed, 60 insertions(+), 56 deletions(-)