From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id EA35F1B616 for ; Tue, 7 Nov 2017 10:06:05 +0100 (CET) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA794x8j048683 for ; Tue, 7 Nov 2017 04:06:05 -0500 Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [192.155.248.90]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e377yqsqe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Nov 2017 04:06:04 -0500 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Tue, 7 Nov 2017 09:06:03 -0000 Received: from us1a3-smtp06.a3.dal06.isc4sb.com (10.146.103.243) by smtp.notes.na.collabserv.com (10.106.227.141) with smtp.notes.na.collabserv.com ESMTP; Tue, 7 Nov 2017 09:05:58 -0000 Received: from us1a3-mail173.a3.dal06.isc4sb.com ([10.146.71.126]) by us1a3-smtp06.a3.dal06.isc4sb.com with ESMTP id 2017110709055762-244946 ; Tue, 7 Nov 2017 09:05:57 +0000 MIME-Version: 1.0 In-Reply-To: <3884119.bRk7rexRDt@xps> To: Thomas Monjalon Cc: anatoly.burakov@intel.com, dev@dpdk.org From: "Jonas Pfefferle1" Date: Tue, 7 Nov 2017 10:05:56 +0100 References: <1509465586-7436-1-git-send-email-jpf@zurich.ibm.com> <3884119.bRk7rexRDt@xps> X-KeepSent: 16C3B3D8:330B4ED7-C12581D1:00302F92; type=4; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1 October 14, 2013 X-LLNOutbound: False X-Disclaimed: 37951 X-TNEFEvaluated: 1 x-cbid: 17110709-9717-0000-0000-00000490534F X-IBM-SpamModules-Scores: BY=0; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.417846; ST=0; TS=0; UL=0; ISC=; MB=0.000005 X-IBM-SpamModules-Versions: BY=3.00008024; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00942345; UDB=6.00475346; IPR=6.00722633; BA=6.00005675; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017892; XFM=3.00000015; UTC=2017-11-07 09:06:02 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2017-11-07 07:27:57 - 6.00007576 x-cbparentid: 17110709-9718-0000-0000-000095D567CF Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-07_03:, , signatures=0 X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2] vfio: noiommu check error handling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 09:06:06 -0000 Thomas Monjalon wrote on 11/06/2017 09:25:15 PM: > From: Thomas Monjalon > To: Jonas Pfefferle , anatoly.burakov@intel.com > Cc: dev@dpdk.org > Date: 11/06/2017 09:55 PM > Subject: Re: [dpdk-dev] [PATCH v2] vfio: noiommu check error handling > > 31/10/2017 16:59, Jonas Pfefferle: > > Check and report errors on open/read in noiommu check. > > > > Signed-off-by: Jonas Pfefferle > > I cannot decide to apply this patch as it does not explain what > it is fixing, and as it is not reviewed. > This patch adds error handling and logging to the noiommu check. Also, on older kernels when the noiommu=5Fenable file does not exist it assumes noiommu is not enabled instead of returning -1. Note that in rte=5Fpci=5Fget=5Fiommu=5Fclass (drivers/bus/pci/linux/pci.c) is the only usage of the function and it assumes return =3D=3D 1: noiommu is enabled any other return value noiommu disabled, i.e. my code change does not change the behavior of this function. We might want to check for errors in rte=5Fpci=5Fget=5Fiommu=5Fclass as well since assuming it is not enabled when we cannot open and read it might lead to iova =3D=3D VA being used even if noiommu is enabled. All this comes back to what I proposed before: instead of the noiommu and PPC64 check we should decide which iova mode to use depending on the iommu types available. The type should be already available at the point where we decide on the iova type. (iommu types supported is checked by vfio=5Fget=5Fcontainer=5Ffd)