qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-5.0 0/2] fix qemu crash with memory-backend-* prealloc=yes
@ 2020-03-25  9:44 Igor Mammedov
  2020-03-25  9:44 ` [PATCH for-5.0 1/2] hostmem: set default prealloc_threads to valid value Igor Mammedov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Igor Mammedov @ 2020-03-25  9:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: lvivier, pbonzini, thuth, ehabkost


Igor Mammedov (2):
  hostmem: set default prealloc_threads to valid value
  tests: numa: test one backend with prealloc enabled

 backends/hostmem.c      | 1 +
 tests/qtest/numa-test.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

-- 
2.18.1



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

* [PATCH for-5.0 1/2] hostmem: set default prealloc_threads to valid value
  2020-03-25  9:44 [PATCH for-5.0 0/2] fix qemu crash with memory-backend-* prealloc=yes Igor Mammedov
@ 2020-03-25  9:44 ` Igor Mammedov
  2020-03-25  9:55   ` Laurent Vivier
  2020-03-25  9:44 ` [PATCH for-5.0 2/2] tests: numa: test one backend with prealloc enabled Igor Mammedov
  2020-04-09 13:03 ` [PATCH for-5.0 0/2] fix qemu crash with memory-backend-* prealloc=yes Igor Mammedov
  2 siblings, 1 reply; 5+ messages in thread
From: Igor Mammedov @ 2020-03-25  9:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: lvivier, pbonzini, thuth, ehabkost

Commit 4ebc74dbbf removed default prealloc_threads initialization
by mistake, and that makes QEMU crash with division on zero at
  numpages_per_thread = numpages / memset_num_threads;
when QEMU is started with following backend
  -object memory-backend-ram,id=ram-node0,prealloc=yes,size=128M

Return back initialization removed by 4ebc74dbbf to fix issue.

Fixes: 4ebc74dbbf7ad50e4101629f3f5da5fdc1544051
Reported-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 backends/hostmem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/backends/hostmem.c b/backends/hostmem.c
index a70867b255..327f9eebc3 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -280,6 +280,7 @@ static void host_memory_backend_init(Object *obj)
     /* TODO: convert access to globals to compat properties */
     backend->merge = machine_mem_merge(machine);
     backend->dump = machine_dump_guest_core(machine);
+    backend->prealloc_threads = 1;
 }
 
 static void host_memory_backend_post_init(Object *obj)
-- 
2.18.1



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

* [PATCH for-5.0 2/2] tests: numa: test one backend with prealloc enabled
  2020-03-25  9:44 [PATCH for-5.0 0/2] fix qemu crash with memory-backend-* prealloc=yes Igor Mammedov
  2020-03-25  9:44 ` [PATCH for-5.0 1/2] hostmem: set default prealloc_threads to valid value Igor Mammedov
@ 2020-03-25  9:44 ` Igor Mammedov
  2020-04-09 13:03 ` [PATCH for-5.0 0/2] fix qemu crash with memory-backend-* prealloc=yes Igor Mammedov
  2 siblings, 0 replies; 5+ messages in thread
From: Igor Mammedov @ 2020-03-25  9:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: lvivier, pbonzini, thuth, ehabkost

canbalize one backend in hmat test to make sure that
prealloc=y is tested

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 tests/qtest/numa-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/numa-test.c b/tests/qtest/numa-test.c
index 2f9b7f663a..e1ed6d4322 100644
--- a/tests/qtest/numa-test.c
+++ b/tests/qtest/numa-test.c
@@ -455,7 +455,7 @@ static void pc_hmat_off_cfg(const void *data)
     cli = make_cli(data, "-nodefaults --preconfig "
                          "-smp 2,sockets=2 "
                          "-m 128M,slots=2,maxmem=1G "
-                         "-object memory-backend-ram,size=64M,id=m0 "
+                         "-object memory-backend-ram,size=64M,id=m0,prealloc=y "
                          "-object memory-backend-ram,size=64M,id=m1 "
                          "-numa node,nodeid=0,memdev=m0");
     qs = qtest_init(cli);
-- 
2.18.1



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

* Re: [PATCH for-5.0 1/2] hostmem: set default prealloc_threads to valid value
  2020-03-25  9:44 ` [PATCH for-5.0 1/2] hostmem: set default prealloc_threads to valid value Igor Mammedov
@ 2020-03-25  9:55   ` Laurent Vivier
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Vivier @ 2020-03-25  9:55 UTC (permalink / raw)
  To: Igor Mammedov, qemu-devel; +Cc: pbonzini, thuth, ehabkost

On 25/03/2020 10:44, Igor Mammedov wrote:
> Commit 4ebc74dbbf removed default prealloc_threads initialization
> by mistake, and that makes QEMU crash with division on zero at
>   numpages_per_thread = numpages / memset_num_threads;
> when QEMU is started with following backend
>   -object memory-backend-ram,id=ram-node0,prealloc=yes,size=128M
> 
> Return back initialization removed by 4ebc74dbbf to fix issue.
> 
> Fixes: 4ebc74dbbf7ad50e4101629f3f5da5fdc1544051
> Reported-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  backends/hostmem.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/backends/hostmem.c b/backends/hostmem.c
> index a70867b255..327f9eebc3 100644
> --- a/backends/hostmem.c
> +++ b/backends/hostmem.c
> @@ -280,6 +280,7 @@ static void host_memory_backend_init(Object *obj)
>      /* TODO: convert access to globals to compat properties */
>      backend->merge = machine_mem_merge(machine);
>      backend->dump = machine_dump_guest_core(machine);
> +    backend->prealloc_threads = 1;
>  }
>  
>  static void host_memory_backend_post_init(Object *obj)
> 

Reviewed-by: Laurent Vivier <lvivier@redhat.com>



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

* Re: [PATCH for-5.0 0/2] fix qemu crash with memory-backend-* prealloc=yes
  2020-03-25  9:44 [PATCH for-5.0 0/2] fix qemu crash with memory-backend-* prealloc=yes Igor Mammedov
  2020-03-25  9:44 ` [PATCH for-5.0 1/2] hostmem: set default prealloc_threads to valid value Igor Mammedov
  2020-03-25  9:44 ` [PATCH for-5.0 2/2] tests: numa: test one backend with prealloc enabled Igor Mammedov
@ 2020-04-09 13:03 ` Igor Mammedov
  2 siblings, 0 replies; 5+ messages in thread
From: Igor Mammedov @ 2020-04-09 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: lvivier, pbonzini, thuth, ehabkost, Peter Maydell

On Wed, 25 Mar 2020 05:44:21 -0400
Igor Mammedov <imammedo@redhat.com> wrote:

> Igor Mammedov (2):
>   hostmem: set default prealloc_threads to valid value
>   tests: numa: test one backend with prealloc enabled
> 
>  backends/hostmem.c      | 1 +
>  tests/qtest/numa-test.c | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 

it looks like it's fallen through cracks.

Peter, Paolo

Could you pick it up for 5.0, pls?



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

end of thread, other threads:[~2020-04-09 13:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25  9:44 [PATCH for-5.0 0/2] fix qemu crash with memory-backend-* prealloc=yes Igor Mammedov
2020-03-25  9:44 ` [PATCH for-5.0 1/2] hostmem: set default prealloc_threads to valid value Igor Mammedov
2020-03-25  9:55   ` Laurent Vivier
2020-03-25  9:44 ` [PATCH for-5.0 2/2] tests: numa: test one backend with prealloc enabled Igor Mammedov
2020-04-09 13:03 ` [PATCH for-5.0 0/2] fix qemu crash with memory-backend-* prealloc=yes Igor Mammedov

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