From owner-freebsd-virtualization@FreeBSD.ORG Sat Dec 28 03:03:45 2013 Return-Path: Delivered-To: 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 8601EAAA for ; Sat, 28 Dec 2013 03:03:45 +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 5B6721859 for ; Sat, 28 Dec 2013 03:03:45 +0000 (UTC) Received: from new-host-6.home (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EDDCAB943; Fri, 27 Dec 2013 22:03:42 -0500 (EST) Message-ID: <52BE3FB0.7060809@FreeBSD.org> Date: Fri, 27 Dec 2013 22:04:16 -0500 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Neel Natu Subject: Re: [PATCH] Rework DSDT generation in bhyve References: <201312271205.54102.jhb@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 27 Dec 2013 22:03:43 -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: Sat, 28 Dec 2013 03:03:45 -0000 On 12/27/13 8:49 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 > > I am getting a "404 Not Found" at this URL. Oops, I forgot to upload it to freefall. It should be there now. -- John Baldwin