qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] kvm/valgrind: dont mark memory as initialized
@ 2014-09-25 19:07 Christian Borntraeger
  2014-09-25 19:40 ` Peter Maydell
  2014-09-26  8:18 ` Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Borntraeger @ 2014-09-25 19:07 UTC (permalink / raw)
  To: pbonzini; +Cc: Christian Borntraeger, qemu-devel

since commit 7dda5dc82a77 ("migration: initialize RAM to zero") the
guest memory is defined zero. No need to call valgrind on guest memory.
This reverts commit 62fe83318d2f ("qemu: Use valgrind annotations to
mark kvm guest memory as defined") thus speeding up kvm start if
<includedir>/valgrind/valgrind.h is available.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 configure |    3 +--
 kvm-all.c |    7 -------
 2 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index eb9cbcd..3dfb339 100755
--- a/configure
+++ b/configure
@@ -3968,12 +3968,11 @@ else
 fi
 
 ########################################
-# check if we have valgrind/valgrind.h and valgrind/memcheck.h
+# check if we have valgrind/valgrind.h
 
 valgrind_h=no
 cat > $TMPC << EOF
 #include <valgrind/valgrind.h>
-#include <valgrind/memcheck.h>
 int main(void) {
   return 0;
 }
diff --git a/kvm-all.c b/kvm-all.c
index 8b9e66d..cf822a4 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -44,10 +44,6 @@
 #include <sys/eventfd.h>
 #endif
 
-#ifdef CONFIG_VALGRIND_H
-#include <valgrind/memcheck.h>
-#endif
-
 /* KVM uses PAGE_SIZE in its definition of COALESCED_MMIO_MAX */
 #define PAGE_SIZE TARGET_PAGE_SIZE
 
@@ -1954,9 +1950,6 @@ int kvm_has_intx_set_mask(void)
 
 void kvm_setup_guest_memory(void *start, size_t size)
 {
-#ifdef CONFIG_VALGRIND_H
-    VALGRIND_MAKE_MEM_DEFINED(start, size);
-#endif
     if (!kvm_has_sync_mmu()) {
         int ret = qemu_madvise(start, size, QEMU_MADV_DONTFORK);
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] kvm/valgrind: dont mark memory as initialized
  2014-09-25 19:07 [Qemu-devel] [PATCH] kvm/valgrind: dont mark memory as initialized Christian Borntraeger
@ 2014-09-25 19:40 ` Peter Maydell
  2014-09-26  8:18 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2014-09-25 19:40 UTC (permalink / raw)
  To: Christian Borntraeger; +Cc: Paolo Bonzini, QEMU Developers

On 25 September 2014 20:07, Christian Borntraeger
<borntraeger@de.ibm.com> wrote:
> since commit 7dda5dc82a77 ("migration: initialize RAM to zero") the
> guest memory is defined zero. No need to call valgrind on guest memory.
> This reverts commit 62fe83318d2f ("qemu: Use valgrind annotations to
> mark kvm guest memory as defined") thus speeding up kvm start if
> <includedir>/valgrind/valgrind.h is available.

Would be nice if somebody could fix the missing apostrophe
in the Subject in the course of commiting this, assuming
it doesn't need a respin for some other reason.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] kvm/valgrind: dont mark memory as initialized
  2014-09-25 19:07 [Qemu-devel] [PATCH] kvm/valgrind: dont mark memory as initialized Christian Borntraeger
  2014-09-25 19:40 ` Peter Maydell
@ 2014-09-26  8:18 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2014-09-26  8:18 UTC (permalink / raw)
  To: Christian Borntraeger; +Cc: qemu-devel

Il 25/09/2014 21:07, Christian Borntraeger ha scritto:
> since commit 7dda5dc82a77 ("migration: initialize RAM to zero") the
> guest memory is defined zero. No need to call valgrind on guest memory.
> This reverts commit 62fe83318d2f ("qemu: Use valgrind annotations to
> mark kvm guest memory as defined") thus speeding up kvm start if
> <includedir>/valgrind/valgrind.h is available.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  configure |    3 +--
>  kvm-all.c |    7 -------
>  2 files changed, 1 insertions(+), 9 deletions(-)
> 
> diff --git a/configure b/configure
> index eb9cbcd..3dfb339 100755
> --- a/configure
> +++ b/configure
> @@ -3968,12 +3968,11 @@ else
>  fi
>  
>  ########################################
> -# check if we have valgrind/valgrind.h and valgrind/memcheck.h
> +# check if we have valgrind/valgrind.h
>  
>  valgrind_h=no
>  cat > $TMPC << EOF
>  #include <valgrind/valgrind.h>
> -#include <valgrind/memcheck.h>
>  int main(void) {
>    return 0;
>  }
> diff --git a/kvm-all.c b/kvm-all.c
> index 8b9e66d..cf822a4 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -44,10 +44,6 @@
>  #include <sys/eventfd.h>
>  #endif
>  
> -#ifdef CONFIG_VALGRIND_H
> -#include <valgrind/memcheck.h>
> -#endif
> -
>  /* KVM uses PAGE_SIZE in its definition of COALESCED_MMIO_MAX */
>  #define PAGE_SIZE TARGET_PAGE_SIZE
>  
> @@ -1954,9 +1950,6 @@ int kvm_has_intx_set_mask(void)
>  
>  void kvm_setup_guest_memory(void *start, size_t size)
>  {
> -#ifdef CONFIG_VALGRIND_H
> -    VALGRIND_MAKE_MEM_DEFINED(start, size);
> -#endif
>      if (!kvm_has_sync_mmu()) {
>          int ret = qemu_madvise(start, size, QEMU_MADV_DONTFORK);
>  
> 

Thanks, applying to uq/master.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-26  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-25 19:07 [Qemu-devel] [PATCH] kvm/valgrind: dont mark memory as initialized Christian Borntraeger
2014-09-25 19:40 ` Peter Maydell
2014-09-26  8:18 ` Paolo Bonzini

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).