From owner-freebsd-emulation@FreeBSD.ORG Sun May 4 07:15:51 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 206D7106564A for ; Sun, 4 May 2008 07:15:51 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id D2D768FC0C for ; Sun, 4 May 2008 07:15:50 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A55DDC.dip.t-dialin.net [84.165.93.220]) by redbull.bpaserver.net (Postfix) with ESMTP id 8F23B2E0D6; Sun, 4 May 2008 09:15:42 +0200 (CEST) Received: from deskjail (unknown [192.168.1.109]) by outgoing.leidinger.net (Postfix) with ESMTP id EEADBC8E3B; Sun, 4 May 2008 09:15:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1209885339; bh=NaD8LCV37ONNN/ht1ajU48mdhYtezCBlo Av0VIAh23U=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To: References:Mime-Version:Content-Type:Content-Transfer-Encoding; b=BQVy3j9EqG1elwqt64OPDjmJawgVIXeITB04zAgPjKuzcxRjbuBnKvfHl/I8V0+P7 3EUN8/0dpZeIPFR7W9r1xqqHSQRYbh2VAa41KsM6PEANT+Ct5YOD9xTQnwoHjd9ieUf alla7XlV11DCO1Mp1XlvkDOKIWU2pPTO0nQfnfpeUf5G9r3Y6Og/pXpZPG3dSBc95Nn 6411PSDbhEZNxG1ITJPU73Un3MLOCWpC3SNDs4uzNSPgjz0r1ZMsaTnWr70CM8+Iz6f 64xQ8lwGod5/8BkECwIkVNESeisXlhK+173ofAuuMoR2nzobw5uh4R90dIO9lFnvH2Q hg4PeL7Hw== Date: Sun, 4 May 2008 09:15:39 +0200 From: Alexander Leidinger To: frank@exit.com Message-ID: <20080504091539.1b140107@deskjail> In-Reply-To: <1209856296.17097.5.camel@jill.exit.com> References: <1209856296.17097.5.camel@jill.exit.com> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.8; i686-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-14.4, required 6, BAYES_00 -15.00, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, NO_RDNS 0.50, RDNS_DYNAMIC 0.10) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: emulation@FreeBSD.org Subject: Re: Using Linux Nero port in FreeBSD 6. 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: Sun, 04 May 2008 07:15:51 -0000 Quoting Frank Mayhar (Sat, 03 May 2008 16:11:36 -0700): > I've been trying to make this work and it never can seem to find the > device. It's a DVD writer on /dev/cd0 (connected via USB so it's using > the SCSI-like interface) and /dev/pass0. I've tried every combination I > can think of of pointing /compat/linux/dev/ to > either /dev/cd0 or /dev/pass0, to no avail. The best I've received is > the ktrace showing it getting ENOTTY (inappropriate ioctl for device). > > Hints? Suggestions? Several possibilities: The SCSI part has a linux emulation part (I don't remember the name ATM), give it a try and report back if it works. In the linux emulation exists a device wrapper feature. You can add the device there (in the source) which nero tries to open, and maybe add some more code which maps linux ioctls to FreeBSD ones (or at least identify which devices it tries to open and which ioctls it wants to do, maybe someone here on the list is willing to help out). Bye, Alexander. -- Ferengi Rule of Acquisition #139: Wives serve, brothers inherit. -- ST:DS9, "Necessary Evil" http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-freebsd-emulation@FreeBSD.ORG Mon May 5 11:07:03 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 2E4AD10656B6 for ; Mon, 5 May 2008 11:07:03 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 18B8D8FC13 for ; Mon, 5 May 2008 11:07:03 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m45B72Vg070664 for ; Mon, 5 May 2008 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m45B72AG070660 for freebsd-emulation@FreeBSD.org; Mon, 5 May 2008 11:07:02 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 5 May 2008 11:07:02 GMT Message-Id: <200805051107.m45B72AG070660@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-emulation@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-emulation@FreeBSD.org 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: Mon, 05 May 2008 11:07:03 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/21463 emulation [linux] Linux compatability mode should not allow setu o kern/97326 emulation [linux] file descriptor leakage in linux emulation o kern/117010 emulation [linux] linux_getdents() get something like buffer ove 3 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/11165 emulation [ibcs2] IBCS2 doesn't work correctly with PID_MAX 9999 o kern/29698 emulation [linux] [patch] linux ipcs doesn'work o kern/39201 emulation [linux] [patch] ptrace(2) and rfork(RFLINUXTHPN) confu o kern/41543 emulation [patch] [request] easier wine/w23 support a kern/72920 emulation [linux]: path "prefixing" is not done on unix domain s f kern/73777 emulation [linux] [patch] linux emulation: root dir special hand o kern/91293 emulation [svr4] [patch] *Experimental* Update to the SVR4 emula o ports/91318 emulation [fix] graphics/linux_dri: works on amd64 too o ports/121800 emulation x11-toolkits/linux-openmotif - OpenMotif upgrade to 2. o kern/122318 emulation [linux] [cmake]: Segmentation fault when running Linux 10 problems total. From owner-freebsd-emulation@FreeBSD.ORG Mon May 5 13:56:20 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 76F821065676; Mon, 5 May 2008 13:56:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 5430B8FC21; Mon, 5 May 2008 13:56:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id 0B48F1A4D84; Mon, 5 May 2008 06:56:19 -0700 (PDT) From: John Baldwin To: Juergen Lock Date: Mon, 5 May 2008 09:50:57 -0400 User-Agent: KMail/1.9.7 References: <20080429222458.GA20855@saturn.kn-bremen.de> <200805011335.06415.jhb@freebsd.org> <20080503131139.GA37131@saturn.kn-bremen.de> In-Reply-To: <20080503131139.GA37131@saturn.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805050950.57484.jhb@freebsd.org> Cc: freebsd-emulation@freebsd.org, freebsd-amd64@freebsd.org Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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: Mon, 05 May 2008 13:56:20 -0000 On Saturday 03 May 2008 09:11:39 am Juergen Lock wrote: > On Thu, May 01, 2008 at 01:35:06PM -0400, John Baldwin wrote: > > On Thursday 01 May 2008 11:53:04 am Juergen Lock wrote: > > > On Thu, May 01, 2008 at 10:11:06AM -0400, John Baldwin wrote: > > > > On Thursday 01 May 2008 06:19:51 am Juergen Lock wrote: > > > > > On Wed, Apr 30, 2008 at 12:24:58AM +0200, Juergen Lock wrote: > > > > > > Yeah, the amd64 kernel reuses the same gdt to setup all cpus, > > > > > > causing kqemu to end up restoring the interrupt stackpointer > > > > > > (after running guest code using its own cpu state) from the tss > > > > > > of the last cpu, regardless which cpu it happened to run on. And > > > > > > that then causes the last cpu's (usually) idle thread's stack to > > > > > > get smashed and the host doing multiple panics... (Which also > > > > > > explains why pinning qemu onto > > > > cpu > > > > > > > > 1 worked on a 2-way host.) > > > > > > > > > > Hmm maybe the following is a little more clear: kqemu sets up its > > > > > own cpu state and has to save and restore the original state > > > > > because of > > > > that, > > > > > > > so among other things it does an str insn (store task register), > > > > > and > > > > later > > > > > > > an ltr insn (load task register) using the value it got from the > > > > > first str insn. That ltr insn loads the selector for the tss which > > > > > is stored in the gdt, and that entry in the gdt is different for > > > > > each cpu, but > > > > since > > > > > > > a single gdt was reused to setup the cpus at boot (in > > > > > init_secondary() > > > > in > > > > > > > /sys/amd64/amd64/mp_machdep.c), it still points to the tss for the > > > > > last cpu, instead of to the right one for the cpu the ltr insn gets > > > > > executed > > > > on. > > > > > > > That is what the kqemu_tss_workaround() in the patch `fixes'... > > > > > > > > Perhaps kqemu shouldn't be doing str/ltr on amd64 instead? The > > > > things > > > > i386 > > > > > > uses a separate tss for in the kernel (separate stack for double > > > > faults) > > > > is > > > > > > handled differently on amd64 (on amd64 we make the double fault > > > > handler > > > > use > > > > > > one of the IST stacks). > > > > > > Well, kqemu uses its own gdt, tss and everything while running guest > > > code in its monitor, so it kinda has to do the str/ltr.s to setup its > > > stuff, run guest code, and then restore the original state of things. > > > (And `restore original state of things' is what failed here.) > > > > > > Oh and also the tss does seem to be used for the interrupt stack on > > > amd64 too, at least thats the one that ended up wrong and caused the > > > panics I saw... > > > > The single TSS holds the IST pointers. On i386 we use a separate TSS for > > double faults, but on amd64 a double fault uses the same TSS but uses the > > IST pointers from that same TSS. The TSS also holds the ring stack > > pointer for when syscalls, interrupts, and traps from userland cross from > > ring 3 to ring 0 which is probably why you got a panic. > > Yeah thats where it happened. > > > Because of the fact that amd64 in normal operation never changes the task > > register (and that the gdt isn't used quite the same either, all the > > per-cpu stuff is via FSBASE and GSBASE) I don't expect the kernel to > > change to use a per-cpu gdt or the like. I think you will need to use > > the current approach of patching kqemu to fixup the tss/gdt when > > reloading the task register. You might want to make it a regular part of > > the code rather than a workaround as a result. > > Hmm okay, how would you call it then, kqemu_tss_fixup? Sure. -- John Baldwin From owner-freebsd-emulation@FreeBSD.ORG Tue May 6 18:21:29 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 326D41065673; Tue, 6 May 2008 18:21:29 +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 A6F328FC15; Tue, 6 May 2008 18:21:28 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: by gwyn.kn-bremen.de (Postfix, from userid 10) id B07002CE67D; Tue, 6 May 2008 20:21:26 +0200 (CEST) Received: from saturn.kn-bremen.de (nox@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.14.2/8.13.8) with ESMTP id m46IJVAX022873; Tue, 6 May 2008 20:19:31 +0200 (CEST) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.14.2/8.13.6/Submit) id m46IJVfX022872; Tue, 6 May 2008 20:19:31 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Tue, 6 May 2008 20:19:31 +0200 To: John Baldwin Message-ID: <20080506181931.GA22856@saturn.kn-bremen.de> Mail-Followup-To: John Baldwin , freebsd-amd64@freebsd.org, freebsd-emulation@freebsd.org References: <20080429222458.GA20855@saturn.kn-bremen.de> <200805011335.06415.jhb@freebsd.org> <20080503131139.GA37131@saturn.kn-bremen.de> <200805050950.57484.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200805050950.57484.jhb@freebsd.org> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-emulation@freebsd.org, freebsd-amd64@freebsd.org Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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: Tue, 06 May 2008 18:21:29 -0000 On Mon, May 05, 2008 at 09:50:57AM -0400, John Baldwin wrote: > On Saturday 03 May 2008 09:11:39 am Juergen Lock wrote: > > On Thu, May 01, 2008 at 01:35:06PM -0400, John Baldwin wrote: > > > On Thursday 01 May 2008 11:53:04 am Juergen Lock wrote: > > > > On Thu, May 01, 2008 at 10:11:06AM -0400, John Baldwin wrote: > > > > > On Thursday 01 May 2008 06:19:51 am Juergen Lock wrote: > > > > > > On Wed, Apr 30, 2008 at 12:24:58AM +0200, Juergen Lock wrote: > > > > > > > Yeah, the amd64 kernel reuses the same gdt to setup all cpus, > > > > > > > causing kqemu to end up restoring the interrupt stackpointer > > > > > > > (after running guest code using its own cpu state) from the tss > > > > > > > of the last cpu, regardless which cpu it happened to run on. And > > > > > > > that then causes the last cpu's (usually) idle thread's stack to > > > > > > > get smashed and the host doing multiple panics... (Which also > > > > > > > explains why pinning qemu onto > > > > > > cpu > > > > > > > > > > 1 worked on a 2-way host.) > > > > > > > > > > > > Hmm maybe the following is a little more clear: kqemu sets up its > > > > > > own cpu state and has to save and restore the original state > > > > > > because of > > > > > > that, > > > > > > > > > so among other things it does an str insn (store task register), > > > > > > and > > > > > > later > > > > > > > > > an ltr insn (load task register) using the value it got from the > > > > > > first str insn. That ltr insn loads the selector for the tss which > > > > > > is stored in the gdt, and that entry in the gdt is different for > > > > > > each cpu, but > > > > > > since > > > > > > > > > a single gdt was reused to setup the cpus at boot (in > > > > > > init_secondary() > > > > > > in > > > > > > > > > /sys/amd64/amd64/mp_machdep.c), it still points to the tss for the > > > > > > last cpu, instead of to the right one for the cpu the ltr insn gets > > > > > > executed > > > > > > on. > > > > > > > > > That is what the kqemu_tss_workaround() in the patch `fixes'... > > > > > > > > > > Perhaps kqemu shouldn't be doing str/ltr on amd64 instead? The > > > > > things > > > > > > i386 > > > > > > > > uses a separate tss for in the kernel (separate stack for double > > > > > faults) > > > > > > is > > > > > > > > handled differently on amd64 (on amd64 we make the double fault > > > > > handler > > > > > > use > > > > > > > > one of the IST stacks). > > > > > > > > Well, kqemu uses its own gdt, tss and everything while running guest > > > > code in its monitor, so it kinda has to do the str/ltr.s to setup its > > > > stuff, run guest code, and then restore the original state of things. > > > > (And `restore original state of things' is what failed here.) > > > > > > > > Oh and also the tss does seem to be used for the interrupt stack on > > > > amd64 too, at least thats the one that ended up wrong and caused the > > > > panics I saw... > > > > > > The single TSS holds the IST pointers. On i386 we use a separate TSS for > > > double faults, but on amd64 a double fault uses the same TSS but uses the > > > IST pointers from that same TSS. The TSS also holds the ring stack > > > pointer for when syscalls, interrupts, and traps from userland cross from > > > ring 3 to ring 0 which is probably why you got a panic. > > > > Yeah thats where it happened. > > > > > Because of the fact that amd64 in normal operation never changes the task > > > register (and that the gdt isn't used quite the same either, all the > > > per-cpu stuff is via FSBASE and GSBASE) I don't expect the kernel to > > > change to use a per-cpu gdt or the like. I think you will need to use > > > the current approach of patching kqemu to fixup the tss/gdt when > > > reloading the task register. You might want to make it a regular part of > > > the code rather than a workaround as a result. > > > > Hmm okay, how would you call it then, kqemu_tss_fixup? > > Sure. Okay, I shall rename it at the next kqemu commit. Thanx, Juergen From owner-freebsd-emulation@FreeBSD.ORG Tue May 6 19:35:43 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 7504F1065672 for ; Tue, 6 May 2008 19:35:43 +0000 (UTC) (envelope-from bsd@kuehlbox.de) Received: from samael.qmail-ldap.de (mail.kuehlbox.de [62.159.47.22]) by mx1.freebsd.org (Postfix) with ESMTP id AE8618FC27 for ; Tue, 6 May 2008 19:35:42 +0000 (UTC) (envelope-from bsd@kuehlbox.de) Received: (qmail 56560 invoked from network); 6 May 2008 19:08:49 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=kuehlbox.de; b=EAjFtgBIaUweJaZ9Xh+dluxc4MGTGvdiox46FvSQC53AYz48oWafLAKLYetCGmVLQj9N0/FFKZNLryOHJjL4OPU4dudci2C0bOc7pue7U5N3zXVd/t2DukPTdmysfoY2 ; Received: from unknown (HELO [192.168.200.128]) (bsd@kuehlbox.de@[10.0.48.22]) (envelope-sender ) by samael.qmail-ldap.de (qmail-ldap-1.03) with SMTP for ; 6 May 2008 19:08:49 -0000 Received: from: ppp-88-217-15-6.dynamic.mnet-online.de ([88.217.15.6]) by HSF smtp proxy with AES256-SHA encrypted SMTP Message-ID: <4820AC9A.1070803@kuehlbox.de> Date: Tue, 06 May 2008 21:08:10 +0200 From: Teufel User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: freebsd-emulation@FreeBSD.org References: <20080429222458.GA20855@saturn.kn-bremen.de> <20080501101951.GA30274@saturn.kn-bremen.de> In-Reply-To: <20080501101951.GA30274@saturn.kn-bremen.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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: Tue, 06 May 2008 19:35:43 -0000 Juergen Lock wrote: > The patch applied with offsets (I still had debug code in when I made it), > here is a rebased version: > > Index: kqemu-freebsd.c > @@ -33,6 +33,11 @@ > > #include > #include > +#ifdef __x86_64__ > +#include > +#include > +#include > +#endif > > #include "kqemu-kernel.h" > > @@ -234,6 +239,19 @@ > va_end(ap); > } > > +#ifdef __x86_64__ > +/* called with interrupts disabled */ > +void CDECL kqemu_tss_workaround(void) > +{ > + int gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); > + > + gdt_segs[GPROC0_SEL].ssd_base = (long) &common_tss[PCPU_GET(cpuid)]; > + ssdtosyssd(&gdt_segs[GPROC0_SEL], > + (struct system_segment_descriptor *)&gdt[GPROC0_SEL]); > + ltr(gsel_tss); > +} > +#endif > + > struct kqemu_instance { > #if __FreeBSD_version >= 500000 > TAILQ_ENTRY(kqemu_instance) kqemu_ent; > Index: common/kernel.c > @@ -1025,6 +1025,9 @@ > #ifdef __x86_64__ > uint16_t saved_ds, saved_es; > unsigned long fs_base, gs_base; > +#ifdef __FreeBSD__ > + struct kqemu_global_state *g = s->global_state; > +#endif > #endif > > #ifdef PROFILE > @@ -1188,6 +1191,13 @@ > apic_restore_nmi(s, apic_nmi_mask); > } > profile_record(s); > +#ifdef __FreeBSD__ > +#ifdef __x86_64__ > + spin_lock(&g->lock); > + kqemu_tss_workaround(); > + spin_unlock(&g->lock); > +#endif > +#endif > > if (s->mon_req == MON_REQ_IRQ) { > struct kqemu_exception_regs *r; > Index: kqemu-kernel.h > @@ -44,4 +44,10 @@ > > void CDECL kqemu_log(const char *fmt, ...); > > +#ifdef __FreeBSD__ > +#ifdef __x86_64__ > +void CDECL kqemu_tss_workaround(void); > +#endif > +#endif > + > #endif /* KQEMU_KERNEL_H */ > applied the patch and kqemu works now with quad core CPU running 7-stable amd64 smp. However, running a win2k3 guest results in many "fpudna in kernel mode!" kernel messages, regardless if -kernel-mode is used or not (but with kqemu-user enabled). What needs to be done to fix that? Greetings, Xat From owner-freebsd-emulation@FreeBSD.ORG Tue May 6 20:02:54 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 A2389106566B for ; Tue, 6 May 2008 20:02:54 +0000 (UTC) (envelope-from bsd@kuehlbox.de) Received: from samael.qmail-ldap.de (mail.kuehlbox.de [62.159.47.22]) by mx1.freebsd.org (Postfix) with ESMTP id 2DF658FC2C for ; Tue, 6 May 2008 20:02:53 +0000 (UTC) (envelope-from bsd@kuehlbox.de) Received: (qmail 25977 invoked from network); 6 May 2008 20:02:41 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=kuehlbox.de; b=ei5XaJmF6vo2exWEb6OYRVvg6dR/nSeQJNX40A5G/zMD3SLJHEsW2tSw8XEU7LxDdMQi57f+bnjAD3sz3RPuQBG9yewnAa9BBIeW3mAhtrUQ0XgRKSkItXAtu3pDeeIC ; Received: from unknown (HELO [192.168.200.128]) (bsd@kuehlbox.de@[10.0.48.22]) (envelope-sender ) by samael.qmail-ldap.de (qmail-ldap-1.03) with SMTP for ; 6 May 2008 20:02:41 -0000 Received: from: ppp-88-217-15-6.dynamic.mnet-online.de RECURED ([88.217.15.6]) by HSF smtp proxy with AES256-SHA encrypted SMTP Message-ID: <4820B954.7040603@kuehlbox.de> Date: Tue, 06 May 2008 22:02:28 +0200 From: Teufel User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Bakul Shah , freebsd-emulation@FreeBSD.org References: <20080506194800.876695B4C@mail.bitblocks.com> In-Reply-To: <20080506194800.876695B4C@mail.bitblocks.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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: Tue, 06 May 2008 20:02:54 -0000 Bakul Shah wrote: >> at needs to be done to fix that? >> > > Comment it out in amd64/amd64/trap.c! > getting rid of the message, yes.. but without further issues? From owner-freebsd-emulation@FreeBSD.ORG Tue May 6 20:08:28 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 A6C1E1065672 for ; Tue, 6 May 2008 20:08:28 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (mail.bitblocks.com [64.142.15.60]) by mx1.freebsd.org (Postfix) with ESMTP id 889F88FC1C for ; Tue, 6 May 2008 20:08:28 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id 876695B4C; Tue, 6 May 2008 12:48:00 -0700 (PDT) To: Teufel In-reply-to: Your message of "Tue, 06 May 2008 21:08:10 +0200." <4820AC9A.1070803@kuehlbox.de> Date: Tue, 06 May 2008 12:48:00 -0700 From: Bakul Shah Message-Id: <20080506194800.876695B4C@mail.bitblocks.com> Cc: freebsd-emulation@FreeBSD.org Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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: Tue, 06 May 2008 20:08:28 -0000 > applied the patch and kqemu works now with quad core CPU running > 7-stable amd64 smp. However, running a win2k3 guest results in many > "fpudna in kernel mode!" kernel messages, regardless if -kernel-mode is > used or not (but with kqemu-user enabled). > What needs to be done to fix that? Comment it out in amd64/amd64/trap.c! From owner-freebsd-emulation@FreeBSD.ORG Tue May 6 20:45:12 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 78E691065671 for ; Tue, 6 May 2008 20:45:12 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (mail.bitblocks.com [64.142.15.60]) by mx1.freebsd.org (Postfix) with ESMTP id 592DA8FC1A for ; Tue, 6 May 2008 20:45:12 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id E1A945B3B; Tue, 6 May 2008 13:45:11 -0700 (PDT) To: Teufel In-reply-to: Your message of "Tue, 06 May 2008 22:02:28 +0200." <4820B954.7040603@kuehlbox.de> Date: Tue, 06 May 2008 13:45:11 -0700 From: Bakul Shah Message-Id: <20080506204511.E1A945B3B@mail.bitblocks.com> Cc: freebsd-emulation@FreeBSD.org Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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: Tue, 06 May 2008 20:45:12 -0000 On Tue, 06 May 2008 22:02:28 +0200 Teufel wrote: > Bakul Shah wrote: > >> at needs to be done to fix that? > >> > > > > Comment it out in amd64/amd64/trap.c! > > > getting rid of the message, yes.. but without further issues? The message is there "because you are not supposed to do it" See for instance http://docs.freebsd.org/cgi/getmsg.cgi?fetch=100953+0+archive/2007/freebsd-emulation/20070415.freebsd-emulation This seems to have not caused any problem in practice. And any way taking out the message doesn't change the essential behavior (the invariant is still broken) but it can speed up your emulation considerably. From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 03:37:50 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4627B1065673 for ; Wed, 7 May 2008 03:37:50 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) by mx1.freebsd.org (Postfix) with ESMTP id 0409E8FC13 for ; Wed, 7 May 2008 03:37:49 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by mail5out.barnet.com.au (Postfix, from userid 1001) id E3C322218A83; Wed, 7 May 2008 13:22:32 +1000 (EST) X-Viruscan-Id: <4821207800003F141265D7@BarNet> Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail5auth.barnet.com.au", Issuer "*.barnet.com.au" (verified OK)) by mail5.barnet.com.au (Postfix) with ESMTP id 8420A21B2BCF for ; Wed, 7 May 2008 13:22:32 +1000 (EST) Received: from k7.mavetju (k7.mavetju.org [10.251.1.18]) by mail5auth.barnet.com.au (Postfix) with ESMTP id 0DD722218A6B for ; Wed, 7 May 2008 13:22:32 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id B6766A33; Wed, 7 May 2008 13:22:31 +1000 (EST) Date: Wed, 7 May 2008 13:22:31 +1000 From: Edwin Groothuis To: emulation@freebsd.org Message-ID: <20080507032231.GA29548@k7.mavetju> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: QEMU with network boot 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: Wed, 07 May 2008 03:37:50 -0000 Hello, First time user with QEMU, trying to get things up and running... I got routing working, I can reach the internet from my emulated FreeBSD 6.3 OS. Thanks to nox on #bsdports for that. When I start the qemu host with "-boot n", I see the DHCP requests and answers going over the wire (... tap device ...) but the NIC keeps saying that it can't get an IP address. This is the network output of it: --------------------------------------------------------------------------- TIME: 13:18:21.306194 IP: > (52:54:00:12:34:56) > (ff:ff:ff:ff:ff:ff) OP: 1 (BOOTPREQUEST) HTYPE: 1 (Ethernet) HLEN: 6 HOPS: 0 XID: 00157da3 SECS: 0 FLAGS: 0 CIADDR: 0.0.0.0 YIADDR: 0.0.0.0 SIADDR: 0.0.0.0 GIADDR: 0.0.0.0 CHADDR: 52:54:00:12:34:56:00:00:00:00:00:00:00:00:00:00 SNAME: . FNAME: . OPTION: 53 ( 1) DHCP message type 1 (DHCPDISCOVER) OPTION: 57 ( 2) Maximum DHCP message size 1500 OPTION: 60 ( 13) Vendor class identifier Etherboot-5.4 OPTION: 55 ( 4) Parameter Request List 1 (Subnet mask) 3 (Routers) 12 (Host name) 43 (Vendor specific info) OPTION: 150 ( 11) ??? af050110ec8139b1 ......9. 020300 ... --------------------------------------------------------------------------- TIME: 13:18:22.003805 IP: > (00:bd:5c:dc:5d:00) > (52:54:00:12:34:56) OP: 2 (BOOTPREPLY) HTYPE: 1 (Ethernet) HLEN: 6 HOPS: 0 XID: 00157da3 SECS: 0 FLAGS: 0 CIADDR: 0.0.0.0 YIADDR: 192.168.253.24 SIADDR: 0.0.0.0 GIADDR: 0.0.0.0 CHADDR: 52:54:00:12:34:56:00:00:00:00:00:00:00:00:00:00 SNAME: . FNAME: pxeboot. OPTION: 53 ( 1) DHCP message type 2 (DHCPOFFER) OPTION: 54 ( 4) Server identifier 192.168.253.1 OPTION: 51 ( 4) IP address leasetime 600 (10m) OPTION: 1 ( 4) Subnet mask 255.255.255.0 OPTION: 3 ( 4) Routers 192.168.253.1 OPTION: 12 ( 8) Host name qemu63-1 --------------------------------------------------------------------------- It is giving option 150, which I don't really know what for. And it is asking for vendor specific information, which I don't really know which one that is neither. Has anybody managed to get this working? How did the relevant part of your dhcp.conf look like? Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/ From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 03:43:14 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3B37106564A for ; Wed, 7 May 2008 03:43:14 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) by mx1.freebsd.org (Postfix) with ESMTP id 803908FC17 for ; Wed, 7 May 2008 03:43:14 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by mail5out.barnet.com.au (Postfix, from userid 1001) id D8E752218AA0; Wed, 7 May 2008 13:43:13 +1000 (EST) X-Viruscan-Id: <48212551000076AA48F940@BarNet> Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail5auth.barnet.com.au", Issuer "*.barnet.com.au" (verified OK)) by mail5.barnet.com.au (Postfix) with ESMTP id 3453D21B2C05 for ; Wed, 7 May 2008 13:43:13 +1000 (EST) Received: from k7.mavetju (k7.mavetju.org [10.251.1.18]) by mail5auth.barnet.com.au (Postfix) with ESMTP id C35842218A8E for ; Wed, 7 May 2008 13:43:12 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id 82010AC0; Wed, 7 May 2008 13:43:12 +1000 (EST) Date: Wed, 7 May 2008 13:43:12 +1000 From: Edwin Groothuis To: emulation@freebsd.org Message-ID: <20080507034312.GA38256@k7.mavetju> References: <20080507032231.GA29548@k7.mavetju> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080507032231.GA29548@k7.mavetju> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: QEMU with network boot 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: Wed, 07 May 2008 03:43:14 -0000 On Wed, May 07, 2008 at 01:22:31PM +1000, Edwin Groothuis wrote: > When I start the qemu host with "-boot n", I see the DHCP requests > and answers going over the wire (... tap device ...) but the NIC > keeps saying that it can't get an IP address. This is the network > output of it: http://pxe.dev.aboveaverageurl.com/index.php/PXE_Booting gave the hint: I needed a next-server statement. It's now through to its TFTP phase. Sorry about the noise! Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/ From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 06:01:23 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 629E3106566C for ; Wed, 7 May 2008 06:01:23 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) by mx1.freebsd.org (Postfix) with ESMTP id 1D63E8FC1A for ; Wed, 7 May 2008 06:01:23 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by mail5out.barnet.com.au (Postfix, from userid 1001) id 3636D2218A78; Wed, 7 May 2008 16:01:22 +1000 (EST) X-Viruscan-Id: <482145B1000072EA713E64@BarNet> Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail5auth.barnet.com.au", Issuer "*.barnet.com.au" (verified OK)) by mail5.barnet.com.au (Postfix) with ESMTP id C302C21B2414 for ; Wed, 7 May 2008 16:01:20 +1000 (EST) Received: from k7.mavetju (k7.mavetju.org [10.251.1.18]) by mail5auth.barnet.com.au (Postfix) with ESMTP id 392AB2218C12 for ; Wed, 7 May 2008 16:01:20 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id D05AEBAB; Wed, 7 May 2008 16:01:19 +1000 (EST) Date: Wed, 7 May 2008 16:01:19 +1000 From: Edwin Groothuis To: emulation@freebsd.org Message-ID: <20080507060119.GA50020@k7.mavetju> References: <20080507032231.GA29548@k7.mavetju> <20080507034312.GA38256@k7.mavetju> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080507034312.GA38256@k7.mavetju> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: QEMU with network boot 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: Wed, 07 May 2008 06:01:23 -0000 On Wed, May 07, 2008 at 01:43:12PM +1000, Edwin Groothuis wrote: > On Wed, May 07, 2008 at 01:22:31PM +1000, Edwin Groothuis wrote: > > When I start the qemu host with "-boot n", I see the DHCP requests > > and answers going over the wire (... tap device ...) but the NIC > > keeps saying that it can't get an IP address. This is the network > > output of it: > > http://pxe.dev.aboveaverageurl.com/index.php/PXE_Booting gave the > hint: I needed a next-server statement. I'll submit a PR for the manpage of pxeboot for this, because the behaviour of the ISC-DHCP has changed with version 3.0.3 about this (See http://www.mavetju.org/weblog/html/00110.html, I knew I had seen this before) > It's now through to its TFTP phase. Sorry about the noise! I have moved the file /boot/pxeboot to my tftpboot directory, it gets loaded but then QEMU complains about: ......TFTP download complete, but Unable to load file. And restarts. Not sure what goes wrong... Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/ From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 08:14:20 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 4AE7A1065675 for ; Wed, 7 May 2008 08:14:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx10.syd.optusnet.com.au (fallbackmx10.syd.optusnet.com.au [211.29.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id 2BCD38FC1B for ; Wed, 7 May 2008 08:14:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by fallbackmx10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m475t9es025621 for ; Wed, 7 May 2008 15:55:09 +1000 Received: from besplex.bde.org (c220-239-252-11.carlnfd3.nsw.optusnet.com.au [220.239.252.11]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m475su8L028734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 7 May 2008 15:54:59 +1000 Date: Wed, 7 May 2008 15:54:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bakul Shah In-Reply-To: <20080506204511.E1A945B3B@mail.bitblocks.com> Message-ID: <20080507154914.W52560@besplex.bde.org> References: <20080506204511.E1A945B3B@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@FreeBSD.org Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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: Wed, 07 May 2008 08:14:20 -0000 On Tue, 6 May 2008, Bakul Shah wrote: > On Tue, 06 May 2008 22:02:28 +0200 Teufel wrote: >> Bakul Shah wrote: >>>> at needs to be done to fix that? >>> >>> Comment it out in amd64/amd64/trap.c! Bletch. >> getting rid of the message, yes.. but without further issues? > > The message is there "because you are not supposed to do it" s/you/kqemu/ (or interpret what you are not supposed to do as "running kqemu". > See for instance > > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=100953+0+archive/2007/freebsd-emulation/20070415.freebsd-emulation > > This seems to have not caused any problem in practice. And > any way taking out the message doesn't change the essential > behavior (the invariant is still broken) but it can speed up > your emulation considerably. I should have changed it to a panic long ago. That would give the correct number of messages (1) :-). i386 still doesn't even print a message (perhaps it never did). The bug would probably never have existed in any FreeBSD version of kqemu if i386 had had enough invariant checking. Bruce From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 08:38:27 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D36FE106564A for ; Wed, 7 May 2008 08:38:27 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (ns1.bitblocks.com [64.142.15.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9A1298FC1A for ; Wed, 7 May 2008 08:38:27 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id 72C0E5B47; Wed, 7 May 2008 01:21:08 -0700 (PDT) To: Edwin Groothuis In-reply-to: Your message of "Wed, 07 May 2008 16:01:19 +1000." <20080507060119.GA50020@k7.mavetju> Date: Wed, 07 May 2008 01:21:08 -0700 From: Bakul Shah Message-Id: <20080507082108.72C0E5B47@mail.bitblocks.com> Cc: emulation@freebsd.org Subject: Re: QEMU with network boot 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: Wed, 07 May 2008 08:38:28 -0000 On Wed, 07 May 2008 16:01:19 +1000 Edwin Groothuis wrote: > On Wed, May 07, 2008 at 01:43:12PM +1000, Edwin Groothuis wrote: > > On Wed, May 07, 2008 at 01:22:31PM +1000, Edwin Groothuis wrote: > > > When I start the qemu host with "-boot n", I see the DHCP requests > > > and answers going over the wire (... tap device ...) but the NIC > > > keeps saying that it can't get an IP address. This is the network > > > output of it: > > > > http://pxe.dev.aboveaverageurl.com/index.php/PXE_Booting gave the > > hint: I needed a next-server statement. > > I'll submit a PR for the manpage of pxeboot for this, because the > behaviour of the ISC-DHCP has changed with version 3.0.3 about this > (See http://www.mavetju.org/weblog/html/00110.html, I knew I had > seen this before) > > > It's now through to its TFTP phase. Sorry about the noise! > > I have moved the file /boot/pxeboot to my tftpboot directory, it > gets loaded but then QEMU complains about: > > ......TFTP download complete, but Unable to load file. > > And restarts. Not sure what goes wrong... See my message to Freebsd-emulation, dated 23 Apr 2007 12:23:09 PDT. With the patched and recompiled etherboom ROM now it gets to pxeboot loader's OK prompt. NFS MOUNT fails but it gets further than I remember! $ qemu-system-x86_64 \ -net tap -net nic,macaddr=52:54:0:12:34:56,model=rtl8139 \ -option-rom pxe-rtl8129.bin -boot n \ -curses img ------------------------------------------------------------------------------- ....................................................................PXE2done PXE3PXE Loader 1.00 Building the boot loader arguments Relocating the loader and the BTX Starting the BTX loader BTX loader 1.00 BTX version is 1.02 Consoles: internal video/keyboard BIOS drive C: is disk0 PXE version 2.1, real mode entry point @9f00:0680 BIOS 639kB/128967kB available memory FreeBSD/i386 bootstrap loader, Revision 1.1 (bakul@free.bitblocks.com, Tue Apr 24 10:30:38 PDT 2007) pxe_open: server addr: 172.20.0.1 pxe_open: server path: /usr/tftproot pxe_open: gateway ip: 172.20.0.1 NFS MOUNT RPC error: 13 \ can't load 'kernel' Type '?' for a list of commands, 'help' for more detailed help. OK ------------------------------------------------------------------------------- From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 09:07:23 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB2A91065671 for ; Wed, 7 May 2008 09:07:23 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (ns1.bitblocks.com [64.142.15.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9E4208FC20 for ; Wed, 7 May 2008 09:07:23 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id 241405B50; Wed, 7 May 2008 02:07:23 -0700 (PDT) To: Edwin Groothuis In-reply-to: Your message of "Wed, 07 May 2008 01:21:08 PDT." <20080507082108.72C0E5B47@mail.bitblocks.com> Date: Wed, 07 May 2008 02:07:23 -0700 From: Bakul Shah Message-Id: <20080507090723.241405B50@mail.bitblocks.com> Cc: emulation@freebsd.org Subject: Re: QEMU with network boot 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: Wed, 07 May 2008 09:07:23 -0000 On Wed, 07 May 2008 01:21:08 PDT Bakul Shah wrote: > On Wed, 07 May 2008 16:01:19 +1000 Edwin Groothuis wrote > : > > On Wed, May 07, 2008 at 01:43:12PM +1000, Edwin Groothuis wrote: > > > On Wed, May 07, 2008 at 01:22:31PM +1000, Edwin Groothuis wrote: > > See my message to Freebsd-emulation, dated 23 Apr 2007 > 12:23:09 PDT. With the patched and recompiled etherboom ROM > now it gets to pxeboot loader's OK prompt. NFS MOUNT fails > but it gets further than I remember! > > $ qemu-system-x86_64 \ > -net tap -net nic,macaddr=52:54:0:12:34:56,model=rtl8139 \ > -option-rom pxe-rtl8129.bin -boot n \ > -curses img > > NFS MOUNT RPC error: 13 This was due to a misspelled root-path in my dhcpd.conf. Now it boots fine. From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 12:14:40 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE5BF1065674 for ; Wed, 7 May 2008 12:14:40 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE808FC22 for ; Wed, 7 May 2008 12:14:39 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by mail5out.barnet.com.au (Postfix, from userid 1001) id E344A2218A83; Wed, 7 May 2008 22:14:38 +1000 (EST) X-Viruscan-Id: <48219D2E00004F67CBCB82@BarNet> Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail5auth.barnet.com.au", Issuer "*.barnet.com.au" (verified OK)) by mail5.barnet.com.au (Postfix) with ESMTP id A72F121B2BEE; Wed, 7 May 2008 22:14:38 +1000 (EST) Received: from k7.mavetju (k7.mavetju.org [10.251.1.18]) by mail5auth.barnet.com.au (Postfix) with ESMTP id 4880C2218A7B; Wed, 7 May 2008 22:14:38 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id EDC7F9E9; Wed, 7 May 2008 22:14:37 +1000 (EST) Date: Wed, 7 May 2008 22:14:37 +1000 From: Edwin Groothuis To: Bakul Shah Message-ID: <20080507121437.GB44028@k7.mavetju> References: <20080507060119.GA50020@k7.mavetju> <20080507082108.72C0E5B47@mail.bitblocks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080507082108.72C0E5B47@mail.bitblocks.com> User-Agent: Mutt/1.4.2.3i Cc: emulation@freebsd.org Subject: Re: QEMU with network boot 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: Wed, 07 May 2008 12:14:40 -0000 On Wed, May 07, 2008 at 01:21:08AM -0700, Bakul Shah wrote: > > I have moved the file /boot/pxeboot to my tftpboot directory, it > > gets loaded but then QEMU complains about: > > > > ......TFTP download complete, but Unable to load file. > > > > And restarts. Not sure what goes wrong... > > See my message to Freebsd-emulation, dated 23 Apr 2007 > 12:23:09 PDT. With the patched and recompiled etherboom ROM > now it gets to pxeboot loader's OK prompt. NFS MOUNT fails > but it gets further than I remember! Thanks for your reply, I've managed to create my new rtl8139.zrom. And it works like a charm! --------------------- 8< ---------------------------------- Loading 192.168.253.1:/boot/pxeboot ..(PXE)..................................... ................................................................................ ................................................................................ ................................................................................ ................................................................................ .......................................................................done PXE Loader 1.00 Building the boot loader arguments Relocating the loader and the BTX Starting the BTX loader BTX loader 1.00 BTX version is 1.01 Consoles: internal video/keyboard BIOS drive C: is disk0 PXE version 2.1, real mode entry point @9f00:0680 int=0000000d err=00000000 efl=00020002 eip=00000916 eax=0009cb90 ebx=000008eb ecx=00000000 edx=00003c54 esi=00000000 edi=00000000 ebp=0009cf62 esp=000003d2 cs=9f00 ds=9f00 es=0000 fs=0000 gs=0000 ss=9cb9 cs:eip=66 0f 01 97 52 00 0f 20-c0 0c 01 0f 22 c0 66 ff af 6a 00 66 b8 10 00 8e-d0 89 ec 8e d8 8e c0 8e ss:esp=00 00 00 00 71 00 00 00-00 00 00 00 e2 f6 09 00 00 9f b9 9c 00 00 00 00-00 00 00 00 00 00 02 02 BTX halted --------------------- 8< ---------------------------------- Nearly like a charm. Well, the PXE part does work now, but the BTX part is not good. It doesn't matter if I use an pxeboot from an 6.3 system or an 7.0 system. This happens with both emulators/qemu as with emulators/qemu-devel. Any idea where to look now? Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/ From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 12:18:32 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C81541065672 for ; Wed, 7 May 2008 12:18:32 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) by mx1.freebsd.org (Postfix) with ESMTP id 569E58FC1D for ; Wed, 7 May 2008 12:18:32 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by mail5out.barnet.com.au (Postfix, from userid 1001) id AD96B2218A7C; Wed, 7 May 2008 22:18:31 +1000 (EST) X-Viruscan-Id: <48219E17000054693BFCB1@BarNet> Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail5auth.barnet.com.au", Issuer "*.barnet.com.au" (verified OK)) by mail5.barnet.com.au (Postfix) with ESMTP id 631B421B2BF8; Wed, 7 May 2008 22:18:31 +1000 (EST) Received: from k7.mavetju (k7.mavetju.org [10.251.1.18]) by mail5auth.barnet.com.au (Postfix) with ESMTP id CEB582218A3E; Wed, 7 May 2008 22:18:30 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id 8E0D09E9; Wed, 7 May 2008 22:18:30 +1000 (EST) Date: Wed, 7 May 2008 22:18:30 +1000 From: Edwin Groothuis To: Bakul Shah , emulation@freebsd.org Message-ID: <20080507121830.GA81479@k7.mavetju> References: <20080507060119.GA50020@k7.mavetju> <20080507082108.72C0E5B47@mail.bitblocks.com> <20080507121437.GB44028@k7.mavetju> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080507121437.GB44028@k7.mavetju> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: QEMU with network boot 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: Wed, 07 May 2008 12:18:32 -0000 On Wed, May 07, 2008 at 10:14:37PM +1000, Edwin Groothuis wrote: > On Wed, May 07, 2008 at 01:21:08AM -0700, Bakul Shah wrote: > > > I have moved the file /boot/pxeboot to my tftpboot directory, it > > > gets loaded but then QEMU complains about: > > > > > > ......TFTP download complete, but Unable to load file. > > > > > > And restarts. Not sure what goes wrong... > > > > See my message to Freebsd-emulation, dated 23 Apr 2007 > > 12:23:09 PDT. With the patched and recompiled etherboom ROM > > now it gets to pxeboot loader's OK prompt. NFS MOUNT fails > > but it gets further than I remember! > > Thanks for your reply, I've managed to create my new rtl8139.zrom. > And it works like a charm! > > --------------------- 8< ---------------------------------- > Loading 192.168.253.1:/boot/pxeboot ..(PXE)..................................... > ................................................................................ > ................................................................................ > ................................................................................ > ................................................................................ > .......................................................................done > PXE Loader 1.00 > > Building the boot loader arguments > Relocating the loader and the BTX > Starting the BTX loader > > BTX loader 1.00 BTX version is 1.01 > Consoles: internal video/keyboard > BIOS drive C: is disk0 > > PXE version 2.1, real mode entry point @9f00:0680 > > int=0000000d err=00000000 efl=00020002 eip=00000916 > eax=0009cb90 ebx=000008eb ecx=00000000 edx=00003c54 > esi=00000000 edi=00000000 ebp=0009cf62 esp=000003d2 > cs=9f00 ds=9f00 es=0000 fs=0000 gs=0000 ss=9cb9 > cs:eip=66 0f 01 97 52 00 0f 20-c0 0c 01 0f 22 c0 66 ff > af 6a 00 66 b8 10 00 8e-d0 89 ec 8e d8 8e c0 8e > ss:esp=00 00 00 00 71 00 00 00-00 00 00 00 e2 f6 09 00 > 00 9f b9 9c 00 00 00 00-00 00 00 00 00 00 02 02 > > BTX halted > --------------------- 8< ---------------------------------- > > Nearly like a charm. Well, the PXE part does work now, but the BTX > part is not good. > > It doesn't matter if I use an pxeboot from an 6.3 system or an 7.0 > system. This happens with both emulators/qemu as with emulators/qemu-devel. > > Any idea where to look now? http://www.mavetju.org/mail/view_message.php?list=freebsd-emulation&id=2550189 of course. I need to start writing things up on this so others will have less troubles than I have :-) Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/ From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 12:31:08 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B32E10656C6 for ; Wed, 7 May 2008 12:31:08 +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 E84DC8FC13 for ; Wed, 7 May 2008 12:31:07 +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 1JtinZ-0000aK-HP for emulation@freebsd.org; Wed, 07 May 2008 15:31:06 +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 m47CUHcA047513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 7 May 2008 15:30:17 +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 m47CUDII094796; Wed, 7 May 2008 15:30:13 +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 m47CUDdJ094795; Wed, 7 May 2008 15:30:13 +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: Wed, 7 May 2008 15:30:13 +0300 From: Kostik Belousov To: Edwin Groothuis Message-ID: <20080507123013.GC18958@deviant.kiev.zoral.com.ua> References: <20080507060119.GA50020@k7.mavetju> <20080507082108.72C0E5B47@mail.bitblocks.com> <20080507121437.GB44028@k7.mavetju> <20080507121830.GA81479@k7.mavetju> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XiNMnDiJKULrSZtG" Content-Disposition: inline In-Reply-To: <20080507121830.GA81479@k7.mavetju> 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: fd47f7ed058f8bb752f6c36e497d0305 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 2792 [May 07 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {TO: local part of email appears in body} X-SpamTest-Method: none X-SpamTest-Rate: 5 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: emulation@freebsd.org Subject: Re: QEMU with network boot 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: Wed, 07 May 2008 12:31:08 -0000 --XiNMnDiJKULrSZtG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 07, 2008 at 10:18:30PM +1000, Edwin Groothuis wrote: > On Wed, May 07, 2008 at 10:14:37PM +1000, Edwin Groothuis wrote: > > On Wed, May 07, 2008 at 01:21:08AM -0700, Bakul Shah wrote: > > > > I have moved the file /boot/pxeboot to my tftpboot directory, it > > > > gets loaded but then QEMU complains about: > > > >=20 > > > > ......TFTP download complete, but Unable to load file. > > > >=20 > > > > And restarts. Not sure what goes wrong... > > >=20 > > > See my message to Freebsd-emulation, dated 23 Apr 2007 > > > 12:23:09 PDT. With the patched and recompiled etherboom ROM > > > now it gets to pxeboot loader's OK prompt. NFS MOUNT fails > > > but it gets further than I remember! > >=20 > > Thanks for your reply, I've managed to create my new rtl8139.zrom. > > And it works like a charm! > >=20 > > --------------------- 8< ---------------------------------- > > Loading 192.168.253.1:/boot/pxeboot ..(PXE)............................= ......... > > .......................................................................= ......... > > .......................................................................= ......... > > .......................................................................= ......... > > .......................................................................= ......... > > .......................................................................= done =20 > > PXE Loader 1.00 = =20 > > = =20 > > Building the boot loader arguments = =20 > > Relocating the loader and the BTX = =20 > > Starting the BTX loader = =20 > >=20 > > BTX loader 1.00 BTX version is 1.01 = =20 > > Consoles: internal video/keyboard = =20 > > BIOS drive C: is disk0 = =20 > >=20 > > PXE version 2.1, real mode entry point @9f00:0680 = =20 > >=20 > > int=3D0000000d err=3D00000000 efl=3D00020002 eip=3D00000916 = =20 > > eax=3D0009cb90 ebx=3D000008eb ecx=3D00000000 edx=3D00003c54 = =20 > > esi=3D00000000 edi=3D00000000 ebp=3D0009cf62 esp=3D000003d2 = =20 > > cs=3D9f00 ds=3D9f00 es=3D0000 fs=3D0000 gs=3D0000 ss=3D9cb9 = =20 > > cs:eip=3D66 0f 01 97 52 00 0f 20-c0 0c 01 0f 22 c0 66 ff = =20 > > af 6a 00 66 b8 10 00 8e-d0 89 ec 8e d8 8e c0 8e = =20 > > ss:esp=3D00 00 00 00 71 00 00 00-00 00 00 00 e2 f6 09 00 = =20 > > 00 9f b9 9c 00 00 00 00-00 00 00 00 00 00 02 02 = =20 > >=20 > > BTX halted =20 > > --------------------- 8< ---------------------------------- > >=20 > > Nearly like a charm. Well, the PXE part does work now, but the BTX > > part is not good. > >=20 > > It doesn't matter if I use an pxeboot from an 6.3 system or an 7.0 > > system. This happens with both emulators/qemu as with emulators/qemu-de= vel. > >=20 > > Any idea where to look now? >=20 > http://www.mavetju.org/mail/view_message.php?list=3Dfreebsd-emulation&id= =3D2550189 > of course. >=20 > I need to start writing things up on this so others will have less > troubles than I have :-) jhb@ implemented the real-mode BTX and committed it into CVS. It is in HEAD and RELENG_7, and I believe it is in RELENG_6 too. You need either to update your sources or to take new btx from the head of desired branch. --XiNMnDiJKULrSZtG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkghoNQACgkQC3+MBN1Mb4idwwCfWrtOUnJyVkdjlRPXBXbrwWL+ kBsAn2W0ZndgwBHd6CCNLcuXwIyq93cx =Et+X -----END PGP SIGNATURE----- --XiNMnDiJKULrSZtG-- From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 13:58:30 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 5E1A21065670 for ; Wed, 7 May 2008 13:58:30 +0000 (UTC) (envelope-from wilkinsa@obelix.dsto.defence.gov.au) Received: from digger1.defence.gov.au (digger1.defence.gov.au [203.5.217.4]) by mx1.freebsd.org (Postfix) with ESMTP id AB53D8FC23 for ; Wed, 7 May 2008 13:58:29 +0000 (UTC) (envelope-from wilkinsa@obelix.dsto.defence.gov.au) Received: from ednmsw510.dsto.defence.gov.au (ednmsw510.dsto.defence.gov.au [131.185.68.11]) by digger1.defence.gov.au (DSTO/DSTO) with ESMTP id m47ChG6C019290 for ; Wed, 7 May 2008 22:13:19 +0930 (CST) Received: from fmbex510.dsto.defence.gov.au (fmbex510.dsto.defence.gov.au) by ednmsw510.dsto.defence.gov.au (Clearswift SMTPRS 5.2.9) with ESMTP id for ; Wed, 7 May 2008 22:16:18 +0930 Received: from stlex510.dsto.defence.gov.au ([203.6.60.184]) by fmbex510.dsto.defence.gov.au with Microsoft SMTPSVC(6.0.3790.1830); Wed, 7 May 2008 22:46:18 +1000 Received: from obelix.dsto.defence.gov.au ([203.6.60.208]) by stlex510.dsto.defence.gov.au with Microsoft SMTPSVC(6.0.3790.1830); Wed, 7 May 2008 20:46:17 +0800 Received: from obelix.dsto.defence.gov.au (localhost [127.0.0.1]) by obelix.dsto.defence.gov.au (8.14.2/8.14.2) with ESMTP id m47CfmpE002004 for ; Wed, 7 May 2008 20:41:48 +0800 (WST) (envelope-from wilkinsa@obelix.dsto.defence.gov.au) Received: (from wilkinsa@localhost) by obelix.dsto.defence.gov.au (8.14.2/8.14.2/Submit) id m47Cfm3F002003 for freebsd-emulation@freebsd.org; Wed, 7 May 2008 20:41:48 +0800 (WST) (envelope-from wilkinsa) Date: Wed, 7 May 2008 20:41:48 +0800 From: "Wilkinson, Alex" To: freebsd-emulation@freebsd.org Message-ID: <20080507124147.GF1456@stlux503.dsto.defence.gov.au> Mail-Followup-To: freebsd-emulation@freebsd.org References: <20080507060119.GA50020@k7.mavetju> <20080507082108.72C0E5B47@mail.bitblocks.com> <20080507121437.GB44028@k7.mavetju> <20080507121830.GA81479@k7.mavetju> <20080507123013.GC18958@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20080507123013.GC18958@deviant.kiev.zoral.com.ua> Organisation: Defence Science Technology Organisation User-Agent: Mutt/1.5.17 (2007-11-01) X-OriginalArrivalTime: 07 May 2008 12:46:17.0659 (UTC) FILETIME=[57BF00B0:01C8B040] X-TM-AS-Product-Ver: SMEX-7.0.0.1526-5.5.1026-15894.003 X-TM-AS-Result: No--1.204000-0.000000-31 Content-Transfer-Encoding: 7bit Subject: Re: QEMU with network boot 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: Wed, 07 May 2008 13:58:30 -0000 0n Wed, May 07, 2008 at 03:30:13PM +0300, Kostik Belousov wrote: >jhb@ implemented the real-mode BTX and committed it into CVS. It is in >HEAD and RELENG_7, and I believe it is in RELENG_6 too. You need either >to update your sources or to take new btx from the head of desired branch. What is "real-mode BTX" ? -aW IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 13:58:30 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 BC5BD1065673 for ; Wed, 7 May 2008 13:58:30 +0000 (UTC) (envelope-from wilkinsa@obelix.dsto.defence.gov.au) Received: from digger1.defence.gov.au (digger1.defence.gov.au [203.5.217.4]) by mx1.freebsd.org (Postfix) with ESMTP id 1760A8FC25 for ; Wed, 7 May 2008 13:58:29 +0000 (UTC) (envelope-from wilkinsa@obelix.dsto.defence.gov.au) Received: from ednmsw510.dsto.defence.gov.au (ednmsw510.dsto.defence.gov.au [131.185.68.11]) by digger1.defence.gov.au (DSTO/DSTO) with ESMTP id m47Bq8LS000953 for ; Wed, 7 May 2008 21:22:08 +0930 (CST) Received: from fmbex510.dsto.defence.gov.au (fmbex510.dsto.defence.gov.au) by ednmsw510.dsto.defence.gov.au (Clearswift SMTPRS 5.2.9) with ESMTP id for ; Wed, 7 May 2008 21:25:28 +0930 Received: from stlex510.dsto.defence.gov.au ([203.6.60.184]) by fmbex510.dsto.defence.gov.au with Microsoft SMTPSVC(6.0.3790.1830); Wed, 7 May 2008 21:55:27 +1000 Received: from obelix.dsto.defence.gov.au ([203.6.60.208]) by stlex510.dsto.defence.gov.au with Microsoft SMTPSVC(6.0.3790.1830); Wed, 7 May 2008 19:55:27 +0800 Received: from obelix.dsto.defence.gov.au (localhost [127.0.0.1]) by obelix.dsto.defence.gov.au (8.14.2/8.14.2) with ESMTP id m47BovEZ001744 for ; Wed, 7 May 2008 19:50:57 +0800 (WST) (envelope-from wilkinsa@obelix.dsto.defence.gov.au) Received: (from wilkinsa@localhost) by obelix.dsto.defence.gov.au (8.14.2/8.14.2/Submit) id m47BoBdM001739 for freebsd-emulation@freebsd.org; Wed, 7 May 2008 19:50:11 +0800 (WST) (envelope-from wilkinsa) Date: Wed, 7 May 2008 19:50:11 +0800 From: "Wilkinson, Alex" To: freebsd-emulation@freebsd.org Message-ID: <20080507115011.GB1456@stlux503.dsto.defence.gov.au> Mail-Followup-To: freebsd-emulation@freebsd.org References: <20080507032231.GA29548@k7.mavetju> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20080507032231.GA29548@k7.mavetju> Organisation: Defence Science Technology Organisation User-Agent: Mutt/1.5.17 (2007-11-01) X-OriginalArrivalTime: 07 May 2008 11:55:27.0305 (UTC) FILETIME=[3D97EB90:01C8B039] X-TM-AS-Product-Ver: SMEX-7.0.0.1526-5.5.1026-15894.003 X-TM-AS-Result: No--9.874000-0.000000-31 Content-Transfer-Encoding: 7bit Subject: Re: QEMU with network boot 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: Wed, 07 May 2008 13:58:30 -0000 0n Wed, May 07, 2008 at 01:22:31PM +1000, Edwin Groothuis wrote: > --------------------------------------------------------------------------- > TIME: 13:18:21.306194 > IP: > (52:54:00:12:34:56) > (ff:ff:ff:ff:ff:ff) > OP: 1 (BOOTPREQUEST) > HTYPE: 1 (Ethernet) > HLEN: 6 > HOPS: 0 > XID: 00157da3 > SECS: 0 > FLAGS: 0 > CIADDR: 0.0.0.0 > YIADDR: 0.0.0.0 > SIADDR: 0.0.0.0 > GIADDR: 0.0.0.0 > CHADDR: 52:54:00:12:34:56:00:00:00:00:00:00:00:00:00:00 > SNAME: . > FNAME: . > OPTION: 53 ( 1) DHCP message type 1 (DHCPDISCOVER) > OPTION: 57 ( 2) Maximum DHCP message size 1500 > OPTION: 60 ( 13) Vendor class identifier Etherboot-5.4 > OPTION: 55 ( 4) Parameter Request List 1 (Subnet mask) > 3 (Routers) > 12 (Host name) > 43 (Vendor specific info) > > OPTION: 150 ( 11) ??? af050110ec8139b1 ......9. > 020300 ... > --------------------------------------------------------------------------- Edwin, I'm curious, what tool did you use to gather this output ? -aW IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 16:03:39 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2027310656AB for ; Wed, 7 May 2008 16:03:39 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (bitblocks.com [64.142.15.60]) by mx1.freebsd.org (Postfix) with ESMTP id 0AF408FC2F for ; Wed, 7 May 2008 16:03:38 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id 9784E5B47; Wed, 7 May 2008 09:03:38 -0700 (PDT) To: Edwin Groothuis In-reply-to: Your message of "Wed, 07 May 2008 22:14:37 +1000." <20080507121437.GB44028@k7.mavetju> Date: Wed, 07 May 2008 09:03:38 -0700 From: Bakul Shah Message-Id: <20080507160338.9784E5B47@mail.bitblocks.com> Cc: emulation@freebsd.org Subject: Re: QEMU with network boot 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: Wed, 07 May 2008 16:03:39 -0000 On Wed, 07 May 2008 22:14:37 +1000 Edwin Groothuis wrote: > Nearly like a charm. Well, the PXE part does work now, but the BTX > part is not good. > > It doesn't matter if I use an pxeboot from an 6.3 system or an 7.0 > system. This happens with both emulators/qemu as with emulators/qemu-devel. > > Any idea where to look now? I should've mentioned I am using FreeBSD-current which has a working pxeboot thanks to jhb. It netboots with my patched etherboot bios but fails with bioses distributed with qemu. My year old patch works around etherboot's length related bug -- a TFTP data mode packet with length=0 confuses qemu's roms. I just realized we can make a fix elsewhere to make the stock qemu bios work! It is a complicated fix so be prepared to really understand it. Ready? Here is how: echo >> $tftproot/boot/pxebot :-) The default NE2000 NIC works fine too but you may want to use rtl8139 for better performance. From owner-freebsd-emulation@FreeBSD.ORG Wed May 7 16:27:14 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 29D7A1065672 for ; Wed, 7 May 2008 16:27:14 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (bitblocks.com [64.142.15.60]) by mx1.freebsd.org (Postfix) with ESMTP id 10BFB8FC16 for ; Wed, 7 May 2008 16:27:14 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id 73A3A5B47; Wed, 7 May 2008 09:27:13 -0700 (PDT) To: Bruce Evans In-reply-to: Your message of "Wed, 07 May 2008 15:54:56 +1000." <20080507154914.W52560@besplex.bde.org> Date: Wed, 07 May 2008 09:27:13 -0700 From: Bakul Shah Message-Id: <20080507162713.73A3A5B47@mail.bitblocks.com> Cc: freebsd-emulation@FreeBSD.org Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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: Wed, 07 May 2008 16:27:14 -0000 On Wed, 07 May 2008 15:54:56 +1000 Bruce Evans wrote: > On Tue, 6 May 2008, Bakul Shah wrote: > > > On Tue, 06 May 2008 22:02:28 +0200 Teufel wrote: > >> Bakul Shah wrote: > >>>> at needs to be done to fix that? > >>> > >>> Comment it out in amd64/amd64/trap.c! > > Bletch. > > >> getting rid of the message, yes.. but without further issues? > > > > The message is there "because you are not supposed to do it" > > s/you/kqemu/ (or interpret what you are not supposed to do as "running kqemu" > . > > > See for instance > > > > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=100953+0+archive/2007/freebsd- > emulation/20070415.freebsd-emulation > > > > This seems to have not caused any problem in practice. And > > any way taking out the message doesn't change the essential > > behavior (the invariant is still broken) but it can speed up > > your emulation considerably. > > I should have changed it to a panic long ago. That would give the correct > number of messages (1) :-). Too late now for you to go fundamentalist :-) > i386 still doesn't even print a message (perhaps it never did). The > bug would probably never have existed in any FreeBSD version of kqemu if > i386 had had enough invariant checking. It does (in isa/npx.c) and I've disabled it! I seem to recall it is not just qemu but also some ndis drivers that trigger this fpudna/npxdna message? Didn't someone (Attilio?) has ported dragonfly code to allow FPU register use in kernel mode? Whatever happened to it? From owner-freebsd-emulation@FreeBSD.ORG Thu May 8 06:15:14 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 E1A35106566B for ; Thu, 8 May 2008 06:15:14 +0000 (UTC) (envelope-from higinsjessy123@gmail.com) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.235]) by mx1.freebsd.org (Postfix) with ESMTP id 931C68FC20 for ; Thu, 8 May 2008 06:15:14 +0000 (UTC) (envelope-from higinsjessy123@gmail.com) Received: by qb-out-0506.google.com with SMTP id o21so792100qba.7 for ; Wed, 07 May 2008 23:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:reply-to:from:to:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; bh=X3KpTlyEEDx89lDUvvygdyZC3GUatLNh3GoyUG072tU=; b=HSvNJbWqCHCChjtpzXoT91ViQw7eafjjuU/zPxaQbG7Ckg0dyVk2UhnAvErWl8wAmwlitAr2ly4ouPRJ0hwdvjghDuJsuTG5mrgxm/3a/VfVJPI3pl6IYkcF7HVI5bVMTMLJhPmecyxYVf6j6ia5FvBqvkXJRRQzTtqji8TByT4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:reply-to:from:to:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; b=EUY3lmJ+o182SWOJO0wPJA3a7JSQIJZVDrvK6+McG8q20aE2ktrBiBgcicSHWobUoKPfbTdBKyCiz/pK+LTgkqCfuOsb0zddhRkmIpd+Yii7j/PY45EYLAXC3PKjLVnIjBtiBPUFPKrgiBJLyrORij9GJZGvcWX6yD5MtqiG/xk= Received: by 10.142.255.12 with SMTP id c12mr1239492wfi.26.1210226346374; Wed, 07 May 2008 22:59:06 -0700 (PDT) Received: from owner-20877af31 ( [67.180.170.182]) by mx.google.com with ESMTPS id 30sm6487065wfc.5.2008.05.07.22.59.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 May 2008 22:59:05 -0700 (PDT) Message-ID: <015d5b17$39575$01079586895949@owner-20877af31> From: "Christopher Simon" To: freebsd-emulation@freebsd.org Date: Wed, 7 May 2008 23:00:33 -0700 MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: My e-mail client v1.0 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Subject: need a DRIVER for WINE TASTING in Santa Barbara??? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Christopher Simon List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2008 06:15:15 -0000 Christopher Simon 805-291-7319 WEBSITE: WWW.IDRIVEUEVERYWHERE.COM Experienced male driver will happily drive you through wine tasting country near Santa Barbara in the beautiful Santa Ynez Valley. You have only to enjoy the fun of sight, sound and drink without the hassles or worries. (must provide vehicle) - References upon request. TRUSTED, RELIABLE and FUN * Make your reservations *Available 24/7* I charge an affordable hourly rate of $25.00 Tipping is allowed Contact: Christopher Simon (805) 291-7319 NOTE: for situations where you need more than one driver I have two friends that also drive. From owner-freebsd-emulation@FreeBSD.ORG Thu May 8 12:00:17 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 1CE9F10656CF for ; Thu, 8 May 2008 12:00:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by mx1.freebsd.org (Postfix) with ESMTP id A83838FC1F for ; Thu, 8 May 2008 12:00:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c220-239-252-11.carlnfd3.nsw.optusnet.com.au (c220-239-252-11.carlnfd3.nsw.optusnet.com.au [220.239.252.11]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m48BxvN9017484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 May 2008 22:00:01 +1000 Date: Thu, 8 May 2008 21:59:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Bakul Shah In-Reply-To: <20080507162713.73A3A5B47@mail.bitblocks.com> Message-ID: <20080508195843.G17500@delplex.bde.org> References: <20080507162713.73A3A5B47@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@freebsd.org Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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: Thu, 08 May 2008 12:00:17 -0000 On Wed, 7 May 2008, Bakul Shah wrote: > On Wed, 07 May 2008 15:54:56 +1000 Bruce Evans wrote: >> On Tue, 6 May 2008, Bakul Shah wrote: >>> See for instance >>> >>> http://docs.freebsd.org/cgi/getmsg.cgi?fetch=100953+0+archive/2007/freebsd- >> emulation/20070415.freebsd-emulation >>> >>> This seems to have not caused any problem in practice. And >>> any way taking out the message doesn't change the essential >>> behavior (the invariant is still broken) but it can speed up >>> your emulation considerably. >> >> I should have changed it to a panic long ago. That would give the correct >> number of messages (1) :-). > > Too late now for you to go fundamentalist :-) > >> i386 still doesn't even print a message (perhaps it never did). The >> bug would probably never have existed in any FreeBSD version of kqemu if >> i386 had had enough invariant checking. > > It does (in isa/npx.c) and I've disabled it! Not too late to go fundamentalist for that :-). I wrote it correctly. It paniced, but it was broken to a printf in rev.1.131 when I wasn't watching closely enough (though the log claims that I reviewed the patch, ISTR looking mainly at the parts in machdep.c). The message in npx.c is actually about violation of an even more fundamental invariant -- the invariant that owning the FPU includes having the TS flag clear so that DNA traps cannot occur. The bug in kqemu seems to be mismanagement of the TS flag related to this. I forget if it is the host or the target TS flag that seems to be mismanaged. For the target, it would take a bug in the virtualization of the TS flag to break this invariant (assuming no related bugs in the target kernel). The message in amd64/machdep.c is about violation of the invariant that the kernel cannot cause DNA traps. Spurious DNA traps in the target kernel might be caused either by violation of the previous invariant (then we might get a spurious DNA trap as part of non-broken target kernel FPU handling, after we have properly acquired ownership of the FPU). Non-spurious but wrong DNA traps in the host kernel might be caused by not properly acquiring ownership of the FPU before using it. This bug would be easier to implement, but I now remember more of the previous discussion and doubt that it is the bug in kqemu. It was said that kqemu never uses the FPU directly (not even for fxsave/fxrstor?) The second bug was implemented 3 years ago in the i386 linux emulator in rev.1.136 of linux_sysvec.c, but the bug is not detected because there is not even a printf about it in the i386 trap.c :-( and it is not a bug at the level of npx.c. The implementation is simply to hack on the FPU directly to set the control word. This is also a layering violation, but the API intended to be used for this initialization (npxinit()) is no longer used for this and no longer works for this. Direct hacking on the FPU works almost correctly here. It mainly wastes time by defeating the lazy reinitialization of the FPU on exec. > I seem to recall it is not just qemu but also some ndis > drivers that trigger this fpudna/npxdna message? I think that is from just hacking on the FPU directly. Windows drivers could easily have a bug like that. > Didn't > someone (Attilio?) has ported dragonfly code to allow FPU > register use in kernel mode? Whatever happened to it? I objected to it, and Attilio found better things to work on. Parts of it give a cleaner implementation of allowing controlled use of the FPU in the kernel, but even it didn't allow arbitrary use (as might be necessary for bad Windows drivers), and there are no known useful uses for the FPU/SSE in the kernel except on old systems: - Copying through SSE2 can be up to twice as fast as copying through 32-bit integer registers, but not-so-old systems in 64-bit mode can use 64-bit integer registers. Also, it is hard to find a real application where the speedups possible from copying through SSE2 affects more than the noise, since it takes very large data for copying running at multi-GB/S to take very long, but very large data is too large to cache and copying through SSE2 makes no difference in the uncached case.) - some multimedia instructions might be useful in the kernel. But it is hard to find a useful use that executes enough of them to justify a FPU context switch just to use them. Bruce From owner-freebsd-emulation@FreeBSD.ORG Thu May 8 12:54:55 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 C6D361065679 for ; Thu, 8 May 2008 12:54:55 +0000 (UTC) (envelope-from nirv199@yahoo.com) Received: from web37105.mail.mud.yahoo.com (web37105.mail.mud.yahoo.com [209.191.85.107]) by mx1.freebsd.org (Postfix) with SMTP id 72DC28FC13 for ; Thu, 8 May 2008 12:54:55 +0000 (UTC) (envelope-from nirv199@yahoo.com) Received: (qmail 73711 invoked by uid 60001); 8 May 2008 12:28:14 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=L0SlWwtA3F4S8aKUUQ+2HkHhuB8YCOBvljV7b2hFdu4xAAmecbH7Fvbcfaoy6F436+oRa9QQOQimAZXyXQOu0DwLall5z5rE6RLTqjGoEyLGII0SOb0P1qhKaU16/MZ1/KHP502fEZX6Ds3fpHCBYbLFQkCLMaN0Rw0j6S68fQk=; X-YMail-OSG: cHa36eYVM1l_nm0rO2Umy64up__c5MkTFyaeovPlEWdsVqfZjdZyOF0e5mX_bHeL1csLxcZ5c9_lde1pmNig0mlhTGAvXKgHmvPNus0I0z2JAYxu5voMbQvOhg-- Received: from [189.44.172.38] by web37105.mail.mud.yahoo.com via HTTP; Thu, 08 May 2008 05:28:14 PDT Date: Thu, 8 May 2008 05:28:14 -0700 (PDT) From: Paulo Roberto To: freebsd-emulation@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <378987.73328.qm@web37105.mail.mud.yahoo.com> Subject: dynamips / dynagen network interface problem on 802.1q 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: Thu, 08 May 2008 12:54:55 -0000 Hi, Not sure if this is the correct mail list to post this question, please excuse me if not. I updated to the lateste devel-version of both dynamips+dynagen ports (emulators), and I can only get the ethernet virtual switch to output untagged frames out my interface. When using dot1q, no frames are sent over the wire. The strange part is that freebsd tcpdump sees those dot1q tagged frames, but the interface (using bge) does not wire them. I have compiled the kernel with both bge and vlan support. FreeBSD 6.3. Dynagen config: [[ETHSW SW]] 0 = dot1q 1 NIO_gen_eth:bge0 Anyone have any idea of what might be wrong? Thanks ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From owner-freebsd-emulation@FreeBSD.ORG Fri May 9 15:03:19 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 481401065671 for ; Fri, 9 May 2008 15:03:19 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id B795A8FC7C for ; Fri, 9 May 2008 15:03:18 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so2720283fgb.35 for ; Fri, 09 May 2008 08:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:to:cc:subject:in-reply-to:message-id:references:user-agent:mime-version:content-type:from; bh=UKCaZVO26QtS7sefFLuDGzboZTT5iLSeWRiS6UtX1QA=; b=kglfH4Tn6SAYz8rDi9pyQCa5VuEeNUJ+ZGDTYuoT/jFSF/oRluXYJb1CyxfY/D62nN0vk4crkM3Oex2TGdjN9d1CvD5AL7p65Qq0ZZOFgH3mbTEbc5RKD6l3Q7kSraNqbFBnv1jCWN0nftNzzubV46h0+hmSFCWmCbb7+k70Qlk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:to:cc:subject:in-reply-to:message-id:references:user-agent:mime-version:content-type:from; b=VBcR+sJ/QUsIQqbAryGpQbbCXAD1qY+xs6eH1nKobhQ71VV//NOIYLGKVLtqVB0/HmF2iAGe0bZqy/yfwEBjZURp5loMMX209n+FLcbHsvBemQW0gie7Pum+3ZdEJE915rH+8krKTAULPvIdMD/5JTuaHm8smoUcfy6YlaQuK/0= Received: by 10.86.1.11 with SMTP id 11mr8662235fga.27.1210345397230; Fri, 09 May 2008 08:03:17 -0700 (PDT) Received: from ora.chd.net ( [81.200.6.196]) by mx.google.com with ESMTPS id d6sm4416461fga.2.2008.05.09.08.03.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 May 2008 08:03:14 -0700 (PDT) Date: Fri, 9 May 2008 19:02:05 +0400 (MSD) To: freebsd-emulation@freebsd.org In-Reply-To: <20080508210641.GA81647@freebsd.org> Message-ID: References: <20080506214738.GA31134@freebsd.org> <20080508165244.GA68088@freebsd.org> <20080508170819.GA68720@freebsd.org> <20080508172503.GA69463@freebsd.org> <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> User-Agent: Alpine 1.10 (BSF 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed From: Chagin Dmitry Cc: Chagin Dmitry Subject: [patch] linux-x86-64 (for comments) 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: Fri, 09 May 2008 15:03:19 -0000 hi. Recently with Roman have decided to make emulation linux-x86-64. Here a patch: http://81.200.6.196/linux-x86-64.diff.tar.gz That's made: created module infrastructure. existing files are copied (removed unsupported syscalls, commented some code, etc...) signals unsupported yet. The module is compiled, but linux64 binaries hangs at loading libc: ora# /compat/linux/bin/pwd 6078: 6078: file=libc.so.6 [0]; needed by /compat/linux/bin/pwd [0] 6078: find library=libc.so.6 [0]; searching 6078: search cache=/etc/ld.so.cache 6078: search path=/lib64/tls:/lib64:/usr/lib64/tls:/usr/lib64 (system search path) 6078: trying file=/lib64/tls/libc.so.6 6078: trying file=/lib64/libc.so.6 /compat/linux/bin/pwd: error while loading shared libraries: /lib64/libc.so.6: c annot read file data: Error 9 Work proceeds further :) That is necessary: review && comments about modificated existing sys/compat/linux files. The help from glibc experts - now i shall not understand where it is fallen off. thnx! -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Fri May 9 15:14:10 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 268371065674 for ; Fri, 9 May 2008 15:14:10 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 9D58E8FC2B for ; Fri, 9 May 2008 15:14:09 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so2728331fgb.35 for ; Fri, 09 May 2008 08:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:to:cc:subject:in-reply-to:message-id:references:user-agent:mime-version:content-type:from; bh=7Wk64rg4oW0EkJ3YE5jBJA7+hFw2GZFVkfglK+AWC+4=; b=GNtHvvv+02Jw9vJVTg9V4gyT/Ekbl8h6mCznx3fp/FStV3GqwTn4MHbY6SPbqE1VE8AmuSdHxMtbYkeMmcuWLvDyzOe+RGpNFkY/5Fj4/DY+7TeAPKKfB3IaLDNi5n+aO7nEaL+NleNXA1/SFa1pXk4OX0WbHqBkJ/fz0HQpWv4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:to:cc:subject:in-reply-to:message-id:references:user-agent:mime-version:content-type:from; b=ZRW66PVwGjbN4C0x96g+h7yv+WLiGBcvNPIIqpeb3PS7jDozjL1B1VLw2V+M6Pu5P+IXJeB7yQl6Ip0RkkGmUL34g0SesNrhlW9HFIQc9G8WJhomEmkDcYRc+fqknUC1YjjRd8NOa7QSxpOdphsGHUEE6wS8gbutLak8d+0yfb0= Received: by 10.86.66.19 with SMTP id o19mr8708480fga.9.1210346048400; Fri, 09 May 2008 08:14:08 -0700 (PDT) Received: from ora.chd.net ( [81.200.6.196]) by mx.google.com with ESMTPS id 12sm4418908fgg.0.2008.05.09.08.14.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 May 2008 08:14:03 -0700 (PDT) Date: Fri, 9 May 2008 19:12:57 +0400 (MSD) To: Chagin Dmitry In-Reply-To: Message-ID: References: <20080506214738.GA31134@freebsd.org> <20080508165244.GA68088@freebsd.org> <20080508170819.GA68720@freebsd.org> <20080508172503.GA69463@freebsd.org> <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> User-Agent: Alpine 1.10 (BSF 962 2008-03-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="2094977263-2078087853-1210345979=:3602" From: Chagin Dmitry Cc: freebsd-emulation@freebsd.org Subject: Re: [patch] linux-x86-64 (for comments) 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: Fri, 09 May 2008 15:14:10 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2094977263-2078087853-1210345979=:3602 Content-Type: TEXT/PLAIN; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 8BIT On Fri, 9 May 2008, Chagin Dmitry wrote: > ora# /compat/linux/bin/pwd > 6078: > 6078: file=libc.so.6 [0]; needed by /compat/linux/bin/pwd [0] > 6078: find library=libc.so.6 [0]; searching > 6078: search cache=/etc/ld.so.cache > 6078: search path=/lib64/tls:/lib64:/usr/lib64/tls:/usr/lib64 > (system search path) > 6078: trying file=/lib64/tls/libc.so.6 > 6078: trying file=/lib64/libc.so.6 > /compat/linux/bin/pwd: error while loading shared libraries: > /lib64/libc.so.6: c > annot read file data: Error 9 ups... incorrect example, sorry. ldconfig hangs ora# /compat/linux/sbin/ldconfig -r /compat/linux Ошибка сегментации(core dumped) traced syscalls: newuname brk(0) brk(0x6adf20) arch_prctl(0x1002, 0x6ad860) brk(0x6cef20) brk(0x6cf000) pid 6362 (ldconfig), uid 0: exited on signal 11 (core dumped) thnx! -- Have fun! chd --2094977263-2078087853-1210345979=:3602-- From owner-freebsd-emulation@FreeBSD.ORG Fri May 9 22:12:11 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 78DE3106564A for ; Fri, 9 May 2008 22:12:11 +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 DA23D8FC0A for ; Fri, 9 May 2008 22:12:10 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: by gwyn.kn-bremen.de (Postfix, from userid 10) id E34E32D18D2; Sat, 10 May 2008 00:12:08 +0200 (CEST) Received: from saturn.kn-bremen.de (nox@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.14.2/8.13.8) with ESMTP id m49M9PWk013824; Sat, 10 May 2008 00:09:25 +0200 (CEST) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.14.2/8.13.6/Submit) id m49M9N94013823; Sat, 10 May 2008 00:09:23 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Sat, 10 May 2008 00:09:22 +0200 To: Bruce Evans Message-ID: <20080509220922.GA13480@saturn.kn-bremen.de> Mail-Followup-To: Bruce Evans , Bakul Shah , freebsd-emulation@freebsd.org References: <20080507162713.73A3A5B47@mail.bitblocks.com> <20080508195843.G17500@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080508195843.G17500@delplex.bde.org> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-emulation@freebsd.org Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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: Fri, 09 May 2008 22:12:11 -0000 On Thu, May 08, 2008 at 09:59:57PM +1000, Bruce Evans wrote: > On Wed, 7 May 2008, Bakul Shah wrote: > >> On Wed, 07 May 2008 15:54:56 +1000 Bruce Evans >> wrote: >>> On Tue, 6 May 2008, Bakul Shah wrote: >>>> See for instance >>>> >>>> http://docs.freebsd.org/cgi/getmsg.cgi?fetch=100953+0+archive/2007/freebsd- >>> emulation/20070415.freebsd-emulation >>>> >>>> This seems to have not caused any problem in practice. And >>>> any way taking out the message doesn't change the essential >>>> behavior (the invariant is still broken) but it can speed up >>>> your emulation considerably. >>> >>> I should have changed it to a panic long ago. That would give the >>> correct >>> number of messages (1) :-). >> >> Too late now for you to go fundamentalist :-) >> >>> i386 still doesn't even print a message (perhaps it never did). The >>> bug would probably never have existed in any FreeBSD version of kqemu if >>> i386 had had enough invariant checking. >> >> It does (in isa/npx.c) and I've disabled it! > > Not too late to go fundamentalist for that :-). I wrote it correctly. > It paniced, but it was broken to a printf in rev.1.131 when I wasn't > watching closely enough (though the log claims that I reviewed the > patch, ISTR looking mainly at the parts in machdep.c). > > The message in npx.c is actually about violation of an even more > fundamental invariant -- the invariant that owning the FPU includes > having the TS flag clear so that DNA traps cannot occur. The bug in > kqemu seems to be mismanagement of the TS flag related to this. I > forget if it is the host or the target TS flag that seems to be mismanaged. > For the target, it would take a bug in the virtualization of the TS flag > to break this invariant (assuming no related bugs in the target kernel). > Well the `fpcurthread == curthread' bug has been fixed quite a while ago already, or do you mean another one? > The message in amd64/machdep.c is about violation of the invariant > that the kernel cannot cause DNA traps. Spurious DNA traps in the > target kernel might be caused either by violation of the previous > invariant (then we might get a spurious DNA trap as part of non-broken > target kernel FPU handling, after we have properly acquired ownership > of the FPU). Non-spurious but wrong DNA traps in the host kernel might > be caused by not properly acquiring ownership of the FPU before using > it. This bug would be easier to implement, but I now remember more > of the previous discussion and doubt that it is the bug in kqemu. It > was said that kqemu never uses the FPU directly (not even for > fxsave/fxrstor?) > Okay I _think_ I know a little more about this now... kqemu itself doesn't use the fpu, but the guest code it runs can, and in that case the DNA trap is just used for (host) lazy fpu context switching like as if the code was running in userland regularly. And I just tested the following patch that should get rid of the message by calling fpudna/npxdna directly (files/patch-fpucontext is the interesting part:) Index: Makefile =================================================================== RCS file: /home/pcvs/ports/emulators/kqemu-kmod/Makefile,v retrieving revision 1.23 diff -u -p -r1.23 Makefile --- Makefile 1 May 2008 13:29:16 -0000 1.23 +++ Makefile 9 May 2008 19:53:08 -0000 @@ -7,7 +7,7 @@ PORTNAME= kqemu PORTVERSION= 1.3.0.p11 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= emulators kld MASTER_SITES= http://fabrice.bellard.free.fr/qemu/ \ http://qemu.org/ \ Index: files/patch-tssworkaround =================================================================== RCS file: /home/pcvs/ports/emulators/kqemu-kmod/files/patch-tssworkaround,v retrieving revision 1.1 diff -u -p -r1.1 patch-tssworkaround --- files/patch-tssworkaround 1 May 2008 13:29:16 -0000 1.1 +++ files/patch-tssworkaround 9 May 2008 19:34:12 -0000 @@ -1,8 +1,8 @@ Index: kqemu-freebsd.c -@@ -33,6 +33,11 @@ - - #include - #include +@@ -38,6 +38,11 @@ + #else + #include + #endif +#ifdef __x86_64__ +#include +#include @@ -11,13 +11,13 @@ Index: kqemu-freebsd.c #include "kqemu-kernel.h" -@@ -234,6 +239,19 @@ +@@ -248,6 +253,19 @@ va_end(ap); } +#ifdef __x86_64__ +/* called with interrupts disabled */ -+void CDECL kqemu_tss_workaround(void) ++void CDECL kqemu_tss_fixup(void) +{ + int gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); + @@ -49,7 +49,7 @@ Index: common/kernel.c +#ifdef __FreeBSD__ +#ifdef __x86_64__ + spin_lock(&g->lock); -+ kqemu_tss_workaround(); ++ kqemu_tss_fixup(); + spin_unlock(&g->lock); +#endif +#endif @@ -63,7 +63,7 @@ Index: kqemu-kernel.h +#ifdef __FreeBSD__ +#ifdef __x86_64__ -+void CDECL kqemu_tss_workaround(void); ++void CDECL kqemu_tss_fixup(void); +#endif +#endif + Index: files/patch-fpucontext @@ -0,0 +1,76 @@ +Index: common/kernel.c +@@ -1240,6 +1240,9 @@ + case MON_REQ_EXCEPTION: + exec_exception(s->arg0); + break; ++ case MON_REQ_LOADFPUCONTEXT: ++ kqemu_loadfpucontext(s->arg0); ++ break; + default: + kqemu_log("invalid mon request: %d\n", s->mon_req); + break; +Index: common/kqemu_int.h +@@ -523,6 +523,7 @@ + MON_REQ_LOCK_USER_PAGE, + MON_REQ_UNLOCK_USER_PAGE, + MON_REQ_EXCEPTION, ++ MON_REQ_LOADFPUCONTEXT, + } MonitorRequest; + + #define INTERRUPT_ENTRY_SIZE 16 +Index: common/monitor.c +@@ -1995,8 +1995,13 @@ + raise_exception_err(s, EXCP07_PREX, 0); + } else { + /* the host needs to restore the FPU state for us */ ++#ifndef __FreeBSD__ + s->mon_req = MON_REQ_EXCEPTION; + s->arg0 = 0x07; ++#else ++ s->mon_req = MON_REQ_LOADFPUCONTEXT; ++ s->arg0 = (unsigned long)s->cpu_state.cpl; ++#endif + monitor2kernel1(s); + } + } +Index: kqemu-freebsd.c +@@ -33,6 +33,11 @@ + + #include + #include ++#ifdef __x86_64__ ++#include ++#else ++#include ++#endif + + #include "kqemu-kernel.h" + +@@ -172,6 +177,15 @@ + { + } + ++void CDECL kqemu_loadfpucontext(unsigned long cpl) ++{ ++#ifdef __x86_64__ ++ fpudna(); ++#else ++ npxdna(); ++#endif ++} ++ + #if __FreeBSD_version < 500000 + static int + curpriority_cmp(struct proc *p) +Index: kqemu-kernel.h +@@ -40,6 +40,10 @@ + void * CDECL kqemu_io_map(unsigned long page_index, unsigned int size); + void CDECL kqemu_io_unmap(void *ptr, unsigned int size); + ++#ifdef __FreeBSD__ ++void CDECL kqemu_loadfpucontext(unsigned long cpl); ++#endif ++ + int CDECL kqemu_schedule(void); + + void CDECL kqemu_log(const char *fmt, ...); From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 10:50:44 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 803191065670 for ; Sat, 10 May 2008 10:50:44 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 32CDC8FC1A for ; Sat, 10 May 2008 10:50:43 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 692A967EF78; Sat, 10 May 2008 12:50:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9I7ynzVHp3Ak; Sat, 10 May 2008 12:50:09 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 0756F67DBF6; Sat, 10 May 2008 12:50:08 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m4AAo8IG071291; Sat, 10 May 2008 12:50:08 +0200 (CEST) (envelope-from rdivacky) Date: Sat, 10 May 2008 12:50:08 +0200 From: Roman Divacky To: Chagin Dmitry Message-ID: <20080510105008.GA71225@freebsd.org> References: <20080508165244.GA68088@freebsd.org> <20080508170819.GA68720@freebsd.org> <20080508172503.GA69463@freebsd.org> <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: [patch] linux-x86-64 (for comments) 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, 10 May 2008 10:50:44 -0000 On Fri, May 09, 2008 at 07:02:05PM +0400, Chagin Dmitry wrote: > > hi. > > Recently with Roman have decided to make emulation linux-x86-64. > Here a patch: http://81.200.6.196/linux-x86-64.diff.tar.gz witten ~# fetch http://81.200.6.196/linux-x86-64.diff.tar.gz fetch: http://81.200.6.196/linux-x86-64.diff.tar.gz: No route to host > That's made: > created module infrastructure. > existing files are copied (removed unsupported syscalls, > commented some code, etc...) signals unsupported yet. > The module is compiled, but linux64 binaries hangs at loading libc: > > ora# /compat/linux/bin/pwd > 6078: > 6078: file=libc.so.6 [0]; needed by /compat/linux/bin/pwd [0] > 6078: find library=libc.so.6 [0]; searching > 6078: search cache=/etc/ld.so.cache > 6078: search path=/lib64/tls:/lib64:/usr/lib64/tls:/usr/lib64 > (system search path) > 6078: trying file=/lib64/tls/libc.so.6 > 6078: trying file=/lib64/libc.so.6 > /compat/linux/bin/pwd: error while loading shared libraries: > /lib64/libc.so.6: c > annot read file data: Error 9 > > Work proceeds further :) > > That is necessary: review && comments about modificated existing > sys/compat/linux files. The help from glibc experts - now i shall not > understand where it is fallen off. Dmitry has fixed this (a wrong AUX entry). I think we should sponsor him with a p4 account... great work! roman From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 11:36:15 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 105BF106566C for ; Sat, 10 May 2008 11:36:15 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by mx1.freebsd.org (Postfix) with ESMTP id 8F9CC8FC13 for ; Sat, 10 May 2008 11:36:14 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by ug-out-1314.google.com with SMTP id q2so372491uge.37 for ; Sat, 10 May 2008 04:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:to:cc:subject:in-reply-to:message-id:references:user-agent:mime-version:content-type:from; bh=VWji3iS3CoPVqVBzyDYkf+LBQwC/nr6Lf5omUXbBwro=; b=KOu7I39/xalLcALY1CsJ7X4JGv4KTgmSkj9U000uOSSLx2QxBYbq3M5hElDUGPV59PEAcuXvBlp+DP4R7xLzApX7gfX7unWmfPrGk/cbuv0/58bS2lFADftL7m7UX/oweXb9ZEJsQ4Vxzp/PScqMrl6z3WRQRVxFkPvyrAJRVoo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:to:cc:subject:in-reply-to:message-id:references:user-agent:mime-version:content-type:from; b=TeKCtssfVDoSxyK0nbj7wVs29NU0WA+r/PzXom0N1Ncf65b2eJVqvcEjPB80iGy/2IJTNjVbtmWNEd+DaMZgzdkqJQLtuXybGYihltMn24fspQbdrjLxvh0xx0DGO3ptNRldtRY+kN1g/QgiqjN7OGJb/xg68DRw2ZpaI0baJyU= Received: by 10.67.89.17 with SMTP id r17mr2476831ugl.2.1210419372957; Sat, 10 May 2008 04:36:12 -0700 (PDT) Received: from ora.chd.net ( [81.200.6.196]) by mx.google.com with ESMTPS id t12sm10944944gvd.10.2008.05.10.04.36.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 10 May 2008 04:36:11 -0700 (PDT) Date: Sat, 10 May 2008 03:30:07 +0400 (MSD) To: Roman Divacky In-Reply-To: <20080510105008.GA71225@freebsd.org> Message-ID: References: <20080508165244.GA68088@freebsd.org> <20080508170819.GA68720@freebsd.org> <20080508172503.GA69463@freebsd.org> <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> <20080510105008.GA71225@freebsd.org> User-Agent: Alpine 1.10 (BSF 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed From: Chagin Dmitry Cc: freebsd-emulation@freebsd.org, Chagin Dmitry Subject: Re: [patch] linux-x86-64 (for comments) 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, 10 May 2008 11:36:15 -0000 On Sat, 10 May 2008, Roman Divacky wrote: > On Fri, May 09, 2008 at 07:02:05PM +0400, Chagin Dmitry wrote: >> >> hi. >> >> Recently with Roman have decided to make emulation linux-x86-64. >> Here a patch: http://81.200.6.196/linux-x86-64.diff.tar.gz > > witten ~# fetch http://81.200.6.196/linux-x86-64.diff.tar.gz > fetch: http://81.200.6.196/linux-x86-64.diff.tar.gz: No route to host > you have got at that time when i reloaded a server with a new kernel and have flow on a panic :) (bad malloc/free in re0 probably - i see later) now all works > > Dmitry has fixed this (a wrong AUX entry). I think we should sponsor > him with a p4 account... > now /compat/linux/bin/pwd exited without SIGSEGV, but on former can't load libc -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 12:29:08 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 54CF9106566C for ; Sat, 10 May 2008 12:29:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail10.syd.optusnet.com.au (mail10.syd.optusnet.com.au [211.29.132.191]) by mx1.freebsd.org (Postfix) with ESMTP id DF2548FC37 for ; Sat, 10 May 2008 12:29:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c220-239-252-11.carlnfd3.nsw.optusnet.com.au [220.239.252.11]) by mail10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m4ACSrYW024925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 May 2008 22:28:56 +1000 Date: Sat, 10 May 2008 22:28:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Juergen Lock In-Reply-To: <20080509220922.GA13480@saturn.kn-bremen.de> Message-ID: <20080510213519.P3083@besplex.bde.org> References: <20080507162713.73A3A5B47@mail.bitblocks.com> <20080508195843.G17500@delplex.bde.org> <20080509220922.GA13480@saturn.kn-bremen.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@freebsd.org Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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, 10 May 2008 12:29:08 -0000 On Sat, 10 May 2008, Juergen Lock wrote: > On Thu, May 08, 2008 at 09:59:57PM +1000, Bruce Evans wrote: >> The message in npx.c is actually about violation of an even more >> fundamental invariant -- the invariant that owning the FPU includes >> having the TS flag clear so that DNA traps cannot occur. The bug in >> kqemu seems to be mismanagement of the TS flag related to this. I >> forget if it is the host or the target TS flag that seems to be mismanaged. >> For the target, it would take a bug in the virtualization of the TS flag >> to break this invariant (assuming no related bugs in the target kernel). >> > Well the `fpcurthread == curthread' bug has been fixed quite a while > ago already, or do you mean another one? I didn't know what is already fixed. >> The message in amd64/machdep.c is about violation of the invariant >> that the kernel cannot cause DNA traps. Spurious DNA traps in the >> ... >> > Okay I _think_ I know a little more about this now... kqemu itself > doesn't use the fpu, but the guest code it runs can, and in that case the > DNA trap is just used for (host) lazy fpu context switching like as if the > code was running in userland regularly. And I just tested the following > patch that should get rid of the message by calling fpudna/npxdna directly > (files/patch-fpucontext is the interesting part:) This seems reasonable. Is the following summary of my understanding of kqemu's implementation of this and your change correct?: - kqemu runs in kernel mode on the host and needs to have exactly the same effect as a DNA exception on the target. - having exactly the same effect requires calling the host DNA exception handler. - now it uses a software int $7 (dna) to implement the above, but this is not permitted in kernel mode (although the software int could be permitted, it is hard to distinguish from a hardware exception for unintentional use). - your change makes it call the DNA trap handler directly. This gives the same effect as a permitted software int $7. It is also faster. It would be better to use an official API for this, but none exists. > ... > +Index: kqemu-freebsd.c > +@@ -33,6 +33,11 @@ > + > + #include > + #include > ++#ifdef __x86_64__ > ++#include > ++#else > ++#include > ++#endif > + > + #include "kqemu-kernel.h" > + > +@@ -172,6 +177,15 @@ > + { > + } > + > ++void CDECL kqemu_loadfpucontext(unsigned long cpl) > ++{ > ++#ifdef __x86_64__ > ++ fpudna(); > ++#else > ++ npxdna(); > ++#endif > ++} Just be sure that the system state is not too different from that of trap() (directly below a syscall or trap from userland) when this is called. Better not have any interrupts disabled or locks held, though I think npxdna() doesn't care. The FPU must not be owned already at this point. > ++ > + #if __FreeBSD_version < 500000 > + static int > + curpriority_cmp(struct proc *p) I guess kqemu duplicates this old mistake instead of calling it because it is static. npxdna() is already public so it can be abused easily :-), Bruce From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 15:46:41 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 C5F331065679 for ; Sat, 10 May 2008 15:46:41 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 751E38FC15 for ; Sat, 10 May 2008 15:46:40 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 5197867EFCE; Sat, 10 May 2008 17:46:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XZrnvy34P8hd; Sat, 10 May 2008 17:46:05 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id CD6D867EFCC; Sat, 10 May 2008 17:46:05 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m4AFk5rI083689; Sat, 10 May 2008 17:46:05 +0200 (CEST) (envelope-from rdivacky) Date: Sat, 10 May 2008 17:46:05 +0200 From: Roman Divacky To: Chagin Dmitry Message-ID: <20080510154605.GA83247@freebsd.org> References: <20080508170819.GA68720@freebsd.org> <20080508172503.GA69463@freebsd.org> <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> <20080510105008.GA71225@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: [patch] linux-x86-64 (for comments) 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, 10 May 2008 15:46:41 -0000 On Sat, May 10, 2008 at 03:30:07AM +0400, Chagin Dmitry wrote: > On Sat, 10 May 2008, Roman Divacky wrote: > > >On Fri, May 09, 2008 at 07:02:05PM +0400, Chagin Dmitry wrote: > >> > >>hi. > >> > >>Recently with Roman have decided to make emulation linux-x86-64. > >>Here a patch: http://81.200.6.196/linux-x86-64.diff.tar.gz > > > >witten ~# fetch http://81.200.6.196/linux-x86-64.diff.tar.gz > >fetch: http://81.200.6.196/linux-x86-64.diff.tar.gz: No route to host > > > > you have got at that time when i reloaded a server with a new kernel and > have flow on a panic :) (bad malloc/free in re0 probably - i see later) > now all works if you need an account for hosting patches etc. just ask me.. I'll provide one (in .cz so RTT should be reasonable even for online work) > > > >Dmitry has fixed this (a wrong AUX entry). I think we should sponsor > >him with a p4 account... > > > > now /compat/linux/bin/pwd exited without SIGSEGV, but on former can't > load libc please... post more technical details if you want us to help you. if you mean this as "blog" entry only it's fine as it is :) but I suggest to establish an official blog (ask flz@ about one) for this announcements :) anyway... impressive work! roman From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 20:59:18 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 B5D761065671 for ; Sat, 10 May 2008 20:59:18 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 668E68FC17 for ; Sat, 10 May 2008 20:59:17 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 1AE6B67C28D; Sat, 10 May 2008 22:58:44 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qgZhUiPTL7Ch; Sat, 10 May 2008 22:58:33 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 9E13B67C264; Sat, 10 May 2008 22:58:33 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m4AKwXTd029848; Sat, 10 May 2008 22:58:33 +0200 (CEST) (envelope-from rdivacky) Date: Sat, 10 May 2008 22:58:33 +0200 From: Roman Divacky To: Chagin Dmitry Message-ID: <20080510205833.GA29591@freebsd.org> References: <20080508170819.GA68720@freebsd.org> <20080508172503.GA69463@freebsd.org> <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> <20080510105008.GA71225@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: [patch] linux-x86-64 (for comments) 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, 10 May 2008 20:59:18 -0000 > now /compat/linux/bin/pwd exited without SIGSEGV, but on former can't > load libc I think you have wrong AUX entries... please take a look at netbsd source sys/compat/linux/arch/amd64/linux_exec_machdep.c around line 180... I believe they have it correct. Also, dont define LINUX_CLOCK_PER_SEC to be 100 but use "hz" instead. geeee. I wish you already have the p4 account :) From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 21:01:46 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 C595410656AA for ; Sat, 10 May 2008 21:01:46 +0000 (UTC) (envelope-from bsd@kuehlbox.de) Received: from samael.qmail-ldap.de (mail.kuehlbox.de [62.159.47.22]) by mx1.freebsd.org (Postfix) with ESMTP id 2D6768FC12 for ; Sat, 10 May 2008 21:01:45 +0000 (UTC) (envelope-from bsd@kuehlbox.de) Received: (qmail 59150 invoked from network); 10 May 2008 21:01:32 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=kuehlbox.de; b=vonNly46BRZOLGSL5zao4vZonPg6iRNVsSfK1lpIzsVWGyM57S6XsephK4RsyNNy17/ms94Biyd7IlN5zUK/r0SkaNbZ/1EINxpOd+V5oYWCv9Yl6ZY9uePIOu3xh29i ; Received: from unknown (HELO [192.168.200.128]) (bsd@kuehlbox.de@[10.0.48.22]) (envelope-sender ) by samael.qmail-ldap.de (qmail-ldap-1.03) with SMTP for ; 10 May 2008 21:01:32 -0000 Received: from: ppp-88-217-15-6.dynamic.mnet-online.de RECURED ([88.217.15.6]) by HSF smtp proxy with AES256-SHA encrypted SMTP Message-ID: <48260CF7.5050700@kuehlbox.de> Date: Sat, 10 May 2008 23:00:39 +0200 From: Teufel User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: freebsd-emulation@freebsd.org, Juergen Lock References: <20080507162713.73A3A5B47@mail.bitblocks.com> <20080508195843.G17500@delplex.bde.org> <20080509220922.GA13480@saturn.kn-bremen.de> In-Reply-To: <20080509220922.GA13480@saturn.kn-bremen.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: seems I finally found what upset kqemu on amd64 SMP... shared gdt! (please test patch :) 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, 10 May 2008 21:01:46 -0000 > Okay I _think_ I know a little more about this now... kqemu itself > doesn't use the fpu, but the guest code it runs can, and in that case the > DNA trap is just used for (host) lazy fpu context switching like as if the > code was running in userland regularly. And I just tested the following > patch that should get rid of the message by calling fpudna/npxdna directly > (files/patch-fpucontext is the interesting part:) Applied the patch today and I can confirm, there are no more dna messages as expected. A win2k3 guest runs now couple of hours with some stress test and the kernel is still fine. I think this patch solves the broken kqemu on amd64. Great work. From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 21:12:20 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 DD4CE106567C for ; Sat, 10 May 2008 21:12:20 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by mx1.freebsd.org (Postfix) with ESMTP id 6371B8FC1B for ; Sat, 10 May 2008 21:12:20 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by ug-out-1314.google.com with SMTP id q2so440292uge.37 for ; Sat, 10 May 2008 14:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:to:cc:subject:in-reply-to:message-id:references:user-agent:mime-version:content-type:from; bh=Dn4lVnUIl0CDZ3TnOMR2k/Gv7uy0QmfVV+ptnZUFJqk=; b=DQAfQZOcau7mEJzFGl88kzT9WybetfOBxlFX6xQb6HGYXQGpfYVBk35L5czPwPjsp84JBy/tKLWBskqk8EzsUuilYAIGrBPpuXIEybGo/Ogr2agZnSacra/g2m1Dgru77V6AofukEVtEBvU2QA5g+cQ0yI2V41JXbPSP0D7Xk6E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:to:cc:subject:in-reply-to:message-id:references:user-agent:mime-version:content-type:from; b=uLg2tLFaIP1yhnemSN2jcV4URLDLBu2ybX3xePslWnxE74r0xbqK2bQV7fOTl0OrNKGApEYLeUJ7AeyIMszNTEGf9msmcwDD9Bx0pf9RM3a76lAKI2vOD0ehDN5wBTetRFRSMlb6oZz5CvHqP2zCfAgFcFtF+HwZ6OxGFECRRiA= Received: by 10.67.19.17 with SMTP id w17mr3081387ugi.33.1210453939225; Sat, 10 May 2008 14:12:19 -0700 (PDT) Received: from ora.chd.net ( [81.200.6.196]) by mx.google.com with ESMTPS id g9sm11925224gvc.0.2008.05.10.14.12.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 10 May 2008 14:12:16 -0700 (PDT) Date: Sun, 11 May 2008 01:12:25 +0400 (MSD) To: Roman Divacky In-Reply-To: <20080510154605.GA83247@freebsd.org> Message-ID: References: <20080508170819.GA68720@freebsd.org> <20080508172503.GA69463@freebsd.org> <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> <20080510105008.GA71225@freebsd.org> <20080510154605.GA83247@freebsd.org> User-Agent: Alpine 1.10 (BSF 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed From: Chagin Dmitry Cc: freebsd-emulation@freebsd.org, Chagin Dmitry Subject: Re: [patch] linux-x86-64 (for comments) 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, 10 May 2008 21:12:20 -0000 On Sat, 10 May 2008, Roman Divacky wrote: >> now /compat/linux/bin/pwd exited without SIGSEGV, but on former can't >> load libc > > please... post more technical details if you want us to help you. if you > mean this as "blog" entry only it's fine as it is :) but I suggest to > establish an official blog (ask flz@ about one) for this announcements :) > ooo, no blog ) about technical details: now problem in getdents syscall's family trace of ldconfig look like this kernel: linux(26702): open(/lib, 0x90800, 0x6bdae0) kernel: linux(26702): open returns error 0 kernel: retval[0]: 0x3 / 3 kernel: linux(26702): newfstat(3, *) kernel: retval[0]: 0x0 / 0 kernel: linux(26702): fcntl(3, 00000001, *) kernel: retval[0]: 0x0 / 0 kernel: linux(26702): fcntl(3, 00000002, *) kernel: retval[0]: 0x0 / 0 kernel: linux(26702): getdents(3, *, 8192) kernel: retval[0]: 0x88 / 136 kernel: trap! kernel: frame->tf_trapno: 0x12 kernel: frame->tf_rip: 0x420608 kernel: frame->tf_rcx: 0x4205e5 kernel: frame->tf_rsp: 0x7fffffffd810 kernel: frame->tf_rbp: 0xffe00 kernel: frame->tf_rbx: 0x6cdbf0 kernel: frame->tf_rax: 0x88 kernel: frame->tf_addr: 0xffe10 ups ))) kernel: frame->tf_cs: 0x2b kernel: frame->tf_ss: 0x23 -------> here we are die 420608: 0f b7 45 10 movzwl 0x10(%rbp),%eax 42060c: 48 8d 5d 12 lea 0x12(%rbp),%rbx 420610: 48 89 df mov %rbx,%rdi this code is in function search_dir in elf/ldconfig.c (glibc) here i think that is it :) -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 21:16:47 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 F06771065670 for ; Sat, 10 May 2008 21:16:47 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.freebsd.org (Postfix) with ESMTP id 7A31A8FC0A for ; Sat, 10 May 2008 21:16:47 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by ug-out-1314.google.com with SMTP id q2so440689uge.37 for ; Sat, 10 May 2008 14:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:to:cc:subject:in-reply-to:message-id:references:user-agent:mime-version:content-type:from; bh=2Vh65fa0j15naNOoI3yRaCHZeKebxCGfZsBbrnw+Vqc=; b=v3k91VkrZ5reWzCe7xcg0M1LETu0mHKcCB+GK0I45aqUeZcDxNk7bHGRiy9NHlujpUoo6eEHLnwARvQybYBcde0OnN0rtc0Epx6rFRVzY22y7JUU7WBXCiRdCVTOEnpW0cQsIup/6BUAmtFL06RCccrXk70jM6rk5zrpN3s2Qjw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:to:cc:subject:in-reply-to:message-id:references:user-agent:mime-version:content-type:from; b=sLBmscLHU715v+4M7l9p+lkOpp6H4QDSHodoG4JjRmsrs30vYyx21mKbA7rjErt8grp2cgH6fa9iYa//+u/sUzHpNaAPzFbD7oMGfx5ysmbeZWUMu54z6hqjvgp7HPBppVXPEz4dHb5ROib8/JdTjRNHnZvvDz0CVHJAEFbn1kI= Received: by 10.67.116.15 with SMTP id t15mr3091209ugm.21.1210454205973; Sat, 10 May 2008 14:16:45 -0700 (PDT) Received: from ora.chd.net ( [81.200.6.196]) by mx.google.com with ESMTPS id j8sm11926549gvb.1.2008.05.10.14.16.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 10 May 2008 14:16:45 -0700 (PDT) Date: Sun, 11 May 2008 01:16:56 +0400 (MSD) To: Roman Divacky In-Reply-To: <20080510205833.GA29591@freebsd.org> Message-ID: References: <20080508170819.GA68720@freebsd.org> <20080508172503.GA69463@freebsd.org> <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> <20080510105008.GA71225@freebsd.org> <20080510205833.GA29591@freebsd.org> User-Agent: Alpine 1.10 (BSF 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed From: Chagin Dmitry Cc: freebsd-emulation@freebsd.org, Chagin Dmitry Subject: Re: [patch] linux-x86-64 (for comments) 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, 10 May 2008 21:16:48 -0000 On Sat, 10 May 2008, Roman Divacky wrote: >> now /compat/linux/bin/pwd exited without SIGSEGV, but on former can't >> load libc > > I think you have wrong AUX entries... please take a look at netbsd source > > sys/compat/linux/arch/amd64/linux_exec_machdep.c i fix all at the morning - i shall update patch, it's outdated > > around line 180... I believe they have it correct. Also, dont define > LINUX_CLOCK_PER_SEC to be 100 but use "hz" instead. thnx :) shall know now > > geeee. I wish you already have the p4 account :) no, it's git-diff :) -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 21:20:31 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 982A6106567D for ; Sat, 10 May 2008 21:20:31 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 170098FC15 for ; Sat, 10 May 2008 21:20:25 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id AAD3967C346; Sat, 10 May 2008 23:19:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kbiHvETN97SP; Sat, 10 May 2008 23:19:51 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 6304567C28D; Sat, 10 May 2008 23:19:51 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m4ALJpOZ031682; Sat, 10 May 2008 23:19:51 +0200 (CEST) (envelope-from rdivacky) Date: Sat, 10 May 2008 23:19:51 +0200 From: Roman Divacky To: Chagin Dmitry Message-ID: <20080510211951.GA31390@freebsd.org> References: <20080508172503.GA69463@freebsd.org> <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> <20080510105008.GA71225@freebsd.org> <20080510154605.GA83247@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: [patch] linux-x86-64 (for comments) 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, 10 May 2008 21:20:31 -0000 On Sun, May 11, 2008 at 01:12:25AM +0400, Chagin Dmitry wrote: > On Sat, 10 May 2008, Roman Divacky wrote: > > >>now /compat/linux/bin/pwd exited without SIGSEGV, but on former can't > >>load libc > > > >please... post more technical details if you want us to help you. if you > >mean this as "blog" entry only it's fine as it is :) but I suggest to > >establish an official blog (ask flz@ about one) for this announcements :) > > > > ooo, no blog ) > about technical details: > now problem in getdents syscall's family > trace of ldconfig look like this > > kernel: linux(26702): open(/lib, 0x90800, 0x6bdae0) > kernel: linux(26702): open returns error 0 > kernel: retval[0]: 0x3 / 3 > kernel: linux(26702): newfstat(3, *) > kernel: retval[0]: 0x0 / 0 > kernel: linux(26702): fcntl(3, 00000001, *) > kernel: retval[0]: 0x0 / 0 > kernel: linux(26702): fcntl(3, 00000002, *) > kernel: retval[0]: 0x0 / 0 > kernel: linux(26702): getdents(3, *, 8192) > kernel: retval[0]: 0x88 / 136 > > kernel: trap! > kernel: frame->tf_trapno: 0x12 + 0, /* 18 T_DIVIDE */ how can integer divide trap happen in "movzwl"? Are trap numbers the same on i386 and on amd64? is this machine-dependant or os-dependant? From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 21:21: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 4F66F1065673 for ; Sat, 10 May 2008 21:21:42 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 01C3A8FC12 for ; Sat, 10 May 2008 21:21:41 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id E5B1A67C346; Sat, 10 May 2008 23:21:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p-cTeo1Pw+8S; Sat, 10 May 2008 23:20:59 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 0FE3A67C28D; Sat, 10 May 2008 23:20:59 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m4ALKx2j031741; Sat, 10 May 2008 23:20:59 +0200 (CEST) (envelope-from rdivacky) Date: Sat, 10 May 2008 23:20:59 +0200 From: Roman Divacky To: Chagin Dmitry Message-ID: <20080510212059.GB31390@freebsd.org> References: <20080508172503.GA69463@freebsd.org> <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> <20080510105008.GA71225@freebsd.org> <20080510205833.GA29591@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: [patch] linux-x86-64 (for comments) 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, 10 May 2008 21:21:42 -0000 On Sun, May 11, 2008 at 01:16:56AM +0400, Chagin Dmitry wrote: > On Sat, 10 May 2008, Roman Divacky wrote: > > >>now /compat/linux/bin/pwd exited without SIGSEGV, but on former can't > >>load libc > > > >I think you have wrong AUX entries... please take a look at netbsd source > > > > sys/compat/linux/arch/amd64/linux_exec_machdep.c > > i fix all at the morning - i shall update patch, it's outdated please version the patches.... ie. linux-foo.1.patch, linux-foo.2.patch etc. > > > >around line 180... I believe they have it correct. Also, dont define > >LINUX_CLOCK_PER_SEC to be 100 but use "hz" instead. > > thnx :) shall know now just a small nit :) > > > >geeee. I wish you already have the p4 account :) > > no, it's git-diff :) I mean... I could comment every commit :) From owner-freebsd-emulation@FreeBSD.ORG Sat May 10 21:32:19 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 603FD106566B for ; Sat, 10 May 2008 21:32:19 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 129498FC16 for ; Sat, 10 May 2008 21:32:19 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id D9A7B67C350; Sat, 10 May 2008 23:31:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y2aVnN3QEdsx; Sat, 10 May 2008 23:31:35 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id D9B7967BE56; Sat, 10 May 2008 23:31:34 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m4ALVYwI032250; Sat, 10 May 2008 23:31:34 +0200 (CEST) (envelope-from rdivacky) Date: Sat, 10 May 2008 23:31:34 +0200 From: Roman Divacky To: Chagin Dmitry Message-ID: <20080510213134.GA31988@freebsd.org> References: <20080508195310.GA74606@freebsd.org> <20080508210641.GA81647@freebsd.org> <20080510105008.GA71225@freebsd.org> <20080510154605.GA83247@freebsd.org> <20080510211951.GA31390@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080510211951.GA31390@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: [patch] linux-x86-64 (for comments) 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, 10 May 2008 21:32:19 -0000 On Sat, May 10, 2008 at 11:19:51PM +0200, Roman Divacky wrote: > On Sun, May 11, 2008 at 01:12:25AM +0400, Chagin Dmitry wrote: > > On Sat, 10 May 2008, Roman Divacky wrote: > > > > >>now /compat/linux/bin/pwd exited without SIGSEGV, but on former can't > > >>load libc > > > > > >please... post more technical details if you want us to help you. if you > > >mean this as "blog" entry only it's fine as it is :) but I suggest to > > >establish an official blog (ask flz@ about one) for this announcements :) > > > > > > > ooo, no blog ) > > about technical details: > > now problem in getdents syscall's family > > trace of ldconfig look like this > > > > kernel: linux(26702): open(/lib, 0x90800, 0x6bdae0) > > kernel: linux(26702): open returns error 0 > > kernel: retval[0]: 0x3 / 3 > > kernel: linux(26702): newfstat(3, *) > > kernel: retval[0]: 0x0 / 0 > > kernel: linux(26702): fcntl(3, 00000001, *) > > kernel: retval[0]: 0x0 / 0 > > kernel: linux(26702): fcntl(3, 00000002, *) > > kernel: retval[0]: 0x0 / 0 > > kernel: linux(26702): getdents(3, *, 8192) > > kernel: retval[0]: 0x88 / 136 > > > > kernel: trap! > > kernel: frame->tf_trapno: 0x12 > > + 0, /* 18 T_DIVIDE */ > > how can integer divide trap happen in "movzwl"? Are trap numbers > the same on i386 and on amd64? is this machine-dependant or os-dependant? nevermind the previous. I slept only 3 hours last night ;) take a look at arch/x86_64/kernel/traps.c around line 541 (linux 2.6.16) it defines trap 18 to be "reserved" and intstructs the kernel to send a SIGSEGV signal to the process... no idea why :) please fix all the issues we have found a fix for and report back what's going on thnx! roman