From: "Chun Yan Liu" Subject: Re: [Xen-devel] [RFC PATCH 0/2] support xen HVM direct kernel boot Date: Mon, 02 Jun 2014 21:35:28 -0600 Message-ID: <538DB300020000660003261A@soto.provo.novell.com> References: <1401333804-15456-1-git-send-email-cyliu@suse.com> <20140530160452.GB3621@localhost.localdomain> <1401722371.30097.5.camel@kazak.uk.xensource.com> <20140602165836.GD5127@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20140602165836.GD5127@phenom.dumpdata.com> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Ian Campbell , Konrad Rzeszutek Wilk Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org List-Id: xen-devel@lists.xenproject.org >>> On 6/3/2014 at 12:58 AM, in message <20140602165836.GD5127@phenom.dumpdata.com>, Konrad Rzeszutek Wilk wrote:=20 > On Mon, Jun 02, 2014 at 04:19:31PM +0100, Ian Campbell wrote:=20 > > On Fri, 2014-05-30 at 12:04 -0400, Konrad Rzeszutek Wilk wrote:=20 > > > On Thu, May 29, 2014 at 11:23:22AM +0800, Chunyan Liu wrote:=20 > > > > Following previous discussion:=20 > > > > https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03843.html= =20 > > > > =20 > > > > I spent lot of time to understand xen xc_hvm_build, hvmloader = code,=20 > > > > and qemu pc_memory_init, xen_ram_init code, and wrote experimental= =20 > > > > code to test. Now it's basically working based on seabios.=20 > > > =20 > > > Excellent!=20 > > > > =20 > > > > Talking about qemu linuxboot.bin/multiboot.bin first, they are=20 > > > > implemented to intercept boot process, originally by override = int19,=20 > > > > later changed to provide BEV entry which will be called by = seabios=20 > > > > if option rom is selected for booting. linuxboot.bin/multiboot.bin= =20 > > > > will load kernel/initrd and jump to execute kernel directly.=20 > > > > =20 > > > > In qemu load_linux() code, it first read out kernel/initrd file = and=20 > > > > store related ADDRs to fw_cfg (from where linuxboot.bin/multiboot.b= in=20 > > > > will get the ADDRs and load kernel/initrd data), then add=20 > > > > linuxboot.bin/multiboot.bin to option rom with bootindex=3D0.=20 > > > > =20 > > > > In seabios side, it could load and execute ROMs by itself, and = according=20 > > > > to boot order, it will boot from the BEV entry on the option rom. = That=20 > > > > will then be taken over by linuxboot.bin/multiboot.bin.=20 > > > > =20 > > > > So, in theory, qemu load_linux() code almost does the work. I just = tried=20 > > > > to reuse it for xen.=20 > > > > =20 > > > > xen side patch: pass kernel/initrd/append parameters to qemu-dm=20 > > > > qemu side patch: reuse load_linux() for xen hvm direct kernel = boot.=20 > > > > Different from pc_memory_init which does lots of ram alloc = work=20 > > > > and rom/bios loading work, for xen, we only need to init a = basic=20 > > > > fw_cfg device used by load_linux() to store ADDRs and=20 > > > > linuxboot.bin/multiboot.bin to retrive ADDRs, then load_linux()= ,=20 > > > > after that, do real add option rom work to add=20 > > > > linuxboot.bin/multiboot.bin to system option rom. Other = things=20 > > > > would be done by seabios smoothly.=20 > > > > =20 > > > > In my testing, it's working based on seabios.=20 > > > > Rombios case is not working. But now that xen prefers qemu = upstream,=20 > > > > seabios will be default, do we need to put effort to make rombios = work?=20 > > > =20 > > > No. But the code (libxl) should detect whether you are using the=20 > > > traditional QEMU - which would be using ROM BIOS. If it detects = that=20 > > > it shouldn't allow you to pass the arguments.=20 > > > =20 > > > You probably will also need to an docs/ change to document these=20 > > > new parameters.=20 > > =20 > > Yes, at the very least the manpages...=20 > > =20 > > > > And stubdom case, since I didn't make my guest started even = without =20 > direct=20 > > > > kernel boot, I don't know if it works. And I still could not = well=20 > > > > understand about the differences to stubdom and non stubdom this = work=20 > > > > may cover. Any problems please point out.=20 > > > =20 > > > Hmm, you would have to somehow 'transfer' the images from one = domain=20 > > > (the control domain) to the stubdomain which would do the execution.= =20 > > =20 > > Yes, which most likely involves preseeding the guest RAM with the = files=20 > > at a discoverable location. Icky.=20 > =20 > Or some form of FTP over XenBus :-)=20 Thanks. Understand. All files including 'kernel', 'initrd' and 'linuxboot.b= in' could not be accessed directly in stubdom-dm. Have to find a way to let qemu discover = them. I'll look at and see how to properly handle it.=20 Now I wonder how does it handle device? (A backend file or partition is = also a place on host.) Stubdom uses qemu-xen-traditional, maybe there is some special = handling? Will have a look. - Chunyan > > =20 > > Ian.=20 > > =20 > =20 > _______________________________________________=20 > Xen-devel mailing list=20 > Xen-devel@lists.xen.org=20 > http://lists.xen.org/xen-devel=20 > =20 > =20