From owner-freebsd-emulation@FreeBSD.ORG Thu May 15 21:43:02 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 A186C1065671 for ; Thu, 15 May 2008 21:43:02 +0000 (UTC) (envelope-from tsw5@duke.edu) Received: from smtp.duke.edu (smtp-02.oit.duke.edu [152.3.174.84]) by mx1.freebsd.org (Postfix) with ESMTP id 5B7068FC2C for ; Thu, 15 May 2008 21:43:02 +0000 (UTC) (envelope-from tsw5@duke.edu) Received: from smtp.duke.edu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 6D80A511D6C; Thu, 15 May 2008 17:43:01 -0400 (EDT) Received: from avenue.wintermute (cpe-076-182-024-090.nc.res.rr.com [76.182.24.90]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.duke.edu (Postfix) with ESMTP id 1C282511D6B; Thu, 15 May 2008 17:43:01 -0400 (EDT) Message-Id: <9AFAF61B-D2C4-4785-8FCA-D2A10FFD0381@duke.edu> From: Todd Wasson To: Juergen Lock In-Reply-To: <20080515172836.GA7890@saturn.kn-bremen.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Date: Thu, 15 May 2008 17:43:00 -0400 References: <200805142333.m4ENXhdi014634@saturn.kn-bremen.de> <880CC127-204C-415C-AF59-903F5DA1CAA3@duke.edu> <20080515172836.GA7890@saturn.kn-bremen.de> X-Mailer: Apple Mail (2.919.2) X-PMX-Version: 5.4.1.325704, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.5.15.142251 Cc: freebsd-emulation@freebsd.org Subject: Re: kqemu locking my machine hard on amd64 smp, with most recent patches 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, 15 May 2008 21:43:02 -0000 I tried that patch and it still hung at about the same point. I think it may have printed one more line to the VNC session, about initializing the PIIX3 controller, but then nothing. Interestingly, I tried rolling back to 1.3.0.p11_4 to see if it still worked, and it did. So then I went to 1.3.0.p11_5 and it also worked. Therefore whatever is causing this is in the 1.3.0.p11_6 patch, as far as I can tell. Todd On May 15, 2008, at 1:28 PM, Juergen Lock wrote: > On Wed, May 14, 2008 at 10:53:20PM -0400, Todd Wasson wrote: >> Hi Juergen. No, I'm running it in a screen session on a headless >> machine >> and using VNC as a display device. I run it from the console and >> it hangs >> before anything useful shows up. Specifically, it spits this out >> before >> hanging: >> >> oss: Could not initialize DAC >> oss: Failed to open `/dev/dsp' >> oss: Reason: No such file or directory >> oss: Could not initialize DAC >> oss: Failed to open `/dev/dsp' >> oss: Reason: No such file or directory >> audio: Failed to create voice `pcspk' >> pcspk: Could not open voice >> >> So yeah, it's complaining about the sound hardware. > > Oh that's _probably_ unrelated. > >> Anyway, if I watch it >> in VNC, it hangs immediately when trying to boot the linux kernel; >> the only >> VM I've tried with it is a kubuntu install. It goes through the >> BIOS init, >> kicks off grub, and then says "Starting up ..." and then hangs. >> >> I've attached my dmesg. Thanks for whatever time you can put into >> this. > > Thanx. Can you try the folloing patch? (also at > http://people.freebsd.org/~nox/qemu/kqemu-kmod-tss-cpldt2.patch > ) > > Index: Makefile > =================================================================== > RCS file: /home/pcvs/ports/emulators/kqemu-kmod/Makefile,v > retrieving revision 1.25 > diff -u -p -r1.25 Makefile > --- Makefile 12 May 2008 19:09:52 -0000 1.25 > +++ Makefile 15 May 2008 17:07:33 -0000 > @@ -7,7 +7,7 @@ > > PORTNAME= kqemu > PORTVERSION= 1.3.0.p11 > -PORTREVISION= 6 > +PORTREVISION= 7 > 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.3 > diff -u -p -r1.3 patch-tssworkaround > --- files/patch-tssworkaround 12 May 2008 19:09:52 -0000 1.3 > +++ files/patch-tssworkaround 15 May 2008 17:04:38 -0000 > @@ -14,7 +14,7 @@ Index: kqemu-freebsd.c > > #include "kqemu-kernel.h" > > -@@ -248,6 +256,57 @@ > +@@ -248,6 +256,60 @@ > va_end(ap); > } > > @@ -26,7 +26,7 @@ Index: kqemu-freebsd.c > +extern struct pcpu __pcpu[]; > + > +/* called with interrupts disabled */ > -+void CDECL kqemu_tss_fixup(unsigned long kerngdtbase) > ++void CDECL kqemu_tss_fixup(unsigned long kerngdtbase, uint16_t > kernldtsel) > +{ > + int gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); > + unsigned cpuid = PCPU_GET(cpuid); > @@ -64,6 +64,9 @@ Index: kqemu-freebsd.c > + wrmsr(MSR_GSBASE, (u_int64_t)&__pcpu[cpuid]); > + wrmsr(MSR_KGSBASE, curthread->td_pcb->pcb_gsbase); > + wrmsr(MSR_FSBASE, 0); > ++ ssdtosyssd(&gdt_segs[GPROC0_SEL], > ++ (struct system_segment_descriptor *)&newgdt[GPROC0_SEL]); > ++ lldt(kernldtsel); > + } > + ltr(gsel_tss); > +} > @@ -90,7 +93,7 @@ Index: common/kernel.c > +#ifdef __FreeBSD__ > +#ifdef __x86_64__ > + spin_lock(&g->lock); > -+ kqemu_tss_fixup(s->kernel_gdt.base); > ++ kqemu_tss_fixup(s->kernel_gdt.base, s->kernel_ldt_sel); > + spin_unlock(&g->lock); > +#endif > +#endif > @@ -104,7 +107,7 @@ Index: kqemu-kernel.h > > +#ifdef __FreeBSD__ > +#ifdef __x86_64__ > -+void CDECL kqemu_tss_fixup(unsigned long kerngdtbase); > ++void CDECL kqemu_tss_fixup(unsigned long kerngdtbase, uint16_t > kernldtsel); > +#endif > +#endif > +