From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEGP1-0001w4-4k for qemu-devel@nongnu.org; Wed, 19 Sep 2012 05:17:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEGOr-0005E9-Jj for qemu-devel@nongnu.org; Wed, 19 Sep 2012 05:17:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEGOr-0005E5-9s for qemu-devel@nongnu.org; Wed, 19 Sep 2012 05:16:53 -0400 Message-ID: <50598D7E.8010909@redhat.com> Date: Wed, 19 Sep 2012 12:16:46 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1347961897-28554-1-git-send-email-kraxel@redhat.com> In-Reply-To: <1347961897-28554-1-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RfC PATCH] vga: add mmio bar to standard vga List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On 09/18/2012 12:51 PM, Gerd Hoffmann wrote: > This patch adds a mmio bar to the qemu standard vga which allows to > access the standard vga registers and bochs dispi interface registers > via mmio. > > diff --git a/hw/vga-pci.c b/hw/vga-pci.c > index 9abbada..e05e2ef 100644 > --- a/hw/vga-pci.c > +++ b/hw/vga-pci.c > @@ -30,9 +30,36 @@ > #include "qemu-timer.h" > #include "loader.h" > > +/* > + * QEMU Standard VGA -- MMIO area spec. > + * > + * Using PCI bar #2, keeping #1 free, which leaves the > + * door open to upgrade bar #0 to 64bit. > + * > + * mmio area layout: > + * 0x0000 -> 0x03ff reserved, for possible virtio extension. > + * 0x0400 -> 0x041f vga ioports (0x3c0 -> 0x3df), remapped 1:1 Do they support word accesses to set both index and data? > + * 0x0500 -> 0x0515 bochs dispi interface registers, mapped flat without > + * index/data ports. Use (index << 1) as offset for > + * (16bit) register access. > + */ BAR should disappear with -M old. > + > +static const MemoryRegionOps pci_vga_ioport_ops = { > + .read = pci_vga_ioport_read, > + .write = pci_vga_ioport_write, > + .valid.min_access_size = 1, > + .valid.max_access_size = 4, > + .impl.min_access_size = 1, > + .impl.max_access_size = 1, > + .endianness = DEVICE_LITTLE_ENDIAN, > +}; Looks like word writes are supported provided the memory API breaks up writes in little endian order. Better to make it explicit. -- error compiling committee.c: too many arguments to function