From owner-freebsd-sparc64@FreeBSD.ORG Thu Mar 24 13:22:44 2011 Return-Path: Delivered-To: freebsd-sparc64@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C7BF1065670; Thu, 24 Mar 2011 13:22:44 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id B30C88FC18; Thu, 24 Mar 2011 13:22:43 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 3B3E445C98; Thu, 24 Mar 2011 14:22:41 +0100 (CET) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 3DF5045685; Thu, 24 Mar 2011 14:22:35 +0100 (CET) Date: Thu, 24 Mar 2011 14:22:28 +0100 From: Pawel Jakub Dawidek To: Marius Strobl Message-ID: <20110324132228.GD8326@garage.freebsd.pl> References: <20110310185423.GA50419@alchemy.franken.de> <20110319152838.GA8594@alchemy.franken.de> <20110321175632.GA19345@darkthrone.kvedulv.de> <20110321175933.GD2086@garage.freebsd.pl> <20110322191117.GH15528@alchemy.franken.de> <20110323232411.GC82490@darkthrone.kvedulv.de> <4D8B08E1.5060008@FreeBSD.org> <20110324111628.GO15528@alchemy.franken.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bjuZg6miEcdLYP6q" Content-Disposition: inline In-Reply-To: <20110324111628.GO15528@alchemy.franken.de> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: Roger Hammerstein , Martin Matuska , freebsd-sparc64@FreeBSD.org Subject: Re: sparc64 hang with zfs v28 X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2011 13:22:44 -0000 --bjuZg6miEcdLYP6q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 24, 2011 at 12:16:28PM +0100, Marius Strobl wrote: > On Thu, Mar 24, 2011 at 10:03:29AM +0100, Martin Matuska wrote: > > zfs_ioctl_compat_post() calls depending on the ioctl > > zfs_ioctl_compat_fix_stats() or zfs_ioctl_compat_pool_get_props() > >=20 > > Both functions unpack the "zc->zc_nvlist_dst" into "nv" at the very > > beginning and I might be missing something here (works very well on > > i386/amd64) or there might be a problem elsewhere. > >=20 > > nvlist_unpack() from libnvpair (nvpair.c) calls nvlist_xunpack(), > > issuing a nvlist_xalloc(), followerd by a nvlist_common() in > > NVS_OP_DECODE mode - that's where it dies. > > nvlist_common() deals directly with endianess. > >=20 > > sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c > > sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c > >=20 >=20 > The code in zfs_ioctl_compat.c just completely misses the copyin()/ > copyout() dance. The following patch should fix this, but is compile- > tested only so far: > http://people.freebsd.org/~marius/zfs_ioctl_compat.c.diff > Which still is to be used together with: > http://people.freebsd.org/~marius/sunddi.h.diff >=20 > I'm puzzled as to why these bugs don't cause havoc on x86 ... Because on x86 you use copyin(9)/copyout(9) if you are polite. There is nothing that enforce this. I'm happy we have sparc64 to trigger such bugs. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --bjuZg6miEcdLYP6q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk2LRZQACgkQForvXbEpPzTijACeO1O+wZKEYJXPH9VRo1ArUDeY tJ0AniE1oKuGP6NMnpaF2k8YLyh71VJ7 =/VJs -----END PGP SIGNATURE----- --bjuZg6miEcdLYP6q--