From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MEw0k-000452-Tp for qemu-devel@nongnu.org; Thu, 11 Jun 2009 21:56:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MEw0f-00044q-6u for qemu-devel@nongnu.org; Thu, 11 Jun 2009 21:56:53 -0400 Received: from [199.232.76.173] (port=42666 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEw0f-00044n-1l for qemu-devel@nongnu.org; Thu, 11 Jun 2009 21:56:49 -0400 Received: from mail2.shareable.org ([80.68.89.115]:45526) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MEw0e-0006E5-Bs for qemu-devel@nongnu.org; Thu, 11 Jun 2009 21:56:48 -0400 Date: Fri, 12 Jun 2009 02:56:43 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] virtio-serial: PCI device for simple host <-> guest communication Message-ID: <20090612015643.GC25550@shareable.org> References: <1244565768-9103-1-git-send-email-amit.shah@redhat.com> <1244565768-9103-2-git-send-email-amit.shah@redhat.com> <1244565768-9103-3-git-send-email-amit.shah@redhat.com> <1244565768-9103-4-git-send-email-amit.shah@redhat.com> <20090609181714.GB11485@amd.home.annexia.org> <4A2EB079.6020909@codemonkey.ws> <20090610103115.GB12327@amit-x200.pnq.redhat.com> <20090610180027.GF7416@shareable.org> <20090611043130.GB22914@amit-x200.pnq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090611043130.GB22914@amit-x200.pnq.redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: "Richard W.M. Jones" , qemu-devel@nongnu.org Amit Shah wrote: > On (Wed) Jun 10 2009 [19:00:27], Jamie Lokier wrote: > > Amit Shah wrote: > > > > Plus, having a virtio serial device and a virtio console seems > > > > unfortunate to me. Anyway we can unify the two? Maybe make virtio > > > > serial support hvc with a feature flag or something instead of ttyS? > > > > > > Yes, it's possible. I'll look into that once I reach a point where > > > virtio-serial is ready to be merged. I'll also have to look at making > > > sure existing guest kernels work with the new, unified device. > > > > One of the most useful things about a serial port is that it's so easy > > for basic OS components like debuggers and bootloaders and BIOSes to > > use it, with very little code, and without having to do very complex > > things like initialise and enumerate PCI buses etc., and without > > interference by an OS so they are useful for things like kernel > > debugging and reliable debugging output. > > > > For this reason, virtually every real machine has a simple serial > > port, even if it isn't exposed on an external connector. > > > > Are virtio-serial/virtio-console very simple to drive from guest code, > > without PCI enumeration, or do they require complex initialisation and > > OS cooperation? > > OK, great question. I'll post my Linux driver that'll answer your > question precisely, but this is what a guest userspace app will have to > do to use it: Userspace doesn't matter so much - I'd assumed a simple char driver carrying a pipe of bytes, no matter how the emulated hardware works. But that's not relevant to the things I'm asking about, since they run outside userspace, sometimes without a kernel. > The driver itself hooks up with the virtio code which abstracts away all > the pci stuff. It just has to manage the rings and the queues. On the face of it, simply because virtio uses PCI, it looks a _lot_ more complicated than a serial port (UART) at a fixed I/O or MMIO address, for things like boot loaders, boot ROMS, BIOS debugging, kernel debuggers and minimal kernels. I say on the face of it, because I don't know enough about how virtio generally is set up in the guest. Can you make virtio-serial start enabled with fixed, known I/O or MMIO addresss, in a similar way to the way VGA cards and IDE ports are PCI devices but can be used without PCI enumeration? Can you make it pollable, so it's usable without having to route interrupts, which can be quite complicated, or impossible when you're debugging something that thinks it is control? -- Jamie