From owner-freebsd-emulation@FreeBSD.ORG Sat Apr 19 03:57:42 2008 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3367106566B; Sat, 19 Apr 2008 03:57:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id 398F18FC17; Sat, 19 Apr 2008 03:57:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1Jn4Cq-000NEe-7I; Sat, 19 Apr 2008 06:57:40 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3J3vhfX035896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Apr 2008 06:57:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3J3vaJW065704; Sat, 19 Apr 2008 06:57:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m3J3vaWp065703; Sat, 19 Apr 2008 06:57:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 Apr 2008 06:57:36 +0300 From: Kostik Belousov To: freebsd-emulation@FreeBSD.org, freebsd-current@FreeBSD.org Message-ID: <20080419035736.GD18958@deviant.kiev.zoral.com.ua> References: <20080418195150.GA18338@saturn.kn-bremen.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eu8nj/18vubUeVCi" Content-Disposition: inline In-Reply-To: <20080418195150.GA18338@saturn.kn-bremen.de> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 7318d724e6e33de4232bc9d11f85b76e X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2676 [Apr 18 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: Subject: Re: destroy_dev_drain stuck (devscd) after kldload, ls -l cloned device, kldunload (trying to fix kqemu...) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 19 Apr 2008 03:57:42 -0000 --eu8nj/18vubUeVCi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 18, 2008 at 09:51:50PM +0200, Juergen Lock wrote: > Using this... after what has been done to /sys/netsmb/smb_dev.c: >=20 > Index: Makefile > =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 > RCS file: /home/pcvs/ports/emulators/kqemu-kmod/Makefile,v > retrieving revision 1.21 > diff -u -p -r1.21 Makefile > --- Makefile 26 Jul 2007 21:46:30 -0000 1.21 > +++ Makefile 18 Apr 2008 18:58:29 -0000 > @@ -7,7 +7,7 @@ > =20 > PORTNAME=3D kqemu > PORTVERSION=3D 1.3.0.p11 > -PORTREVISION=3D 2 > +PORTREVISION=3D 3 > CATEGORIES=3D emulators kld > MASTER_SITES=3D http://fabrice.bellard.free.fr/qemu/ \ > http://qemu.org/ \ > @@ -57,17 +57,6 @@ IGNORE=3D kqemu requires kernel source to > CFLAGS+=3D -DKSE > .endif > =20 > -# XXX the following is wrong if you run a custom SMP kernel on a > -# singleprocessor machine (but it probably doesn't really matter) > -KERNCONF!=3D ${UNAME} -v | ${SED} 's-.*/--' | ${TR} -d ' ' > -NCPU!=3D ${SYSCTL} -n hw.ncpu 2>/dev/null > -# we know 7.x GENERIC has SMP > -.if ${KERNCONF} =3D=3D "GENERIC" && ${OSVERSION} >=3D 700000 > -CFLAGS+=3D -DSMP > -.elif ${NCPU} > 1 > -CFLAGS+=3D -DSMP > -.endif > - > post-extract: > .if ${OSVERSION} >=3D 700024 && !defined(NOKSE) > @${ECHO_MSG} "Compiling with -DKSE." > Index: files/patch-kqemu-freebsd.c > =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 > RCS file: /home/pcvs/ports/emulators/kqemu-kmod/files/patch-kqemu-freebsd= .c,v > retrieving revision 1.6 > diff -u -p -r1.6 patch-kqemu-freebsd.c > --- files/patch-kqemu-freebsd.c 21 Jul 2007 19:38:16 -0000 1.6 > +++ files/patch-kqemu-freebsd.c 18 Apr 2008 18:37:00 -0000 > @@ -17,13 +17,30 @@ Index: kqemu-freebsd.c > return SIGPENDING(curthread); > } > #endif > -@@ -320,6 +328,9 @@ > +@@ -320,8 +320,15 @@ > #if __FreeBSD_version >=3D 500000 > dev->si_drv1 =3D NULL; > TAILQ_REMOVE(&kqemuhead, ks, kqemu_ent); > ++#if __FreeBSD_version >=3D 700051 > ++ destroy_dev_sched(dev); > ++#else > +#if __FreeBSD_version >=3D 700024 > + dev_relthread(dev);=20 > +#endif > destroy_dev(dev); > #endif > ++#endif > free(ks, M_KQEMU); > + --kqemu_ref_count; > + } > +@@ -500,6 +507,10 @@ > + while ((ks =3D TAILQ_FIRST(&kqemuhead)) !=3D NULL) { > + kqemu_destroy(ks); > + } > ++#if __FreeBSD_version >=3D 700051 > ++ drain_dev_clone_events(); > ++ /* destroy_dev_drain(&kqemu_cdevsw); */ > ++#endif > + clone_cleanup(&kqemuclones); > + #endif > + kqemu_global_delete(kqemu_gs); The destroy_dev_drain() function waits for the cdevs having the kqemu_cdevsw cdevsw to be destroyed. I did not looked into the actual kqemu sources, but assumed that kqemuclones have kqemu_cdevsw as cdevsw. If this is the case, you shall call clone_cleanup() before destroy_dev_drain(). >=20 > (and uncommenting the destroy_dev_drain call) I get a hang when I do: > kldload kqemu > ls -l /dev/kqemu > kldunload kqemu >=20 > Am I doing something wrong or is the bug elsewhere? >=20 > Oh and does anyone still see qemu hanging using the commented version? > (Only you shouldn't kldunload too quickly after running qemu I guess... :) >=20 > Thanx, > Juergen > _______________________________________________ > freebsd-emulation@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-emulation > To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.o= rg" --eu8nj/18vubUeVCi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkgJbbAACgkQC3+MBN1Mb4j9xwCaA/dgIW7ep9Xja6s0HVk4FEso voMAnAli4lh5ZBSFyghXgiv2Nu1vFAaz =kc6z -----END PGP SIGNATURE----- --eu8nj/18vubUeVCi--