All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 12/21] Remove odd hack in vga.c
Date: Thu, 30 Apr 2009 12:39:01 +0300	[thread overview]
Message-ID: <49F971B5.8060701@redhat.com> (raw)
In-Reply-To: <1241040038-17183-13-git-send-email-aliguori@us.ibm.com>

Anthony Liguori wrote:
> I looked closely at the vga code in kvm-userspace a while ago and merged
> every fix I could understand into upstream QEMU.  This particular change makes
> no sense to me.  I could not figure out from revision history what it actually
> fixed.  I'm fairly certain it's not useful today.
>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> ---
>  hw/vga.c |   27 ++++-----------------------
>  1 files changed, 4 insertions(+), 23 deletions(-)
>
> diff --git a/hw/vga.c b/hw/vga.c
> index d96f1be..385184a 100644
> --- a/hw/vga.c
> +++ b/hw/vga.c
> @@ -2227,33 +2227,14 @@ typedef struct PCIVGAState {
>      VGAState vga_state;
>  } PCIVGAState;
>  
> -static int s1, s2;
> -
> -static void mark_dirty(target_phys_addr_t start, target_phys_addr_t len)
> -{
> -    target_phys_addr_t end = start + len;
> -
> -    while (start < end) {
> -        cpu_physical_memory_set_dirty(cpu_get_physical_page_desc(start));
> -        start += TARGET_PAGE_SIZE;
> -    }
> -}
> -
>  void vga_dirty_log_start(VGAState *s)
>  {
>      if (kvm_enabled() && s->map_addr)
> -        if (!s1) {
> -            kvm_log_start(s->map_addr, s->map_end - s->map_addr);
> -            mark_dirty(s->map_addr, s->map_end - s->map_addr);
> -            s1 = 1;
> -        }
> +        kvm_log_start(s->map_addr, s->map_end - s->map_addr);
> +
>      if (kvm_enabled() && s->lfb_vram_mapped) {
> -        if (!s2) {
> -            kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
> -            kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
> -            mark_dirty(isa_mem_base + 0xa0000, 0x10000);
> -        }
> -        s2 = 1;
> +        kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
> +        kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
>      }
>  }
>  
>   

This makes live migration and vga dirty tracking work together.  
Unfortunately since the last merge with qemu it's broken.

We have a shared resource, the log_dirty flag of memory slots.  We can't 
call log_start() and log_stop() from different users and expect things 
to work.

One cleaner way to fix this is to add a parameter containing the mask 
which will be used by the client to access the qemu bytemap.  
log_start() can OR this parameter with its own copy, and log_stop() can 
AND NOT the same thing.  When the local copy is nonzero, the slot dirty 
log is enabled.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-04-30  9:39 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29 21:20 [PATCH 0/21] Remove merge artifacts from qemu-kvm Anthony Liguori
2009-04-29 21:20 ` [PATCH 01/21] Remove memalign call for guess_disk_lchs Anthony Liguori
2009-04-29 21:20 ` [PATCH 02/21] Remove devfn from BlockDriverState Anthony Liguori
2009-04-29 21:20 ` [PATCH 03/21] Remove use of signalfd in block-raw-posix.c Anthony Liguori
2009-04-30  9:28   ` Avi Kivity
2009-04-30 12:54     ` Anthony Liguori
2009-04-30 13:05       ` Avi Kivity
2009-04-30 13:28         ` Anthony Liguori
2009-04-30 13:36           ` Avi Kivity
2009-05-03 16:48             ` Avi Kivity
2009-04-29 21:20 ` [PATCH 04/21] Remove stray whitespace Anthony Liguori
2009-04-29 21:20 ` [PATCH 05/21] Remove extra call to kvm_cpu_exec() Anthony Liguori
2009-04-29 21:20 ` [PATCH 06/21] Remove dead functions from cutils Anthony Liguori
2009-04-29 21:20 ` [PATCH 07/21] Remove dead macros likely/unlikely in exec.c Anthony Liguori
2009-04-29 21:20 ` [PATCH 08/21] Remove leftovers in device-hotplug.c Anthony Liguori
2009-04-29 21:20 ` [PATCH 09/21] Remove unnecessary setting of cmos smp_cpu count Anthony Liguori
2009-04-29 21:20 ` [PATCH 10/21] Remove IBM copyright in unmodified file in upstream Anthony Liguori
2009-04-29 21:38   ` Hollis Blanchard
2009-04-29 21:20 ` [PATCH 11/21] Remove unused variables in vga.c Anthony Liguori
2009-04-30  9:33   ` Avi Kivity
2009-04-30 13:09     ` Anthony Liguori
2009-04-29 21:20 ` [PATCH 12/21] Remove odd hack " Anthony Liguori
2009-04-30  9:39   ` Avi Kivity [this message]
2009-04-29 21:20 ` [PATCH 13/21] Remove virtio-console PIF change Anthony Liguori
2009-04-30  9:40   ` Avi Kivity
2009-04-29 21:20 ` [PATCH 14/21] Remove -cpu-vendor-string Anthony Liguori
2009-04-30  9:41   ` Avi Kivity
2009-04-30 13:10     ` Anthony Liguori
2009-04-30 13:16       ` Avi Kivity
2009-04-30 13:26         ` Anthony Liguori
2009-04-30 13:33           ` Avi Kivity
2009-04-29 21:20 ` [PATCH 15/21] Remove defined(TARGET_X86_64) Anthony Liguori
2009-04-29 21:20 ` [PATCH 16/21] Remove clean rule change Anthony Liguori
2009-04-30  9:42   ` Avi Kivity
2009-04-30 15:10     ` Hollis Blanchard
2009-04-30 15:13       ` Avi Kivity
2009-04-29 21:20 ` [PATCH 17/21] Remove #define __user in usb-linux.c Anthony Liguori
2009-04-30  9:43   ` Avi Kivity
2009-04-30 13:11     ` Anthony Liguori
2009-04-30 13:17       ` Avi Kivity
2009-04-30 13:20         ` Anthony Liguori
2009-04-29 21:20 ` [PATCH 18/21] Remove host_alarm_timer hacks Anthony Liguori
2009-04-30  9:44   ` Avi Kivity
2009-04-30 13:19     ` Anthony Liguori
2009-04-30 13:25       ` Avi Kivity
2009-04-30 13:37         ` Anthony Liguori
2009-04-30 15:46           ` Avi Kivity
2009-04-30 15:49             ` Anthony Liguori
2009-04-30 15:53               ` Avi Kivity
2009-04-29 21:20 ` [PATCH 19/21] Use QEMU_PKGVERSION to declare kvm-devel Anthony Liguori
2009-04-29 21:20 ` [PATCH 20/21] Get rid of qemu_get_launch_info() Anthony Liguori
2009-04-29 21:20 ` [PATCH 21/21] Leave upstream QEMU comments intact Anthony Liguori
2009-04-30  9:50 ` [PATCH 0/21] Remove merge artifacts from qemu-kvm Avi Kivity

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=49F971B5.8060701@redhat.com \
    --to=avi@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=kvm@vger.kernel.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.