From owner-freebsd-current@freebsd.org Sun Jul 22 17:16:08 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C28C31050C4E for ; Sun, 22 Jul 2018 17:16:07 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 55DDE7C713 for ; Sun, 22 Jul 2018 17:16:07 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 1241B1050C4C; Sun, 22 Jul 2018 17:16:07 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DED441050C4B for ; Sun, 22 Jul 2018 17:16:06 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E6C17C711; Sun, 22 Jul 2018 17:16:06 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-wr1-x432.google.com with SMTP id q10-v6so15644618wrd.4; Sun, 22 Jul 2018 10:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=bCiQec/p5KRwj7fnFA2nLkoNjjspaSRswlNOkvKdozg=; b=f4KgF10tv7L8G2PSAK/MWRBlan+lxjHcopkNWq2GTiqk2S2rOF/NlQEW9dX1a5mNM9 5fmAoY464qmodEhs3aR/RvEPG6eoMffpzJpxpf3DQ8pcJECzzJoDmQh7Ms80sdQN/rsl hHP4YIZIrVlSGXiWW8GHQJE4frBlwJnDUBjc3Sn0aTfJ0/ICLLaR3bILbefvaq+Z4lcP LL7e7r1bYePmDNO5M5cjQfV1lGjwIZlEAYDTHxyvCgP1C69MkL6xXX+igp32+diRwvS/ gwMq+ZExVYnuuvVxflWhGPAlYWYiHiizt/vvrbOgAgSTau0FvfWDinsSxcj9XVvEAIPx EuqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=bCiQec/p5KRwj7fnFA2nLkoNjjspaSRswlNOkvKdozg=; b=NDqglsYlh0kV6D3kMBPeuNQ2XaSptaHd2qciJrJbSOZUIlR1aUXeP5Ow4DRZbTlyPk RKaEYKB5VVfm/iIms9Xd2RXUN0ZYw1mgD0VCjwjfrq5L2uti8QEO0k2XdIqxI5mWQ9Uj zNByylvr9YMLJ1FXrAJWdGgqzN2a65KhO6y/TA6zO1YyP4QKWndTIvEUMdPGo2VMiQMF 46uDBtwohe66abUtr7wA6y65mTML4JhcUPiBTxLbww0NGmZHlC4h4VhfLcF5KYL1HL/u Dg0it4yf1+s1ObN2MC3tWqlPd3JHh84SOZ5jef7vZ6J+j0mmYfZBINlqUoZTRDHRsMg2 /qOg== X-Gm-Message-State: AOUpUlHCHdEAfhUZYqaZd/ic2qFje3RF6gUoMuB0Z29I5s135umNEOjr 4f6tXKbEoEiKZZZtWG71MMCN/09/ X-Google-Smtp-Source: AAOMgpePIo/xhBbxwJ5NMyLG5w7iTAnZwDFPTtwic1/pkk1g6DaLgu4CVZyyERtqeDisdAfQPdkWVQ== X-Received: by 2002:adf:ac2d:: with SMTP id v42-v6mr6447376wrc.142.1532279765246; Sun, 22 Jul 2018 10:16:05 -0700 (PDT) Received: from x1c.lwhsu.org (global-5-184.nat-2.net.cam.ac.uk. [131.111.5.184]) by smtp.gmail.com with ESMTPSA id 79-v6sm12331046wmf.5.2018.07.22.10.16.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jul 2018 10:16:04 -0700 (PDT) Sender: Li-Wen Hsu Date: Sun, 22 Jul 2018 18:16:02 +0100 From: Li-Wen Hsu To: Konstantin Belousov Cc: current@freebsd.org, br@freebsd.org Subject: Re: FreeBSD-head-riscv64-build - Build #9623 (r336573) - Failure Message-ID: <20180722171601.GA25771@x1c.lwhsu.org> References: <941706773.1.1532139392496.JavaMail.jenkins@jenkins.ci.freebsd.org> <20180721231832.GC65334@kib.kiev.ua> <20180722010116.GA13419@freefall.freebsd.org> <20180722154505.GE65334@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CE+1k2dSO48ffgeK" Content-Disposition: inline In-Reply-To: <20180722154505.GE65334@kib.kiev.ua> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2018 17:16:08 -0000 --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 22, 2018 at 18:45:05 +0300, Konstantin Belousov wrote: > On Sun, Jul 22, 2018 at 01:01:16AM +0000, Li-Wen Hsu wrote: > > On Sun, Jul 22, 2018 at 02:18:32 +0300, Konstantin Belousov wrote: > > > On Sat, Jul 21, 2018 at 02:16:17AM +0000, jenkins-admin@FreeBSD.org w= rote: > > > > --- lib/ofed/libmlx5__L --- > > > > In file included from /workspace/src/contrib/ofed/libmlx5/mlx5.h:44= :0, > > > > from /workspace/src/contrib/ofed/libmlx5/buf.c:42: > > > > /workspace/obj/workspace/src/riscv.riscv64/tmp/usr/include/infiniba= nd/udma_barrier.h:108:2: error: #error No architecture specific memory barr= ier defines found! > > > > #error No architecture specific memory barrier defines found! > > > > ^~~~~ > > >=20 > > > The patch below should be enough to fix the build, modulo the syntax > > > errors which I cannot check. The reason is that it seems riscv is not > > > cross-buildable from stable/11 host: > > > --- includes_subdir_include/rpcsvc --- > > > RPCGEN_CPP=3Dcpp\ -target\ riscv64-unknown-freebsd12.0\ --sysroot=3D/= usr/home/konstantinb/build/bsd/DEV/obj/usr/home/konstantinb/build/bsd/DEV/s= rc/riscv.riscv64/tmp\ -B/usr/local rpcgen -C -h -DWANT_NFS3 /usr/home/konst= antinb/build/bsd/DEV/src/include/rpcsvc/klm_prot.x -o klm_prot.h > > > --- key_prot.h --- > > > error: unknown target triple 'riscv64-unknown-freebsd12.0', please us= e -triple or -arch > > > *** [key_prot.h] Error code 1 > > >=20 > > > make[4]: stopped in /usr/home/konstantinb/build/bsd/DEV/src/include/r= pcsvc > > >=20 > > > So if somebody who care about riscv and can build the world could > > > confirm the fix, I will commit it. > > >=20 > > > diff --git a/contrib/ofed/include/udma_barrier.h b/contrib/ofed/inclu= de/udma_barrier.h > > > index 71d264f8dce..6709d4433a7 100644 > > > --- a/contrib/ofed/include/udma_barrier.h > > > +++ b/contrib/ofed/include/udma_barrier.h > > > @@ -104,6 +104,10 @@ > > > #include > > > #include > > > #define udma_to_device_barrier() dmb() > > > +#elif defined(__riscv__) > > > +#include > > > +#include > > > +#define udma_to_device_barrier() fence() > > > #else > > > #error No architecture specific memory barrier defines found! > > > #endif > >=20 > > Thanks for looking into this. Attached patch is slightly modified. > > RISC-V is using __riscv and there are few more atomic macros need to be > > defined. > Well, the arch(7) manpage documents __riscv__. Compilers typically > provide both __XXX__ and __XXX, while FreeBSD traditionally uses > the __XXX__ form. Please check r322168, __riscv__ is replaced by __riscv and __riscv64 is replaced by (__riscv && __riscv_xlen =3D=3D 64). Details are in the commit message. Alghough I grep'd sys/ and there are some __riscv__ still existing: sys/vm/vm_unix.c:72:#if !defined(__aarch64__) && !defined(__riscv__) sys/vm/vm_unix.c:81:#else /* defined(__aarch64__) || defined(__riscv__) */ sys/vm/vm_unix.c:83:#endif /* defined(__aarch64__) || defined(__riscv__) */ I guess those also need changing, as well as arch(7) > With that change, I think that your patch should go in regardless of > the second issue below. Thanks, please commit or approve it. > >=20 > > However this seems not enough, there are some c++ errors which may take > > longer to fix: > >=20 > > In file included from /usr/home/lwhsu/freebsd-src/contrib/ofed/librdmac= m/cma.h:43:0, > > from /usr/home/lwhsu/freebsd-src/contrib/ofed/librdmac= m/acm.c:42: > > /usr/home/lwhsu/freebsd-src/contrib/ofed/librdmacm/cma.h: In function '= fastlock_init': > > /usr/home/lwhsu/freebsd-src/contrib/ofed/librdmacm/cma.h:60:2: error: i= nvalid initializer > > atomic_store(&lock->cnt, 0); > > ^ > > In file included from /usr/home/lwhsu/freebsd-src/contrib/ofed/librdmac= m/acm.c:42:0: > > /usr/home/lwhsu/freebsd-src/contrib/ofed/librdmacm/cma.h: In function '= fastlock_acquire': > > /usr/home/lwhsu/freebsd-src/contrib/ofed/librdmacm/cma.h:68:2: error: o= perand type 'struct *' is incompatible with argument 1 of '__at= omic_fetch_add' > > if (atomic_fetch_add(&lock->cnt, 1) > 0) > > ^~ > > /usr/home/lwhsu/freebsd-src/contrib/ofed/librdmacm/cma.h: In function '= fastlock_release': > > /usr/home/lwhsu/freebsd-src/contrib/ofed/librdmacm/cma.h:73:2: error: o= perand type 'struct *' is incompatible with argument 1 of '__at= omic_fetch_sub' > > if (atomic_fetch_sub(&lock->cnt, 1) > 1) > > ^~ > > *** [acm.o] Error code 1 > >=20 > > make[6]: stopped in /usr/home/lwhsu/freebsd-src/lib/ofed/librdmacm > I will look at this later, but it seems that linuxkpi is not ported. > I will disable OFED on RISC-V. Thanks, I think this is the right way to go for now. > >=20 > >=20 > > BTW, stable/11 should be fine to cross-build riscv64, this job uses > > 11.2-RELEASE and riscv64-xtoolchain-gcc package, with > > CROSS_TOOLCHAIN=3Driscv64-gcc defined. > >=20 > >=20 > > Best, > > Li-Wen > >=20 > > --=20 > > Li-Wen Hsu > > https://lwhsu.org >=20 > > Index: contrib/ofed/include/udma_barrier.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- contrib/ofed/include/udma_barrier.h (revision 336593) > > +++ contrib/ofed/include/udma_barrier.h (working copy) > > @@ -104,6 +104,10 @@ > > #include > > #include > > #define udma_to_device_barrier() dmb() > > +#elif defined(__riscv) > > +#include > > +#include > > +#define udma_to_device_barrier() fence() > > #else > > #error No architecture specific memory barrier defines found! > > #endif > > @@ -140,6 +144,8 @@ > > #define udma_from_device_barrier() mips_sync() > > #elif defined(__arm__) > > #define udma_from_device_barrier() dmb() > > +#elif defined(__riscv) > > +#define udma_from_device_barrier() fence() > > #else > > #error No architecture specific memory barrier defines found! > > #endif > > @@ -208,6 +214,8 @@ > > #define mmio_flush_writes() mips_sync() > > #elif defined(__arm__) > > #define mmio_flush_writes() dmb() > > +#elif defined(__riscv) > > +#define mmio_flush_writes() fence() > > #else > > #error No architecture specific memory barrier defines found! > > #endif >=20 --CE+1k2dSO48ffgeK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEwJe+rporMbugMm8ojXvMfQEv034FAltUu8dfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEMw OTdCRUFFOUEyQjMxQkJBMDMyNkYyODhEN0JDQzdEMDEyRkQzN0UACgkQjXvMfQEv 036WmBAA0OxxqHdhAYucJsDcVcACWp2bCshSWZbr3MFTg6YUfJiNp9yH4wyS5BME e/DzVnQpm1CRJ+ohv6dP8Lsrse0VZmhUQ3fQlAUGE10ecFuurT75DyJLHWkTC919 f2Ka3bwHsB0g8f7eiqCjiO4j3+0IGQEdnqmo7AiAFhQXHKfWSOJSE5X5Bbns/C9/ ZJVs5W+jgrtFWwTyfIEuC0U0Kykl4LBa3Qby0HKyesP3ulAEUwN7Pm8QCyGYn7Kk NewDzYe7wy4LAnUoh0qklo+U2aFpde7j2uXWWLhw0nEuTbvGTumhz2A9kFHTgfCv W7YRFGu2gx1ydnzH0YMonDkOiIp5ZdKrko0jvoDiKgvCnDgy3eiPfHtU7eNNP0oV 1MDxF5yh1fZ4zYhFhXwssAgK2cmMdLebMn8C7L659zcgZquLu44TQRJTx6uQwVB/ snPqGoN1vKDHzlzFf5ActYtlVG5UTGOS59w4KMrggM1zS0rrvKkUq7OKgh3Pgsly UePzKnmwgiEHCGTYsiUczUSM2EnNiFhNRK96E0TRILAxti9+XC0XkPZKCxkGUWkW 4j04Lj6p3gw9glrGioc3CDXp/Zidu0eqVz8NmB3chlljZVGprCjlNv9GumT2Rxvj vUNxotkHt95Pon7L/yzO9UbBGACRYq0+7FMvR6CozzJ8N/buqfE= =T5vG -----END PGP SIGNATURE----- --CE+1k2dSO48ffgeK--