From owner-freebsd-sparc64@FreeBSD.ORG  Tue Mar 22 19:11:20 2011
Return-Path: <owner-freebsd-sparc64@FreeBSD.ORG>
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 65C8B1065675;
	Tue, 22 Mar 2011 19:11:20 +0000 (UTC)
	(envelope-from marius@alchemy.franken.de)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
	by mx1.freebsd.org (Postfix) with ESMTP id A4ADC8FC14;
	Tue, 22 Mar 2011 19:11:19 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
	by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id
	p2MJBI3C030687; Tue, 22 Mar 2011 20:11:18 +0100 (CET)
	(envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
	by alchemy.franken.de (8.14.4/8.14.4/Submit) id p2MJBHJM030686;
	Tue, 22 Mar 2011 20:11:17 +0100 (CET) (envelope-from marius)
Date: Tue, 22 Mar 2011 20:11:17 +0100
From: Marius Strobl <marius@alchemy.franken.de>
To: Roger Hammerstein <cheeky.m@live.com>
Message-ID: <20110322191117.GH15528@alchemy.franken.de>
References: <BAY147-w7342A790723770DCE8BD4F9C00@phx.gbl>
	<BAY147-w229E76D137B7A0DCEB3696F9C70@phx.gbl>
	<20110307192239.GA31314@alchemy.franken.de>
	<BAY147-w5926709E28BF613C663D48F9C90@phx.gbl>
	<20110310185423.GA50419@alchemy.franken.de>
	<20110319152838.GA8594@alchemy.franken.de>
	<20110321175632.GA19345@darkthrone.kvedulv.de>
	<20110321175933.GD2086@garage.freebsd.pl>
	<BAY147-w266A8BF89A940BDD569D2EF9B40@phx.gbl>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="T4sUOijqQbZv57TR"
Content-Disposition: inline
In-Reply-To: <BAY147-w266A8BF89A940BDD569D2EF9B40@phx.gbl>
User-Agent: Mutt/1.4.2.3i
Cc: pjd@freebsd.org, freebsd-sparc64@freebsd.org, mm@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 <freebsd-sparc64.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-sparc64>, 
	<mailto:freebsd-sparc64-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-sparc64>
List-Post: <mailto:freebsd-sparc64@freebsd.org>
List-Help: <mailto:freebsd-sparc64-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-sparc64>,
	<mailto:freebsd-sparc64-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 22 Mar 2011 19:11:20 -0000


--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Mar 22, 2011 at 01:51:20PM -0400, Roger Hammerstein wrote:
> 
> which is:
> 1310:
> 1311:   error = put_nvlist(zc, configs);
> 1312:
> 1313:   nvlist_free(configs);
> 1314:
> 1315:   return (error);
> 1316:}
> 1317:
> 

Uhm, looks like r219089 changed some xcopy{in,out}() into
ddi_copy{in,out}(), i.e. copy{in,out}() into bcopy(), which
is just wrong for copying in data in from/out to userspace.
However, looking at the other uses of ddi_copy{in,out}() it
generally seems that ddi_copy{in,out}() should be defined to
copy{in,out}(). With the attached patch at least my simple
test cases works again. The one remaining xcopyout() in
zfs_ioctl.c then could be also replaced with a ddi_copyout().
Not sure how any of this manages to work on x86 :)

Marius


--T4sUOijqQbZv57TR
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="sunddi.h.diff"

Index: sys/cddl/compat/opensolaris/sys/sunddi.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/sunddi.h	(revision 219703)
+++ sys/cddl/compat/opensolaris/sys/sunddi.h	(working copy)
@@ -37,8 +37,10 @@
 
 #define	strdup(ptr)				strdup((ptr), M_SOLARIS)
 #define	ddi_driver_major(zfs_dip)		(0)
-#define	ddi_copyin(from, to, size, flag)	(bcopy((from), (to), (size)), 0)
-#define	ddi_copyout(from, to, size, flag)	(bcopy((from), (to), (size)), 0)
+#define	ddi_copyin(from, to, size, flag)				\
+	(copyin((from), (to), (size)), 0)
+#define	ddi_copyout(from, to, size, flag)				\
+	(copyout((from), (to), (size)), 0)
 int ddi_strtol(const char *str, char **nptr, int base, long *result);
 int ddi_strtoul(const char *str, char **nptr, int base, unsigned long *result);
 int ddi_strtoull(const char *str, char **nptr, int base,

--T4sUOijqQbZv57TR--