Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjLT7-0001lg-8b for qemu-devel@nongnu.org; Fri, 26 Sep 2008 18:07:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjLT6-0001l9-LU for qemu-devel@nongnu.org; Fri, 26 Sep 2008 18:07:20 -0400 Received: from [199.232.76.173] (port=60059 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjLT6-0001l5-If for qemu-devel@nongnu.org; Fri, 26 Sep 2008 18:07:20 -0400 Received: from gwyn.kn-bremen.de ([212.63.36.242]:55846) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KjLT5-0008H0-Uf for qemu-devel@nongnu.org; Fri, 26 Sep 2008 18:07:20 -0400 From: Juergen Lock Date: Sat, 27 Sep 2008 00:04:45 +0200 Subject: Re: [Qemu-devel] Re: qemu svn r5281 on FreeBSD - slow usb, vmwarevga, screen updates... (now updated to r5313) Message-ID: <20080926220445.GA13099@saturn.kn-bremen.de> References: <20080921204025.GA81055@saturn.kn-bremen.de> <200809242210.m8OMAcSZ021572@saturn.kn-bremen.de> <48DCF9FC.2070708@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48DCF9FC.2070708@codemonkey.ws> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: freebsd-emulation@freebsd.org, qemu-devel@nongnu.org On Fri, Sep 26, 2008 at 10:04:28AM -0500, Anthony Liguori wrote: > Matt wrote: >>> Here is another experimental update that forces -lthr on 6.x, and >>> also updates to qemu svn r5313: >>> http://people.freebsd.org/~nox/qemu/qemu-devel-20080924.patch >>> >> >> I just built this update and it seems to have fixed the issue. Host >> CPU usage again tracks with guest CPU usage and all seems well. I'll >> continue to use this build to see if anything else crops up. >> >> Please let me know if there is anything other information I can provide. >> > > If ya'll have patches to make QEMU work on FreeBSD, please submit them. > I'm about to commit a patch that's what it took for me to get SVN working > on FreeBSD. > > The one thing that really tripped me up with the whole aio kld-module > thing. Perhaps we should detect the presence of the module at run time and > disable aio? I assume kldload can only be run as root? Yes. Atm the ports print a warning when aio is not loaded: Index: qemu/vl.c @@ -8409,6 +8409,11 @@ tb_size = 0; +#ifdef __FreeBSD__ + if (modfind("aio") == -1) + fprintf(stderr, "warning: aio not (kld)loaded, may cause `Invalid system call' traps on disk IO\n"); +#endif + optind = 1; for(;;) { if (optind >= argc) And here is another patch thats needed on amd64 hosts for tcg (which I had posted before:) Index: qemu/exec.c @@ -405,6 +405,28 @@ exit(1); } } +#elif defined(__FreeBSD__) + { + int flags; + void *addr = NULL; + flags = MAP_PRIVATE | MAP_ANONYMOUS; +#if defined(__x86_64__) + /* FreeBSD doesn't have MAP_32BIT, use MAP_FIXED and assume + * 0x40000000 is free */ + flags |= MAP_FIXED; + addr = (void *)0x40000000; + /* Cannot map more than that */ + if (code_gen_buffer_size > (800 * 1024 * 1024)) + code_gen_buffer_size = (800 * 1024 * 1024); +#endif + code_gen_buffer = mmap(addr, code_gen_buffer_size, + PROT_WRITE | PROT_READ | PROT_EXEC, + flags, -1, 0); + if (code_gen_buffer == MAP_FAILED) { + fprintf(stderr, "Could not allocate dynamic translator buffer\n"); + exit(1); + } + } #else code_gen_buffer = qemu_malloc(code_gen_buffer_size); if (!code_gen_buffer) { Signed-off-by: Juergen Lock I'll see if I can prepare another update over the weekend and then go thru more of the patches that have accumulated in the port... Thanx, Juergen