From owner-freebsd-virtualization@FreeBSD.ORG Thu Jan 2 20:22:01 2014 Return-Path: Delivered-To: virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 838BD2F9 for ; Thu, 2 Jan 2014 20:22:01 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1FE681F23 for ; Thu, 2 Jan 2014 20:22:01 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2A2BDB9B3; Thu, 2 Jan 2014 15:22:00 -0500 (EST) From: John Baldwin To: Neel Natu Subject: Re: [PATCH] Rework DSDT generation in bhyve Date: Thu, 2 Jan 2014 15:21:43 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312271205.54102.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201401021521.43862.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 02 Jan 2014 15:22:00 -0500 (EST) Cc: "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, 02 Jan 2014 20:22:01 -0000 On Saturday, December 28, 2013 10:14:01 pm Neel Natu wrote: > Hi John, > > On Fri, Dec 27, 2013 at 9:05 AM, John Baldwin wrote: > > While hacking on the power button support, I also started rototilling the DSDT > > generation code a bit. My initial goal was to enumerate the LPC serial ports > > (COM1 and COM2) properly via ACPI. I ended up doing the following: > > > > - Moved the info for the top-level PCI bus into the PCI emulation code and > > added ResourceProducer entries for the memory ranges decoded by the bus > > for memory BARs. > > - I added a framework to allow each PCI emulation driver to optionally write > > an entry into the DSDT under the \_SB_.PCI0 namespace. The LPC driver uses > > this to write a node for the LPC bus (\_SB_.PCI0.ISA). > > - I added a linker set to allow any LPC devices to write entries into the > > DSDT below the LPC node. I moved the existing block for the RTC out of > > acpi.c and into the RTC driver. I added DSDT nodes for the AT PIC, > > the 8254 ISA timer, and the LPC UART devices. > > - I also added a "SuperIO" device under the LPC node to claim "system > > resources" (as is done in real hardware). I added a linker set to allow > > various drivers to add IO or memory ranges that should be claimed by > > SuperIO and then added the extended RTC IO range and the registers used > > for ACPI power management as system resources. > > > > The end result is that for the stock VM created by vmrun.sh, the attimer0, > > uart0, and uart1 devices move from isa0 to acpi0. There is also a PIC > > device that would be claimed by 'device atpic' (but the stock amd64 kernel > > doesn't include that). The DSDT is also a bit more fleshed out, and also > > looks "nice" as devices are mostly laid out in the normal tree rather than > > using separate Scope() sections for each device. > > > > Note that I did add some helper routines for writing out DSDT lines and > > resource entries to try to simplify the code in the various DSDT handlers > > and make the code that generates DSDT lines a bit more readable (e.g. the > > implicit newlines make things more readable IMO). > > > > The patch is relative to the previous power button patch and is at > > http://www.FreeBSD.org/~jhb/patches/bhyve_dsdt.patch > > > > This looks great! > > This is not related to your patch (it has always been there), but I > was trying to understand the significance of this entry: > pci_lpc_write_dsdt(): OperationRegion (P40C, PCI_Config, 0x60, 0x04) > > Any idea on why this is needed/interesting? Oh, I assumed it was just copied and pasted from whatever template was used for the initial DSDT. I was thinking of removing it because it is unused. If you are happy with me doing so I'll gladly axe it. > best > Neel > > > Assuming these are ok, the next thing I might work on is cleaning up > > the PCI INTx interrupts. They should really all be rounted to the I/O APIC > > intpins above 15 (and we should leave ISA IRQs 5, 10, and 11 alone in APIC > > mode and only fall back to that if we are using the 8259As and a real ELCR). > > The MP Table output would need some minor tweaking for that, and for ACPI we > > should generate a _PRT table under _SB_.PCI0 in pci_emul.c. > > > > -- > > John Baldwin > > _______________________________________________ > > freebsd-virtualization@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org" > -- John Baldwin From owner-freebsd-virtualization@FreeBSD.ORG Thu Jan 2 20:29:19 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80A349D2 for ; Thu, 2 Jan 2014 20:29:19 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68EFA1FB0 for ; Thu, 2 Jan 2014 20:29:19 +0000 (UTC) Received: from [10.1.3.5] (cnet520-windstream.mcclatchyinteractive.com [166.108.16.2]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 4962D1A79B3 for ; Thu, 2 Jan 2014 15:29:13 -0500 (EST) Message-ID: <52C5CC18.90105@mail.lifanov.com> Date: Thu, 02 Jan 2014 15:29:12 -0500 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-virtualization@freebsd.org Subject: Re: Real Device with BHyve References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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, 02 Jan 2014 20:29:19 -0000 On 01/02/14 15:22, freebsd-virtualization-request@freebsd.org wrote: > Hello everybody. > > I'm doing some experiments with bhyve on 10.0-RC3 and I got stuck at a > certain point. > > I was trying to have a VM use a direct device (/dev/da2) instead of a disk > image. I was trying it in order to understand if there was any real > performance difference between using a raw drive or an image-disk on the > same drive. > > Well, the machine starts ok but when the "child" FreeBSD starts > installation something strange happens. When I get to the partitioning > screen I can see the device avaiable as /dev/vtdb0 with the correct size > and such. I choose autopartitioning, the installer writes the partition > table but when it start to write /dev/vtdb0p2 a very cryptic error appears > about being unable to write - sorry, did not write it down. > > The installer then stops. > > If I do a fdisk /dev/vtdb0 in the VM I can see the GPT partition being > there. If I do a fdisk /dev/da2 on the host machine, I can see the GPT > partition as well, but the VM just doesn't want to write on it. > > I even tried changing kern.geom.debugflags=16 as I thought the host machine > could be locking somehow the drive, but that didn't seem to make any > difference. I know it was a lame check but I was out of ideas. > > So I just wanted to understand if such a scenario is supposed to be > supported.... > > What I was thinking of, for example, was of having an external iSCSI device > connected on the hostmachine mapped as a virtual disk for a specific VM, in > order to speed the VM disk performances. > > > Just another quick question... I have seen some improvements by having the > VM's virtual disk on ZFS against UFS. Is it just me or is there any real > improvement by using ZFS? > > Thanks a lot. > > > -- *Andrea BrancatelliSchema 31 S.r.l. - Socio UnicoResponsabile ITROMA > - FIRENZE - PALERMO ITALYTel: +39. 06.98.358.472* *Cell: +39 > 331.2488468Fax: +39. 055.71.880.466Societ? del Gruppo SC31 ITALIA* I'm not answering your question precisely, but can you pass through the disk controller to the virtual machine instead? I also know that zvol and iscsi backends work, at least the last time I checked. - Nikolai Lifanov From owner-freebsd-virtualization@FreeBSD.ORG Fri Jan 3 14:09:30 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9E4DE31 for ; Fri, 3 Jan 2014 14:09:30 +0000 (UTC) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8301C100E for ; Fri, 3 Jan 2014 14:09:30 +0000 (UTC) Received: by mail-vb0-f41.google.com with SMTP id p14so7811904vbm.0 for ; Fri, 03 Jan 2014 06:09:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=M3GTd4Sj7TN/sphg6Ka4vrri7CR8hFhmept5LIwXHuk=; b=buoEuQXCDxl2umqUDnTjSh3ZLpmAga+d+MLOzvub5+Dgw/nFf5p9TvmmiPu27uMG95 2lAK3H0tG1wH+z6lVM1SPVqdUz1YvFAF9nsLPtnfO6s8DnfBcq/rjPfWlNoaUZTs1Mbj mmlnSsphn4qzmoaqzM2bPDmYtKmd6ZoVBYtXxFFfDuehkoUrpYe3jI5tIp3DSIY3CYww cVi5GQX8cfEeFhCSLK/tk8c7Lj3yOFK2bEXubOoEkTTi1jtfVKs7ICuHyvHFTV/CK6n7 eYeWnumj9mEnndBkbvOE6bXB/e2Cvhm5vAjk3bR8C/DCe3zE3GEeoAMK6LsAU4lj+5Yw Qvfw== X-Gm-Message-State: ALoCoQnbhIJPcGU95jMm/wMFCsQE7gMc2AuQKenCO2/lhJmMO7F/J40N4ibhBYUNuVw+hUUdefuX MIME-Version: 1.0 X-Received: by 10.52.164.203 with SMTP id ys11mr460545vdb.37.1388737793011; Fri, 03 Jan 2014 00:29:53 -0800 (PST) Received: by 10.52.245.67 with HTTP; Fri, 3 Jan 2014 00:29:52 -0800 (PST) X-Originating-IP: [2001:470:28:12b::3] In-Reply-To: <52C5CC18.90105@mail.lifanov.com> References: <52C5CC18.90105@mail.lifanov.com> Date: Fri, 3 Jan 2014 09:29:52 +0100 Message-ID: Subject: Re: Real Device with BHyve From: Andrea Brancatelli To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.17 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: Fri, 03 Jan 2014 14:09:30 -0000 Forgive me, but I can't understand what you mean. Are we talking of using something like /dev/cciss (just to say...) instead of /dev/da2 as the device shared with the VM? Won't the VM and the real system clash in using the same device? On Thu, Jan 2, 2014 at 9:29 PM, Nikolai Lifanov w= rote: > On 01/02/14 15:22, freebsd-virtualization-request@freebsd.org wrote: > > Hello everybody. > > > > I'm doing some experiments with bhyve on 10.0-RC3 and I got stuck at a > > certain point. > > > > I was trying to have a VM use a direct device (/dev/da2) instead of a > disk > > image. I was trying it in order to understand if there was any real > > performance difference between using a raw drive or an image-disk on th= e > > same drive. > > > > Well, the machine starts ok but when the "child" FreeBSD starts > > installation something strange happens. When I get to the partitioning > > screen I can see the device avaiable as /dev/vtdb0 with the correct siz= e > > and such. I choose autopartitioning, the installer writes the partition > > table but when it start to write /dev/vtdb0p2 a very cryptic error > appears > > about being unable to write - sorry, did not write it down. > > > > The installer then stops. > > > > If I do a fdisk /dev/vtdb0 in the VM I can see the GPT partition being > > there. If I do a fdisk /dev/da2 on the host machine, I can see the GPT > > partition as well, but the VM just doesn't want to write on it. > > > > I even tried changing kern.geom.debugflags=3D16 as I thought the host > machine > > could be locking somehow the drive, but that didn't seem to make any > > difference. I know it was a lame check but I was out of ideas. > > > > So I just wanted to understand if such a scenario is supposed to be > > supported.... > > > > What I was thinking of, for example, was of having an external iSCSI > device > > connected on the hostmachine mapped as a virtual disk for a specific VM= , > in > > order to speed the VM disk performances. > > > > > > Just another quick question... I have seen some improvements by having > the > > VM's virtual disk on ZFS against UFS. Is it just me or is there any rea= l > > improvement by using ZFS? > > > > Thanks a lot. > > > > > > -- *Andrea BrancatelliSchema 31 S.r.l. - Socio UnicoResponsabile ITROMA > > - FIRENZE - PALERMO ITALYTel: +39. 06.98.358.472* *Cell: +39 > > 331.2488468Fax: +39. 055.71.880.466Societ? del Gruppo SC31 ITALIA* > > I'm not answering your question precisely, but can you pass through the > disk controller to the virtual machine instead? I also know that zvol > and iscsi backends work, at least the last time I checked. > > - Nikolai Lifanov > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to " > freebsd-virtualization-unsubscribe@freebsd.org" > --=20 *Andrea BrancatelliSchema 31 S.r.l. - Socio UnicoResponsabile ITROMA - FIRENZE - PALERMO ITALYTel: +39. 06.98.358.472* *Cell: +39 331.2488468Fax: +39. 055.71.880.466Societ=C3=A0 del Gruppo SC31 ITALIA* From owner-freebsd-virtualization@FreeBSD.ORG Fri Jan 3 17:43:35 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 22D203DF for ; Fri, 3 Jan 2014 17:43:35 +0000 (UTC) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id D887A1224 for ; Fri, 3 Jan 2014 17:43:34 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id 483A511DF0; Sat, 4 Jan 2014 03:43:27 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local ([64.245.0.210]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BQZ76556 (AUTH peterg@ptree32.com.au); Sat, 4 Jan 2014 03:43:26 +1000 Message-ID: <52C6F6BC.6070108@freebsd.org> Date: Fri, 03 Jan 2014 09:43:24 -0800 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Andrea Brancatelli Subject: Re: Real Device with BHyve References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: 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: Fri, 03 Jan 2014 17:43:35 -0000 Hi Andrea, > Well, the machine starts ok but when the "child" FreeBSD starts > installation something strange happens. When I get to the partitioning > screen I can see the device avaiable as /dev/vtdb0 with the correct size > and such. I choose autopartitioning, the installer writes the partition > table but when it start to write /dev/vtdb0p2 a very cryptic error appears > about being unable to write - sorry, did not write it down. > > The installer then stops. > > If I do a fdisk /dev/vtdb0 in the VM I can see the GPT partition being > there. If I do a fdisk /dev/da2 on the host machine, I can see the GPT > partition as well, but the VM just doesn't want to write on it. > > I even tried changing kern.geom.debugflags=16 as I thought the host machine > could be locking somehow the drive, but that didn't seem to make any > difference. I know it was a lame check but I was out of ideas. > > So I just wanted to understand if such a scenario is supposed to be > supported.... It is. Been a while since I've done this but will try a repro. Other folk have supported success using zvols so I'd assumed it was working. > What I was thinking of, for example, was of having an external iSCSI device > connected on the hostmachine mapped as a virtual disk for a specific VM, in > order to speed the VM disk performances. Yes, that's one of the scenarios in mind. > Just another quick question... I have seen some improvements by having the > VM's virtual disk on ZFS against UFS. Is it just me or is there any real > improvement by using ZFS? Difficult question to answer - probably workload-dependent. later, Peter. From owner-freebsd-virtualization@FreeBSD.ORG Fri Jan 3 19:44:15 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 9487AC7F for ; Fri, 3 Jan 2014 19:44:15 +0000 (UTC) Received: from mail.grem.de (outcast.grem.de [213.239.217.27]) by mx1.freebsd.org (Postfix) with SMTP id F27F01D9B for ; Fri, 3 Jan 2014 19:44:14 +0000 (UTC) Received: (qmail 57110 invoked by uid 89); 3 Jan 2014 19:44:12 -0000 Received: from unknown (HELO bsd64.grem.de) (mg@grem.de@88.217.181.106) by mail.grem.de with ESMTPA; 3 Jan 2014 19:44:12 -0000 Date: Fri, 3 Jan 2014 20:44:11 +0100 From: Michael Gmelin To: Peter Grehan Subject: Re: Real Device with BHyve Message-ID: <20140103204411.755021bb@bsd64.grem.de> In-Reply-To: <52C6F6BC.6070108@freebsd.org> References: <52C6F6BC.6070108@freebsd.org> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.18; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: 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: Fri, 03 Jan 2014 19:44:15 -0000 On Fri, 03 Jan 2014 09:43:24 -0800 Peter Grehan wrote: > Hi Andrea, > > Well, the machine starts ok but when the "child" FreeBSD starts > > installation something strange happens. When I get to the > > partitioning screen I can see the device avaiable as /dev/vtdb0 > > with the correct size and such. I choose autopartitioning, the > > installer writes the partition table but when it start to > > write /dev/vtdb0p2 a very cryptic error appears about being unable > > to write - sorry, did not write it down. > > > > The installer then stops. > > > > If I do a fdisk /dev/vtdb0 in the VM I can see the GPT partition > > being there. If I do a fdisk /dev/da2 on the host machine, I can > > see the GPT partition as well, but the VM just doesn't want to > > write on it. > > > > I even tried changing kern.geom.debugflags=16 as I thought the host > > machine could be locking somehow the drive, but that didn't seem to > > make any difference. I know it was a lame check but I was out of > > ideas. > > > > So I just wanted to understand if such a scenario is supposed to be > > supported.... > > It is. Been a while since I've done this but will try a repro. > Other folk have supported success using zvols so I'd assumed it was > working. If it helps, I had the same problem using zvol as well (booting the installer and install on the "raw" device) on 10-CURRENT from mid 2013. I didn't try with a more recent release. I ended up installing FreeBSD from the outside (create partitions and untar base.txz, kernel.txz etc. - afaik the same thing the Dexter's vm0 script does now) and could then boot into it just fine. -- Michael Gmelin