From owner-freebsd-virtualization@FreeBSD.ORG Thu Feb 6 18:00:38 2014 Return-Path: Delivered-To: freebsd-virtualization@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52182FEA; Thu, 6 Feb 2014 18:00:38 +0000 (UTC) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 0B01112CB; Thu, 6 Feb 2014 18:00:34 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 2A4DA1E007B8; Thu, 6 Feb 2014 19:00:31 +0100 (CET) Received: from enceladus10.kn-bremen.de (noident@localhost [127.0.0.1]) by enceladus10.kn-bremen.de (8.14.5/8.14.5) with ESMTP id s16HxJn1069878; Thu, 6 Feb 2014 18:59:19 +0100 (CET) (envelope-from nox@enceladus10.kn-bremen.de) Received: (from nox@localhost) by enceladus10.kn-bremen.de (8.14.5/8.14.5/Submit) id s16HxJSi069877; Thu, 6 Feb 2014 18:59:19 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Thu, 6 Feb 2014 18:59:19 +0100 To: Shteryana Shopova Subject: Re: kqemu patch for CURRENT/10-STABLE (was Re: Linux on BHyVe in 10.0-RELEASE ) Message-ID: <20140206175919.GA67849@enceladus10.kn-bremen.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: nox@FreeBSD.org, freebsd-virtualization@FreeBSD.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 18:00:38 -0000 On Thu, Feb 06, 2014 at 05:16:15PM +0200, Shteryana Shopova wrote: > Hi all, > > Sorry for top posting but I'm new to the list and came across this > thread while playing with bhyve these days. To apply the patch - > > #cp patch-unit3minorfix /usr/ports/emulators/kqemu-kmod/files/ > > compile and install the module. > > I've been running kqemu under current with the attached patch (plain > text below in case the attachment is removed) for a couple of months > now and the module is loaded successfully - > > root@demetra:/usr/ports/emulators/kqemu-kmod # dmesg | tail -n 10 | grep kqemu > kqemu version 0x00010300 > kqemu: KQEMU installed, max_locked_mem=4120624kB. > root@demetra:/usr/ports/emulators/kqemu-kmod # uname -v > FreeBSD 11.0-CURRENT #6 r260863: Sun Jan 19 02:57:49 EET 2014 > > The original commit that broke kqemu-kmod is from March 9th, 2013, so > the patch should be applicable to 10-STABLE too. Reports on > success/failures welcome. > > cheers, > Shteryana > > P.S. Example on getting a headless VM with vbox - > > #VBoxManage createvm --name MyServer --ostype Windows7 --register > #VBoxManage createhd --filename "MyServer.vdi" --size 200000 > #VBoxManage storagectl MyServer --name "IDE Controller" --add ide > --controller PIIX3 > #VBoxManage storageattach MyServer --storagectl "IDE Controller" > --port 0 --device 1 --type hdd --medium "MyServer.vdi" > #VBoxManage storageattach MyServer --storagectl "IDE Controller" > --port 1 --device 0 --type dvddrive --medium > /home/myserver/install.iso > #VBoxManage modifyvm MyServer --nic1 bridged --cableconnected1 on > --bridgeadapter1 em0 --nictype1 82540EM > #VBoxManage modifyvm MyServer --memory 1024 --acpi on --boot1 dvd > #VBoxHeadless -n -m 5901 -s "MyServer" > > The VM is then accessible via vncviewer to the IP of the original > machine port 5901 > > --- kqemu-freebsd.c.orig 2014-02-06 16:03:15.881335406 +0200 > +++ kqemu-freebsd.c 2014-02-06 16:04:25.951329106 +0200 > @@ -109,7 +109,12 @@ > vm_offset_t va; > vm_paddr_t pa; > > +#if __FreeBSD_version >= 1000030 > + va = kmem_malloc(kernel_map, PAGE_SIZE, M_WAITOK); > +#else > va = kmem_alloc(kernel_map, PAGE_SIZE); > +#endif > + > if (va == 0) { > kqemu_log("kqemu_alloc_zeroed_page: NULL\n"); > return NULL; Oh well kqemu isn't even used by vbox, it's for emulaotors/qemu when built with the KQEMU knob and run with -enable-kqemu or -kernel-kqemu, and fixing _that_ needs most likely more changes than this. (I.e. I think I tried something similar and only got a panic. And also qemu uses kqemu-kmod-devel, kqemu-kmod is only left for people still using even older qemu forks.) Sorry... Juergen