qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 5/6] vga: Use linear mapping + dirty logging in chain 4 memory access mode
Date: Wed, 17 Aug 2011 16:38:30 -0700	[thread overview]
Message-ID: <4E4C50F6.20208@redhat.com> (raw)
In-Reply-To: <4da1c5e91e8f61b6c17aa0756006d030013bedd8.1313620857.git.jan.kiszka@web.de>

On 08/17/2011 03:41 PM, Jan Kiszka wrote:
> From: Jan Kiszka<jan.kiszka@siemens.com>
>
> Most VGA memory access modes require MMIO handling as they demand weird
> logic to get a byte from or into the video RAM. However, there is one
> exception: chain 4 mode with all memory planes enabled for writing. This
> mode actually allows lineary mapping, which can then be combined with
> dirty logging to accelerate KVM.
>
> This patch accelerates specifically VBE accesses like they are used by
> grub in graphical mode. Not only the standard VGA adapter benefits from
> this, also vmware and spice in VGA mode.

Excellent, this slowness is very annoying.

>
> +static void vga_update_memory_access(VGACommonState *s)
> +{
> +    MemoryRegion *region, *old_region = s->chain4_alias;
> +    target_phys_addr_t base, offset, size;
> +
> +    s->chain4_alias = NULL;
> +
> +    if ((s->sr[0x02]&  0xf) == 0xf&&  s->sr[0x04]&  0x08) {
> +        offset = 0;
> +        switch ((s->gr[6]>>  2)&  3) {
> +        case 0:
> +            base = 0xa0000;
> +            size = 0x20000;
> +            break;
> +        case 1:
> +            base = 0xa0000;
> +            size = 0x10000;
> +            offset = s->bank_offset;
> +            break;
> +        case 2:
> +            base = 0xb0000;
> +            size = 0x8000;
> +            break;
> +        case 3:
> +            base = 0xb8000;
> +            size = 0x8000;
> +            break;
> +        }
> +        region = qemu_malloc(sizeof(*region));
> +        memory_region_init_alias(region, "vga.chain4",&s->vram, offset, size);
> +        memory_region_add_subregion_overlap(get_system_memory(), base,
> +                                            region, 2);

get_system_memory() has been excised from vga in batch 4 of my patches, 
please adjust.

> +        s->chain4_alias = region;
> +    }
> +    if (old_region) {
> +        memory_region_del_subregion(get_system_memory(), old_region);
> +        memory_region_destroy(old_region);
> +        qemu_free(old_region);
> +    }
> +}
> +
>

The mmio code has

             s->plane_updated |= mask; /* only used to detect font change */

aren't we losing it?  we could easily recover it via dirty logging.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

  reply	other threads:[~2011-08-17 23:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17 22:40 [Qemu-devel] [PATCH v2 0/6] vga: dirty log cleanup, more linear mapping Jan Kiszka
2011-08-17 22:40 ` [Qemu-devel] [PATCH v2 1/6] vmware-vga: Register reset service Jan Kiszka
2011-08-17 22:40 ` [Qemu-devel] [PATCH v2 2/6] vmware-vga: Disable verbose mode Jan Kiszka
2011-08-17 22:41 ` [Qemu-devel] [PATCH v2 3/6] vmware-vga: Remove dead DIRECT_VRAM mode Jan Kiszka
2011-08-17 22:41 ` [Qemu-devel] [PATCH v2 4/6] vmware-vga: Eliminate vga_dirty_log_restart Jan Kiszka
2011-08-17 22:41 ` [Qemu-devel] [PATCH v2 5/6] vga: Use linear mapping + dirty logging in chain 4 memory access mode Jan Kiszka
2011-08-17 23:38   ` Avi Kivity [this message]
2011-08-17 23:48     ` Avi Kivity
2011-08-18 22:26       ` Jan Kiszka
2011-08-19 15:19         ` Avi Kivity
2011-08-19 21:26           ` Jan Kiszka
2011-08-17 22:41 ` [Qemu-devel] [PATCH v2 6/6] vga: Drop some unused fields Jan Kiszka

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=4E4C50F6.20208@redhat.com \
    --to=avi@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=jan.kiszka@web.de \
    --cc=kraxel@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).