All of lore.kernel.org
 help / color / mirror / Atom feed
From: Orit Wasserman <owasserm@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: chegu_vinod@hp.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/7] Only TCG needs TLB handling
Date: Thu, 14 Jun 2012 14:15:16 +0300	[thread overview]
Message-ID: <4FD9C7C4.9020709@redhat.com> (raw)
In-Reply-To: <4cc6c255d3c62a99c267c08901e9894ec9496abb.1337710679.git.quintela@redhat.com>

On 05/22/2012 09:32 PM, Juan Quintela wrote:
> Refactor the code that is only needed for tcg to an static function.
> Call that only when tcg is enabled.  We can't refactor to a dummy
> function in the kvm case, as qemu can be compiled at the same time
> with tcg and kvm.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  exec.c |   31 +++++++++++++++++++++----------
>  1 files changed, 21 insertions(+), 10 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index a0494c7..b6c7675 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1943,11 +1943,29 @@ void tb_flush_jmp_cache(CPUArchState *env, target_ulong addr)
>              TB_JMP_PAGE_SIZE * sizeof(TranslationBlock *));
>  }
> 
> +static void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t end,
> +                                      uintptr_t length)
> +{
> +    uintptr_t start1;
> +
> +    /* we modify the TLB cache so that the dirty bit will be set again
> +       when accessing the range */
> +    start1 = (uintptr_t)qemu_safe_ram_ptr(start);
> +    /* Check that we don't span multiple blocks - this breaks the
> +       address comparisons below.  */
> +    if ((uintptr_t)qemu_safe_ram_ptr(end - 1) - start1
> +            != (end - 1) - start) {
> +        abort();
> +    }
> +    cpu_tlb_reset_dirty_all(start1, length);
> +
> +}
> +
>  /* Note: start and end must be within the same ram block.  */
>  void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,
>                                       int dirty_flags)
>  {
> -    uintptr_t length, start1;
> +    uintptr_t length;
> 
>      start &= TARGET_PAGE_MASK;
>      end = TARGET_PAGE_ALIGN(end);
> @@ -1957,16 +1975,9 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,
>          return;
>      cpu_physical_memory_mask_dirty_range(start, length, dirty_flags);
> 
> -    /* we modify the TLB cache so that the dirty bit will be set again
> -       when accessing the range */
> -    start1 = (uintptr_t)qemu_safe_ram_ptr(start);
> -    /* Check that we don't span multiple blocks - this breaks the
> -       address comparisons below.  */
> -    if ((uintptr_t)qemu_safe_ram_ptr(end - 1) - start1
> -            != (end - 1) - start) {
> -        abort();
> +    if (tcg_enabled()) {
> +        tlb_reset_dirty_range_all(start, end, length);
>      }
> -    cpu_tlb_reset_dirty_all(start1, length);
>  }
> 
>  int cpu_physical_memory_set_dirty_tracking(int enable)

Reviewed-by: Orit Wasserman <owasserm@redhat.com>

  reply	other threads:[~2012-06-14 11:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22 18:32 [Qemu-devel] [RFC 0/7] Fix migration with lots of memory Juan Quintela
2012-05-22 18:32 ` [Qemu-devel] [PATCH 1/7] Add spent time for migration Juan Quintela
2012-06-14 10:52   ` Orit Wasserman
2012-05-22 18:32 ` [Qemu-devel] [PATCH 2/7] Add tracepoints for savevm section start/end Juan Quintela
2012-06-14 11:00   ` Orit Wasserman
2012-05-22 18:32 ` [Qemu-devel] [PATCH 3/7] No need to iterate if we already are over the limit Juan Quintela
2012-06-14 11:03   ` Orit Wasserman
2012-05-22 18:32 ` [Qemu-devel] [PATCH 4/7] Only TCG needs TLB handling Juan Quintela
2012-06-14 11:15   ` Orit Wasserman [this message]
2012-05-22 18:32 ` [Qemu-devel] [PATCH 5/7] Only calculate expected_time for stage 2 Juan Quintela
2012-06-14 11:31   ` Orit Wasserman
2012-05-22 18:32 ` [Qemu-devel] [PATCH 6/7] Exit loop if we have been there too long Juan Quintela
2012-06-14 11:36   ` Orit Wasserman
2012-06-21 19:34     ` Juan Quintela
2012-06-22  2:42       ` 陳韋任 (Wei-Ren Chen)
2012-06-22 12:44         ` Juan Quintela
2012-05-22 18:32 ` [Qemu-devel] [PATCH 7/7] Maintaing number of dirty pages Juan Quintela
2012-06-14 11:42   ` Orit Wasserman
2012-06-11  3:56 ` [Qemu-devel] [RFC 0/7] Fix migration with lots of memory Chegu Vinod

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=4FD9C7C4.9020709@redhat.com \
    --to=owasserm@redhat.com \
    --cc=chegu_vinod@hp.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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.