All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [RfC PATCH] vga: add mmio bar to standard vga
Date: Wed, 19 Sep 2012 12:16:46 +0300	[thread overview]
Message-ID: <50598D7E.8010909@redhat.com> (raw)
In-Reply-To: <1347961897-28554-1-git-send-email-kraxel@redhat.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [RfC PATCH] vga: add mmio bar to standard vga
Date: Wed, 19 Sep 2012 12:16:46 +0300	[thread overview]
Message-ID: <50598D7E.8010909@redhat.com> (raw)
In-Reply-To: <1347961897-28554-1-git-send-email-kraxel@redhat.com>

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

  parent reply	other threads:[~2012-09-19  9:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18  9:51 [RfC PATCH] vga: add mmio bar to standard vga Gerd Hoffmann
2012-09-18  9:51 ` [Qemu-devel] " Gerd Hoffmann
2012-09-18 10:32 ` Benjamin Herrenschmidt
2012-09-18 10:32   ` [Qemu-devel] " Benjamin Herrenschmidt
2012-09-18 11:49   ` Gerd Hoffmann
2012-09-18 11:49     ` [Qemu-devel] " Gerd Hoffmann
2012-09-19  9:16 ` Avi Kivity [this message]
2012-09-19  9:16   ` Avi Kivity
2012-09-19 11:35   ` Gerd Hoffmann
2012-09-19 11:35     ` [Qemu-devel] " Gerd Hoffmann
2012-09-19 12:13     ` Avi Kivity
2012-09-19 12:13       ` [Qemu-devel] " Avi Kivity
2012-09-19 18:45 ` Blue Swirl
2012-09-20  5:43   ` Gerd Hoffmann
2012-09-22 12:12     ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50598D7E.8010909@redhat.com \
    --to=avi@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.