From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2178DA0524; Sat, 7 Nov 2020 10:58:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 907ED2C2E; Sat, 7 Nov 2020 10:58:11 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 47E1FF64 for ; Sat, 7 Nov 2020 10:58:09 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id E24665C0143; Sat, 7 Nov 2020 04:58:08 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 07 Nov 2020 04:58:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= 3NLUllVCfKZOtG4/ScEqiGa+U6QAOxkEUkiA/gQHf6k=; b=T2Cz9+8bvqRKV4Py iP+KR9B/fbG/8l8CTMaaGCu2dVN0zwXoHVHiyXXUq5kXg3MtB9XhUDSzRWc4qJtp TJKiwWIV8DEgqXBjnYpSFqig1OqfWrnRACI41rXntaYSWkG+9RJhJcijA8VVNYy0 Fjr4Mp2BTuRHRBoXFW+2+x4LqsDfrP1HCQ+yq5BKp4M3aaKMeS1JEX4DgYPh5Z4H c93FUtCwmrMS3wT6i0khaZc3IFDt1ZsdEL0M2cUd0coMc6WoDbXV/SjpuSCc0K8k E5DDtt6EDZfMb25VfAZXCkkYxhoA29BraA4zjydHi8ro7OCmpnG4CRqZRPHdYFDf pQEJbg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=3NLUllVCfKZOtG4/ScEqiGa+U6QAOxkEUkiA/gQHf 6k=; b=Gi/CcpzD3zS2emlOEyAwTEZvYM5Dg2a+YkR/ZTXxqt5ddmGbqpx6yBdQt RBZMe+sok9SW7tC7YN4xw6Vj5bDkEX0Dq1oW9HxZr29MWkRjpzDgJ3aouRhQFPoE jz347YkKCbVv0c1fQfITguHgFSnuz6G2NpghwuwjOvoTddgWItp6yJftcERU88zk TGDe4QolL348k8mtb+w9Zqh2ANEb0W3GKZeb3TGWYT/efBG4BCT1LA9SJC8Xx3jb 1vMb8v/PxwJUd9+49W5Ma2DMVkTc7hRevPDERM+p49Vk+qp5ahRNoBcMbPa1RqHE /o4EEQJz+78D/cpgg1uZtJ3errfBA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudduuddgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkjghfggfgtgesthhqre dttddtjeenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpeekvdehgeduhffhleeutd ejkeduveefhfevveekffevgeekieetfeehjeehffekjeenucffohhmrghinhepthhrrghv ihhsqdgtihdrtghomhdpsghoohhtlhhinhdrtghomhdplhhkmhhlrdhorhhgnecukfhppe ejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C2DB032803D4; Sat, 7 Nov 2020 04:58:07 -0500 (EST) From: Thomas Monjalon To: David Christensen Cc: dev@dpdk.org, anatoly.burakov@intel.com, david.marchand@redhat.com Date: Sat, 07 Nov 2020 10:58:06 +0100 Message-ID: <3249543.eK2paozH6B@thomas> In-Reply-To: References: <20201015172305.105717-1-drc@linux.vnet.ibm.com> <4279961.Ez0r9NPIs3@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v5 1/1] vfio: modify spapr iommu support to use static window sizing 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 06/11/2020 23:16, David Christensen: > On 11/4/20 11:12 PM, Thomas Monjalon wrote: > > 04/11/2020 23:25, David Christensen: > >> On 11/4/20 1:02 PM, Thomas Monjalon wrote: > >>> 04/11/2020 22:00, David Christensen: > >>>> On 11/4/20 11:43 AM, Thomas Monjalon wrote: > >>>>>> Signed-off-by: David Christensen > >>>>>> Acked-by: Anatoly Burakov > >>>>>> --- > >>>>>> -#ifdef VFIO_IOMMU_SPAPR_INFO_DDW > >>>>>> - /* try possible page_shift and levels for workaround */ > >>>>>> + /* if at first we don't succeed, try more levels */ > >>>>>> uint32_t levels; > >>>>>> =20 > >>>>>> - for (levels =3D create->levels + 1; > >>>>>> + for (levels =3D create.levels + 1; > >>>>>> ret && levels <=3D info.ddw.levels; levels++) { > >>>>> > >>>>> There is a compilation failure with ppc64le-power8-linux-gcc: > >>>>> error: =E2=80=98struct vfio_iommu_spapr_tce_info=E2=80=99 has no me= mber named =E2=80=98ddw=E2=80=99 > >>>> > >>>> How did you find that error? It builds locally for me on a POWER sy= stem > >>>> with Meson/gcc and there were no build failures on Travis > >>>> (https://travis-ci.com/github/drchristensen/dpdk/builds/198047029) w= hen > >>>> I checked it against AMD64/ARM systems. The code is PPC specific bu= t it > >>>> will build on all architectures (there are no IFDEFs around it). > >>> > >>> Remember, I cross-build with test-meson-builds.sh > >>> Is it an issue of my toolchain? > >> > >> What distro/gcc version are you using? I'll try it locally on an x86. > >=20 > > I am using powerpc64le-power8--glibc--stable-2018.11-1 from > > https://toolchains.bootlin.com/releases_powerpc64le-power8.html >=20 > Here's what I found: >=20 > - Builds correctly on a RHEL 8.2 POWER9 host with gcc (GCC) 8.3.1=20 > 20191121 (Red Hat 8.3.1-5) and kernel 4.18.0 > - Builds correctly on an Ubuntu 18.04.5 POWER9 host with gcc (Ubuntu=20 > 7.5.0-3ubuntu1~18.04) 7.5.0 and kernel 4.15.0. > - Build fails on an Ubuntu 18.04.5 AMD64 host with your POWER8 toolchain= =20 > and the devtools/test-meson-builds.sh script. >=20 > It appears that the VFIO header file in your toolchain: >=20 > powerpc64le-buildroot-linux-gnu/sysroot/usr/include/linux/vfio.h >=20 > is from the 4.1.49 kernel, but the sPAPR v2 IOMMU support wasn't added=20 > until the 4.2.0 kernel (https://lkml.org/lkml/2015/4/25/56). The update= =20 > added the ddw member to the vfio_iommu_spapr_tce_info structure. I'll=20 > submit a new patch which skips testing additional levels unless kernel=20 > 4.2.0 or later is used. Instead of testing kernel version, which is fragile with backports, can you test the presence of the feature itself? If no macro (usable with #ifdef) is defined with the feature, checking the kernel version is acceptable.