Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3776756rdb; Wed, 27 Dec 2023 22:17:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgaecTZyOQLm6J1od+D//MS9/JBNBOXak8/z+P5az94i4sZeU9fsTAdQStZkh3/EfvrgLs X-Received: by 2002:a05:6e02:15c2:b0:35f:d18d:2faa with SMTP id q2-20020a056e0215c200b0035fd18d2faamr15938889ilu.131.1703744264655; Wed, 27 Dec 2023 22:17:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703744264; cv=pass; d=google.com; s=arc-20160816; b=iNkvvDuQvN8UkLIFta3ZMVq9jW4D4qt84lkqVuwowcGFvdaxNxa7pV8ZRUUYOeecSs WT1+Qk8AqiAKlkIRl1jQdFt5urz2RE/Aswq607C20HC0SNLGUj2QSkkbVS5WmvusYhYf 12IH9fIKX6JstCxC18W0oETaAaXNfhFep8MWDTmmE5EalDlWNE63MNL2fIOn7Q+GQkzG FbWj27q6Xr6ud+K2/Fj3m6Y4SlW6/ZfcxKlqN5CpskABMM4tt1ICwTw3GebmgXhfwLoa 44cOz4WTBb8J637Us66XmMC7F8Hu8qnSdFxkkvqoFKL8H5dmHu7MO6pQIFWIGuGytJc6 hgDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :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=tvaIuiPicdDDX1oTxbtJsO9LlED7ysia8t5A/8ACsT8=; fh=gqz022jL4d9g2TLosZS0RGrGfTvk/uei2T0TdjEzKNc=; b=eKOzORrS7v4ez7A3PcFMA++UUEkArOfN0fwCBOI8+/z2rsHC+lJM9SgFtRqcUoPH2t a95/4CMHSJFcB2878iEaUQNWpXGWNA1cZbceRto89aGwnqzxpucxqJcB+QYXyKp+gcaB RNwcQzTRVZgG0ofEwHarJWBwUS72yMQL+S8YPxGpnk1IwolyU5GBz4UVklBEO5lx+jTE H4oH2fV6e95aIsuMRU2B5diMlqgoj6rSATwj8yG6dmt/Z5EkxnMpX5eGb1ZAjOcWrnpo g5dXW8BsW/2zpNnlmvy/F18Abnk5PtPI4gHvYtulpdz7qZOSIA/4mfXQdNrKvQMs7pFn xC5A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ksxBm6Fr; 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+bounces-12448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12448-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q16-20020a638c50000000b005c5e26ed226si12386431pgn.429.2023.12.27.22.17.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 22:17:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ksxBm6Fr; 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+bounces-12448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12448-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 51E90B21A83 for ; Thu, 28 Dec 2023 06:17:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CF633C0B; Thu, 28 Dec 2023 06:17:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ksxBm6Fr" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F7985380; Thu, 28 Dec 2023 06:17:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703744249; x=1735280249; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=9eMWqUZacALKBNkg9n3OclmFS9yWe5uDTxsfbYspo/E=; b=ksxBm6FrfPef35WN+bcO8Ngk1bvnvac2AecZO/daSvZgbKxJAUDLGsFH FTd8BVIJEQy1lKwjfvmXOkgav1fE6b5IKi3KsA8ocEH1EFU0fjXyTlpOr Pfw3t7kXQv2UYG6jRnyKYd+5POXeUABbjrh3FDSUDJvkZ+LvYPVMzpmcA qkZ9Ahj6pQnp8Mv6iWBU0+OXtg2ergn5s5/T4kx+fn9KkQGMewdIGCx0t TZ9dJntvdKf08R6dmapuw8KEWuMDrSz6hOg97sEgqMVn/lM6eUm0kqYYx vr5z3jHXpN7vN/zjHF/Fb3FKRtkd0leEr+ZKfhXMubjPP4mZNsYLRr7Ej g==; X-IronPort-AV: E=McAfee;i="6600,9927,10936"; a="376003395" X-IronPort-AV: E=Sophos;i="6.04,311,1695711600"; d="scan'208";a="376003395" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2023 22:17:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10936"; a="951711889" X-IronPort-AV: E=Sophos;i="6.04,311,1695711600"; d="scan'208";a="951711889" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 27 Dec 2023 22:17:27 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 27 Dec 2023 22:17:26 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 27 Dec 2023 22:17:26 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 27 Dec 2023 22:17:26 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jejsaa5YDftECkb8FNA1RxGfskvWsjXGuoWWtuPJptG8LMKrmvZY/TvUVJ7tFAcn6UvMgVFYvdlz9OdZEGjvm9o44mpmKk0mk7oRbAmGGodUwJ8E2/GXOiEG3iCpvIwNl0P3fkl4nDG8V59yfZ6yY9G+tSMNzrdzb5NYfqcjkCcscSFI1325zIQzHKJOULPxFjmS0NrkzMuxYOvvovAUIo45vNJTwcUvPFO4xfaBvS9yaQE7Oy9eaCAwgIOvH2JUkT6kfyCHJ+KLalO1EMFBnAvwj6yQxAUlo4VAqMaJAZoEDNmgl0fhWC+MXzko8asf735obmAG8E1HFeZpI5pHdA== 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=tvaIuiPicdDDX1oTxbtJsO9LlED7ysia8t5A/8ACsT8=; b=GI0uioAycxIky37kXMvUGLdB+bVDS2chbahVfmhXYcHuD1GXWiuoolsY6+MA9LrQPrs/p9sh9+jPpVpkz6Sew6Ld9zGO77rGws8zAoVPA76adXbAlw6/MrByFSFSb9tYw+Ttt7ftI04hm40S8x2xuf4qaWUS0ZumRkpJ+lNe6GwsrLxKwxpEvLmmUIgo8c10OfBa+wyDVSMjozDimP+NQJmqJq/JScz6i8clqXgRYg4n/nl6tGIMYX6q7WWz5kOw6xHZ4I6dQAERBHQ5fcOo6hKof+L5hDyn2qrruLpaC4qLKTw+KL/GHem4dtz08V34hbRj+F4vt02Mch3e0d8uXg== 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 PH0PR11MB4822.namprd11.prod.outlook.com (2603:10b6:510:39::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Thu, 28 Dec 2023 06:17:19 +0000 Received: from BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::a8e9:c80f:9484:f7cb]) by BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::a8e9:c80f:9484:f7cb%3]) with mapi id 15.20.7113.028; Thu, 28 Dec 2023 06:17:19 +0000 From: "Tian, Kevin" To: "Liu, Yi L" , "joro@8bytes.org" , "alex.williamson@redhat.com" , "jgg@nvidia.com" , "robin.murphy@arm.com" , "baolu.lu@linux.intel.com" CC: "cohuck@redhat.com" , "eric.auger@redhat.com" , "nicolinc@nvidia.com" , "kvm@vger.kernel.org" , "mjrosato@linux.ibm.com" , "chao.p.peng@linux.intel.com" , "yi.y.sun@linux.intel.com" , "peterx@redhat.com" , "jasowang@redhat.com" , "shameerali.kolothum.thodi@huawei.com" , "lulu@redhat.com" , "suravee.suthikulpanit@amd.com" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "Duan, Zhenzhong" , "joao.m.martins@oracle.com" , "Zeng, Xin" , "Zhao, Yan Y" , "j.granados@samsung.com" Subject: RE: [PATCH v8 07/10] iommu/vt-d: Allow qi_submit_sync() to return the QI faults Thread-Topic: [PATCH v8 07/10] iommu/vt-d: Allow qi_submit_sync() to return the QI faults Thread-Index: AQHaON/A5bfZH72AA02vmOQ862qYJLC+OJ2Q Date: Thu, 28 Dec 2023 06:17:19 +0000 Message-ID: References: <20231227161354.67701-1-yi.l.liu@intel.com> <20231227161354.67701-8-yi.l.liu@intel.com> In-Reply-To: <20231227161354.67701-8-yi.l.liu@intel.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_|PH0PR11MB4822:EE_ x-ms-office365-filtering-correlation-id: 26cd99ec-c628-4d57-0301-08dc076ca575 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PnHsWoYbZARPirV7JL92WQhzCFbZab3ePRq4mjNpr5JppdhGp53TdFgERTv57by7Fz6C48aHtXnpvovc5x27javvhcdKTMabFzXT3eHwKm195wj3lTD84vBTOPgwalzydR5/gqilaNxfgV6JfymfC/K/uy0SeikjD4kYdFqrR71HaywgZhwJnyLoIixsC/55ydIqaO/o1XA9PFfizHe3czLc7aQVAYcoXN7qXQbzXicFkyCwvdZo3sZ4gzudbY5pUSUnpWHG1oCk0yWGT/+l2nmYzgksVzvBN8zgguu3RseRjOlGNagD1EMswk8aXR+NCq6+7krs/xAcu3tGgC+pBo2jFPOGmXuEpLewNcb30DgpOJX97/CplRA9v+e7xPtr0Ptlp3m70jnQiuDdJD26UBvT7wFnWIIYdnPiYAMql/JacSXKI2oto4vroYFH02JeF9+07q9BFVnnxytsoUAQLiP4TMKEFJWYxMykTOaXbbRlGutVgx8M7ivg64w3PzElJKw6H+BKVvjURF1Ogu/hS+ACJTc4ZPvqJrh9tB6gbyFOIb9S82bWoCnbgZpSDGTjb3Hs+ylcVHrBqwpgpeGMz1grVhxNntDCsY7ycpBBz5J69ZGnb24f/I2Ps4jw37yJ 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:(13230031)(346002)(136003)(366004)(39860400002)(376002)(396003)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(9686003)(7696005)(83380400001)(6506007)(478600001)(71200400001)(110136005)(38100700002)(82960400001)(55016003)(122000001)(52536014)(76116006)(66946007)(66476007)(316002)(54906003)(66446008)(66556008)(64756008)(86362001)(8936002)(8676002)(26005)(4326008)(7416002)(4744005)(2906002)(5660300002)(33656002)(41300700001)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?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M1q4sC+FfkrAvmtMmyc?= =?us-ascii?Q?+q+WHQzj5rR06oBWRYvIodlgUXxQL4c+4NcFosIKzkw79CPDNahLVCzxZmU4?= =?us-ascii?Q?s1t4XRB+ZWqW6iKoVpZXsi5gYO5596yt9EVvUeRCFusdWFeZ4znP7ELeHv4r?= =?us-ascii?Q?JkBAesyDGlQ1HEClW1sUZOr6QKc6Y1TCTripFUlDfAKWizzAbFRvxsZR1uZR?= =?us-ascii?Q?oSGk0eiSOTdKe/aZnbtr5WfUlotEnZoHF3M9OXDEFs7BhnBrn/jwrNdeUdfK?= =?us-ascii?Q?1mw/COcVhBTnuno+3+KrAzwOzjkc+dtqKdSYTBqkK3mF+7TfTCOJN4a24vhw?= =?us-ascii?Q?PF/oaLArhtt2LX1gJWUdyeMCjmdKBsDyLDgtk0jdH7AOpR3Ysm2RAKgSG40X?= =?us-ascii?Q?j28N2yFewnIJiVa7UlXJMjMsnj0lswXh98h4oSCNyDBWsU3T51aFd+AlJhW2?= =?us-ascii?Q?7Amyxd+lGPGlhe/faK0lHIHmls8iZz09IWBCOSd5U0pIvR076qqNjcfHtvGV?= =?us-ascii?Q?LQqAF15maQIKpRFxnxsstrzepYuWEApBV8KBCtmcI8BxoNyGzzgJ7kkJyq43?= =?us-ascii?Q?3QcW6xNPxd2LwC8ANP30q8+gSKRwdKmOvOihp3by24z1PeMNwBr4o5BtntEh?= =?us-ascii?Q?IrVl0TDgAy0TzfcuvpAl9XMJcVRCgCPwejefpG+bAjne28AcFkjSSzNwnriY?= =?us-ascii?Q?LeFniNge5RDF2nRw6TUE/I9iAcNoKguq/uMKyuMp?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: 26cd99ec-c628-4d57-0301-08dc076ca575 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Dec 2023 06:17:19.3046 (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: RLi0KA4hZtPjA4GioFSQIPWhEtk1fAKDLAExT8/WYb/ghg+MZCQaqJvUaCigW3/pidrYpddlwK2VkS8pEXdJLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4822 X-OriginatorOrg: intel.com > From: Liu, Yi L > Sent: Thursday, December 28, 2023 12:14 AM >=20 > @@ -1376,6 +1383,8 @@ int qi_submit_sync(struct intel_iommu *iommu, > struct qi_desc *desc, >=20 > restart: > rc =3D 0; > + if (fault) > + *fault =3D 0; move it to right before the loop of qi_check_fault() >=20 > raw_spin_lock_irqsave(&qi->q_lock, flags); > /* > @@ -1430,7 +1439,7 @@ int qi_submit_sync(struct intel_iommu *iommu, > struct qi_desc *desc, > * a deadlock where the interrupt context can wait > indefinitely > * for free slots in the queue. > */ > - rc =3D qi_check_fault(iommu, index, wait_index); > + rc =3D qi_check_fault(iommu, index, wait_index, fault); > if (rc) > break; and as replied in another thread let's change qi_check_fault to return -ETIMEDOUT to break the restart loop when fault pointer is valid.