Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp466324rwb; Thu, 22 Sep 2022 02:03:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7z2jqbovz+fcRwMuXVEzZK5tv1Ovvkl5QKZSQTz3kMB1wkVQwWn7BFNWd4Ih4ugMHuxdp4 X-Received: by 2002:a05:6a00:1691:b0:53b:3f2c:3257 with SMTP id k17-20020a056a00169100b0053b3f2c3257mr2404968pfc.21.1663837412540; Thu, 22 Sep 2022 02:03:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663837412; cv=pass; d=google.com; s=arc-20160816; b=uTFdmxzFZdryygkrxNkgLha6NttaXO6eebR+6P0Yd5tXBL1f+HXskL6NZRkLUSoeh6 4YYc5F/W41Xn10ZGsj6H6/srhZvRo/mtsiDnA/b7alz0r7ehtoaerhuQYoPX2CQ6Ngst x6+tpS7ku2xkSdO/IYMyMxuyOTqGLb5GEWoGKPZKF3FH2ZfqDYj/nwfNhMPcYv4KsL2Y k2wVZ++LiHRNua6qczDcv27mkQR0zmJSbu3/uDhuIobD0WNnsZYRo4LDUHg3TLYDFaCK Z/QerojsXA8+CN/adwTnf5hJUU83D5KSCSqrQy2ypI0hcljQqRwwtmIY8wCG3rjiTtpj /OqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=S3u/09poMiomIFJqBgzZZLr29xwbQaKyKYW9lcvjS68=; b=P8/D/Ieb53PVXmAz5dM6jz+o5+SFI6kbL42Kpvnl89HpRa/nvIdDNhoGQkArAERJCV n27TYnwIF9+VUMRpDYPXlNk+P42MYfiCrHcYGWwQ6o7E8xAfjAjcqLPABp9/oqfzEu22 FbUYQ0eFpmljWuH2H4hmlE6Eb36KKZeQIf3YwyaZTE/i76Hs+7jkb2osZmh1YGueSS32 6xYN/Gka+4+i+VwAXJOpecQJG77m+hwo8oBxRJEyAjshkJnzGaOBJz5Iem+BL7nfMnh1 HnvHR0pCgDB6INu1CMb0sMEPkvYQsZmk0B1pyuC4m08H31TEPYWQ9pXMWB1jL1VJBLNo ZmOg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jACQkT8l; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 80-20020a630653000000b004343046d7c4si5834103pgg.184.2022.09.22.02.03.20; Thu, 22 Sep 2022 02:03:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jACQkT8l; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229862AbiIVIUa (ORCPT + 99 others); Thu, 22 Sep 2022 04:20:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbiIVIUZ (ORCPT ); Thu, 22 Sep 2022 04:20:25 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51E0A901BF; Thu, 22 Sep 2022 01:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663834822; x=1695370822; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=S3u/09poMiomIFJqBgzZZLr29xwbQaKyKYW9lcvjS68=; b=jACQkT8lG7uJQELpowxVSqxslUK7I7Oge2MDVW9/7EafRD5+SY84smCP 6umcMaZL3ziHEAsRyZi8bR+aqdvnt8DyBDg9YjR+w0FZ37QW3aaxag5Vj KymjtAZ1cr6jnkchyyd7De9PZ5dMdNbNXI8LVpETSd7E117AZE7satZh7 jjhVDMWYgv+1OGvmJS8d69urjcfNnDzN/IRKiAmD+CXtrgicZKHUNovyA ti+EX/oCIAhgTsrBzzlp7q5wWUaZZAY+egE6RLoOhaTSjDw2nl7bnHwrq KBSAVGRC2J24jqx2m/0dZJ1iXmMWGLQZTo92a8/mj8Mz3kBU8ijXzH32R g==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="386524191" X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="386524191" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 01:20:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="682121528" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga008.fm.intel.com with ESMTP; 22 Sep 2022 01:20:20 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 01:20:20 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 01:20:19 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 22 Sep 2022 01:20:19 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 22 Sep 2022 01:19:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HeKj+noo5YaLLuSBplBL+zZeBNhYd9ZyTWWYJQT9piGtREBN2Xp5jNp73FwbJfhH2hMO47qf1wz2lhvT/ovd9OjU2mdCn3Mm6PNDD0oov11caghg6S0j7MxjMvdv242YluYni6u6JclKeHPr6lF2EMQAM3u4NdSqjgYZNpWzjI/w4q08Nv+Y8gInO71RIIVThPiMhOJTUAGZHnOqFA/54/qtqzlNwddleiFOatatF+B3hOEp7RFnt8TX2VPHaicrxYB7dipGEBlYBgOF1ZYqWd3jqxPFxYHkURcbxtZuP0rKVMh8PUMQ8cv4TMj3plTMdp+ZB89aFAeBINokZiXFhQ== 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=S3u/09poMiomIFJqBgzZZLr29xwbQaKyKYW9lcvjS68=; b=FbLLgJewlpR9xaDd6ockENjtkalWeklhyRgq+lwf5IAEknQTaQXp76WNE6mg5O+Xe77MlgoKDIn7TtBSzSdcO3mlXcNpfIIZiL41QvAohMPGDrxzOKao1DDxApdpU9TZcp5y8CGkF3GjcWA/kX2+v2Ryp/tW/6S3pGtfnmV0/r2Y4mZCs2d87XdT6dZXSghib7crOobt85o0ANwMJsCsuPzqr3JKPylVizTXUGxvVza/w4gTF8/UnYuJ+mMeqJE4HUJqAnE5NZt0XT0cWT+evqSTCGP6S/hkugd3i2YvPw9ocbihEbsNkOv/XhnfyBRY9gjBLppxWpDdpQ+4NpSU6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BN9PR11MB5276.namprd11.prod.outlook.com (2603:10b6:408:135::18) by DS7PR11MB5989.namprd11.prod.outlook.com (2603:10b6:8:70::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Thu, 22 Sep 2022 08:19:36 +0000 Received: from BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::a435:3eff:aa83:73d7]) by BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::a435:3eff:aa83:73d7%6]) with mapi id 15.20.5654.016; Thu, 22 Sep 2022 08:19:30 +0000 From: "Tian, Kevin" To: Nicolin Chen , "joro@8bytes.org" , "suravee.suthikulpanit@amd.com" , "will@kernel.org" , "robin.murphy@arm.com" , "robdclark@gmail.com" , "dwmw2@infradead.org" , "baolu.lu@linux.intel.com" , "agross@kernel.org" , "bjorn.andersson@linaro.org" , "matthias.bgg@gmail.com" , "orsonzhai@gmail.com" , "baolin.wang@linux.alibaba.com" , "zhang.lyra@gmail.com" , "jean-philippe@linaro.org" , "sricharan@codeaurora.org" CC: "jgg@nvidia.com" , "konrad.dybcio@somainline.org" , "yong.wu@mediatek.com" , "thierry.reding@gmail.com" , "vdumpa@nvidia.com" , "jonathanh@nvidia.com" , "tglx@linutronix.de" , "shameerali.kolothum.thodi@huawei.com" , "christophe.jaillet@wanadoo.fr" , "thunder.leizhen@huawei.com" , "quic_saipraka@quicinc.com" , "jon@solid-run.com" , "yangyingliang@huawei.com" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-arm-msm@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "linux-tegra@vger.kernel.org" , "virtualization@lists.linux-foundation.org" Subject: RE: [PATCH v4 5/6] iommu: Use EINVAL for incompatible device/domain in ->attach_dev Thread-Topic: [PATCH v4 5/6] iommu: Use EINVAL for incompatible device/domain in ->attach_dev Thread-Index: AQHYzZOD/Ler6ztw7EubDf/Yvg0l3q3rHNbg Date: Thu, 22 Sep 2022 08:19:30 +0000 Message-ID: References: <4469b88b4460fc230b8c394f806c134e627aa5bd.1663744983.git.nicolinc@nvidia.com> In-Reply-To: <4469b88b4460fc230b8c394f806c134e627aa5bd.1663744983.git.nicolinc@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR11MB5276:EE_|DS7PR11MB5989:EE_ x-ms-office365-filtering-correlation-id: 0fb55d55-91fe-410c-9754-08da9c732c7f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P8iQ57BMCD8p9syPDb4eY/1ZAOvsjkKUvsqgwj13M0pOz9gULCEOwZ0cYCfwztowl0ZuKI1UPXnahY2yMwFzb7DB7Fyh/AtcwDQBEKTtrO8T2bEdvE+1CUykUgfwxyPZPsqG3pDJdtI+HxOn1Rm5Zd76pkUH1RerlJT1+EqFBTxL2pxBMSDXPWmXA3LxV7ncMgOscjokTHYlzoHH+TJrlAMOJCRf477sTm+t9LtuRzGJrQIrDPY4vDqXEbIwQj+wp4QS5p4dvLuqOJITojF0kXUzOBil09+4oLm22ujVtWcJaoXe48qfKg1D0EGj7K9nPEwU8MzPzYg1HbdTnkQrRmFpE1+G+tjXPi27i63ym66muR/Ko0+cflW49QfhdeaYnGngH3BAeihPUbibM4MHO0DLBxwjaUm2vZ1yzdPu5kEzlpN4ojFfMxhyFYNxAZ9JcT2acL76g63XuuTVT9okl8EfPpQdTIkscf8ups0MPm1PSy3QSuArgVmnf9MH/lPQ0Bs+A8IQMV1Bt8QFIjK27syA+qT8dB2dss6VcnxU7WuaAcoFoxvSFJZByw71ocQmyuj/vtdeV0KzkI55/fIC/yyF1fk7kLo9WsstbmYwzvrsBxCJb8KILY0Ial/zIdrpDpSIv7LUkoi0Cn69LRJ4h5DaBqcWvxT9H43wzYNcx0cub7ZR8MQ04i5dHZLLRMhMyD1zwh8eL8OrHPVl5XLD01TL301ucmd3zZolnoIsKOsfRFDFe0F2X5HK/mUFBZsx/D4pJ14V0A/okG784thzzQBD600bDa67oMo7vka9Raw= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5276.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(376002)(366004)(346002)(39860400002)(451199015)(8676002)(66476007)(76116006)(66446008)(66556008)(122000001)(82960400001)(4744005)(921005)(110136005)(54906003)(55016003)(5660300002)(8936002)(7406005)(66946007)(64756008)(7416002)(316002)(52536014)(4326008)(33656002)(86362001)(186003)(83380400001)(38070700005)(478600001)(71200400001)(26005)(41300700001)(2906002)(7696005)(6506007)(38100700002)(9686003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?RW+AfZ6WdTfer7LRy95rdRBplZ7TS4KTB6zlWmB5ieyST3jFaf9cqL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IySmeOJ/A6m27tgsp6+MmxmOAX/uwqcsBaA?= =?us-ascii?Q?AH1intK1IHjLNOiJcBllJCFKnaXIU7pv8To1uTMM1ZarokAfd7jU24tu2vft?= =?us-ascii?Q?lDMiB/fjMz3fN6rG5GWCbmuypWWmfgLzgKRHZccMbqgQ5j8sGd6Ml/sDRpHo?= =?us-ascii?Q?ZPb8seT5VinwE7OQJFA0yA5HfohtByiaEHaJ255PghuhQv39nv32v3i6z9uD?= =?us-ascii?Q?Ui7+QfTTzfwwF1OXy7E0jYMXmG0J6un5K1ts+ha4wAsuYOYtVu/K3RfC5FKY?= =?us-ascii?Q?xcz0hvsbD69IUJP6bjj+pO0HzCPfdmIJQnOiQC/2r4thkQxulQr/+Qup30ug?= =?us-ascii?Q?iHFtqqx4DuC4UOSp/173Azii0S37EwNcCsATn1SmgB7FsjmsACYTqvQMB5F9?= =?us-ascii?Q?DXUC71v/nMhxcuzpdi/bLOjGjRCxMXwD6RomQeYRK5ZG2FKPJTu79f8lmMZm?= =?us-ascii?Q?7qQO+cah75SK3vUM16gS5tNVZD+o1jaKVy2xbUFHie5PGO9vj/mmXJgNlMVl?= =?us-ascii?Q?dC7BQGyabUNaAQmmu4qTX9Y7CPrENRp6KfIiOKmHSRAK7sb0NYziA7cX59iV?= =?us-ascii?Q?6sotzV2GeyJKK8VaawwkHHjhfJ4QdWAko1fuUeKpUOLpLt+l7vlwQCzB18Ry?= =?us-ascii?Q?j5TzkcVuWa14TRtcEcdpI/FFRJJi24k57/tZovqt?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5276.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fb55d55-91fe-410c-9754-08da9c732c7f X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2022 08:19:30.7765 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: L/M0lAK7mwtI9trxHr6KUYxPOawYvdDBE2TKEdiaBOS2lQTNQxYxXMne4OzM2ryMaL7de9pwWqfoY/1lJE7E6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB5989 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Nicolin Chen > Sent: Wednesday, September 21, 2022 4:24 PM >=20 > Following the new rules in include/linux/iommu.h kdocs, update all driver= s > ->attach_dev callback functions to return EINVAL in the failure paths tha= t > are related to domain incompatibility. >=20 > Also, drop adjacent error prints to prevent a kernel log spam. >=20 > Signed-off-by: Nicolin Chen Reviewed-by: Kevin Tian