From owner-freebsd-ports@FreeBSD.ORG Fri Jul 13 20:49:08 2007 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12A9116A400; Fri, 13 Jul 2007 20:49:08 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.freebsd.org (Postfix) with ESMTP id 86CEC13C4C2; Fri, 13 Jul 2007 20:49:07 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: by gwyn.kn-bremen.de (Postfix, from userid 10) id E2C211F693E; Fri, 13 Jul 2007 22:49:05 +0200 (CEST) Received: from saturn.kn-bremen.de (nox@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.13.8/8.13.6) with ESMTP id l6DKk6f5015010; Fri, 13 Jul 2007 22:46:06 +0200 (CEST) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.13.8/8.13.6/Submit) id l6DKk4nT015009; Fri, 13 Jul 2007 22:46:04 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Fri, 13 Jul 2007 22:46:04 +0200 To: Craig Boston , attilio@freebsd.org, freebsd-emulation@freebsd.org, freebsd-ports@freebsd.org Message-ID: <20070713204604.GA14827@saturn.kn-bremen.de> Mail-Followup-To: Craig Boston , attilio@freebsd.org, freebsd-emulation@freebsd.org, freebsd-ports@freebsd.org, Allan Jude References: <20070702203027.GA45302@saturn.kn-bremen.de> <46925324.9010908@freebsd.org> <3bbf2fe10707091140h6cdc7469nac5be03a8c8a60cb@mail.gmail.com> <200707092000.29768.dfr@rabson.org> <200707092149.l69LnXe9023835@saturn.kn-bremen.de> <20070712175252.GA77654@nowhere> <20070712180750.GB77654@nowhere> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070712180750.GB77654@nowhere> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: Allan Jude Subject: Re: experimental qemu-devel port update, please test! X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2007 20:49:08 -0000 On Thu, Jul 12, 2007 at 01:07:50PM -0500, Craig Boston wrote: > On Thu, Jul 12, 2007 at 12:52:52PM -0500, Craig Boston wrote: > > For some reason when the ioctl is issued, curproc points to a totally > > bogus proc structure. curthread seems to be sane as far as I can tell, > > but the process it claims to belong to is full of junk. > > Aha! The problem isn't that curproc is garbage, but rather that it's > being interpreted wrong. > > struct proc has some extra fields when KSE is #defined. KSE recently > became a kernel option and was put in the DEFAULTS file, so everyone's > kernel has it defined. But kqemu is being compiled without it. > > I compiled with -DKSE and now kqemu works! > Aaah-haah! Thanks for catching this one! :) > This seems like it would be a common problem for modules compiled > outside the kernel tree. Is there an established way to get the > standard configuration options? > Good q... > I'm thinking also about other options like SMP, that for instance > changes the way mutexes work. > > Craig Okay what do you guys think about the following patch for now: (the SMP thing might actually be the cause for ports/113430, can someone verify?) Index: Makefile =================================================================== RCS file: /home/pcvs/ports/emulators/kqemu-kmod/Makefile,v retrieving revision 1.17 diff -u -r1.17 Makefile --- Makefile 29 Jun 2007 15:57:16 -0000 1.17 +++ Makefile 13 Jul 2007 20:36:01 -0000 @@ -7,6 +7,7 @@ PORTNAME= kqemu PORTVERSION= 1.3.0.p11 +PORTREVISION= 1 CATEGORIES= emulators kld MASTER_SITES= http://qemu.org/ \ http://fabrice.bellard.free.fr/qemu/ \ @@ -54,6 +55,23 @@ IGNORE= kqemu requires kernel source to be installed .endif +.if ${OSVERSION} >= 700024 && !defined(NOKSE) +# XXX this is wrong if you have `nooption KSE' in your kernel config, +# please define NOKSE in that case +CFLAGS+= -DKSE +.endif + +# XXX the following is wrong if you run a custom SMP kernel on a +# singleprocessor machine (but it probably doesn't really matter) +KERNCONF!= ${UNAME} -v | ${SED} 's-.*/--' +NCPU!= ${SYSCTL} -n hw.ncpu 2>/dev/null +# we know 7.x GENERIC has SMP +.if ${KERNCONF} == "GENERIC" && ${OSVERSION} >= 700000 +CFLAGS+= -DSMP +.elif ${NCPU} > 1 +CFLAGS+= -DSMP +.endif + do-build: @(cd ${BUILD_WRKSRC}/common; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} Makefile ${MAKE_ARGS} ${ALL_TARGET}) @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET}) Index: pkg-descr =================================================================== RCS file: /home/pcvs/ports/emulators/kqemu-kmod/pkg-descr,v retrieving revision 1.2 diff -u -r1.2 pkg-descr --- pkg-descr 28 Aug 2006 22:52:42 -0000 1.2 +++ pkg-descr 2 Jul 2007 18:57:34 -0000 @@ -1,3 +1,3 @@ KQEMU is a qemu accelerator kernel module on x86/amd64. -WWW: http://qemu.org/qemu-accel.html +WWW: http://fabrice.bellard.free.fr/qemu/