From owner-freebsd-emulation@freebsd.org Thu Jan 3 05:30:04 2019 Return-Path: Delivered-To: freebsd-emulation@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 5243B143F47B for ; Thu, 3 Jan 2019 05:30:04 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-15.consmr.mail.bf2.yahoo.com (sonic315-15.consmr.mail.bf2.yahoo.com [74.6.134.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D6138A0E7 for ; Thu, 3 Jan 2019 05:30:02 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 5da9pNEVM1nXydlrnwMRYrMLkrSpI3886i6txx1jcS59GvMpCkE6rJmWi7oC6FK wnjMslm.uwAMmjrFI3u1VS44qG1_WKKOLSEx8KGCnnUOivxWL1W8wlZ.U.aKaDk4eg1BPNhlr.AD UZMPbD3RJKkNzvbUdPdosQkOjWhA6Pm6NpCeUIo_pNex58yP5.YQqZwSLAvXN40rfcYZNBh.x5J6 U853A1kseLBL7eVVHjvnBvvkGMhKqSir55LEanC1HdXCLPA5vabxMyW0CmSyTXPjAhLqChaoZjAu idGoNcVLJ7tvqZv8neqBu2F0uQ6oLX40zcZNqDgeHPBxQeyyKix4QTKzihJqEYkYkGbavcKUI0Tt YEDCWYzFKwioTBq1AGGax50UZmq_qACx9au9T7bRo7lMCtUB.qWPYi7Eq1mFVaTWKcOXZpGkWYAs _6hXOzHNwtH56Zd2gGS5MNaxfqynLwXC6niq3GMjI_nmDUJLHWpfT92o4X.lYYsmM98niSntI7aw FqnOVOAh1ZgM7A8lcsMjch4P1dB5g8_56NxMtvCmmFY2n5nhS08VYx.vZcl7U5USi2vth4.wbsip CSE1JkJcjxBxDatOZtiaS_0sxgDZdDZTJPGOcrzsC34sNFcap89wLbePrxSqsPOIRVMVtApqu7kX ntvhuuDtCcwApIgwIGczdufKgyEFto83ZNObhjFpY.XgyuygfjQvkF9_osN3Q5v7EJ3wG94ueT0B 0z.T3cnhP_W_ZqfUrw1nVO5T5Rm1ntX_ePiHtO7xokI.IacckmLPeN2nuuvhLVS5d.sXD3T3Ji_d DD5VeUYTFCqq9G9rRtCi3Q3gO2cb_ws0wQ86OsbZXcfo0LSf3nlL2vhHS4jGINN5Esa_SqFc1Imj TUONF.E9jIVTjHTt471mIUScIa_usW11E4l4mFCR6nbRoQYc1jafKrHxAbsZf6lF_nc1XlVUHC6P KzV6lIkjSvBuGAyQRanbfHeuhJzZ4SgDRv5dbDDD3zAcjLJFv4tomYquZU3v_YEmksFTf_OT9PU1 g6V56RSdgrtYlZL75NCvksJFbxDxPqj3vfVaYHlABzHmTBMt3vGyqMXZqQ_dz4Mxe2z4cjbVzLw- - Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.bf2.yahoo.com with HTTP; Thu, 3 Jan 2019 05:29:56 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.109]) ([67.170.167.181]) by smtp411.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 8dd332dbfed0ed5f8c56d879ed05fddf; Thu, 03 Jan 2019 05:29:56 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: qemu-arm-static under amd64: example of stuck looping atomic_cmpset_int while building graphics/poppler-qt5 [a tested fix included] From: Mark Millard In-Reply-To: Date: Wed, 2 Jan 2019 21:29:53 -0800 Cc: Sean Bruno , freebsd-emulation@freebsd.org, ports-list freebsd , freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: <8EFD9D72-AABD-4AB1-8592-8B78E779F67F@yahoo.com> References: <51834F45-1EB7-449F-A0EC-7F5EC7CBB12F@yahoo.com> To: Kyle Evans X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 8D6138A0E7 X-Spamd-Bar: +++ X-Spamd-Result: default: False [3.07 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.78)[0.781,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.49)[ip: (4.88), ipnet: 74.6.128.0/21(1.49), asn: 26101(1.19), country: US(-0.08)]; NEURAL_SPAM_MEDIUM(0.72)[0.720,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.58)[0.582,0]; RCVD_IN_DNSWL_NONE(0.00)[125.134.6.74.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[125.134.6.74.rep.mailspike.net : 127.0.0.17] X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 05:30:04 -0000 On 2019-Jan-2, at 17:41, Kyle Evans wrote: > On Wed, Jan 2, 2019 at 3:38 AM Mark Millard via freebsd-ports > wrote: >>=20 >>> . . . >>=20 >> So (without old line numbers): >>=20 >> } else if (TARGET_URWLOCK_READER_COUNT(state) !=3D 0) { >> /* decrement reader count */ >> for (;;) { >> if (!tcmpset_32(&target_urwlock->rw_state, state, (state = - 1))) { >> __get_user(state, &target_urwlock->rw_state); >> if (TARGET_URWLOCK_READER_COUNT(state) =3D=3D 0) { >> unlock_user_struct(target_urwlock, >> target_addr, 1); >> return -TARGET_EPERM; >> } >> } else { >> break; >> } >> } >>=20 >> This follows the structure of other tcmpset_32 use in the source = file. >>=20 >> With this change poudriere-devel's bulk worked for = graphics/poppler-qt5 >> as a amd64->armv7 cross-build (FreeBSD head -r341836 based, under = Hyper-V, >> with 28 logical-processors assigned): >>=20 >=20 > Ah, thanks for that! I think your analysis is correct, and I've > created a pull request [1] for Sean. This should fix the apparent > hangs reported by many across armv7/aarch64. >=20 > [1] https://github.com/seanbruno/qemu-bsd-user/pull/72 There is also the issue that the __packed use for target_freebsd_kevent and target_freebsd11_kevent cause the wrong size and field offsets for armv7 (and armv6) when translating to or from the host (amd64) struct kevent vs. the target struct kevent. These hangs show up as in the kqread state or other such implying kevent is hung-up, unlike for the above. I'm using the following for now: > struct target_freebsd11_kevent { > abi_ulong ident; > int16_t filter; > uint16_t flags; > uint32_t fflags; > abi_long data; > abi_ulong udata; > } ; // __packed; >=20 > struct target_freebsd_kevent { > abi_ulong ident; > int16_t filter; > uint16_t flags; > uint32_t fflags; > int64_t data; > abi_ulong udata; > uint64_t ext[4]; > } ; // __packed; With these I was finally able to build lumina for armv7 via a cross-build (amd64->armv7). Sean is aware of this. However, I still get other hang-ups for targeting aarch64. I've started trying to gather evidence for the one I currently get. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)