All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] win32 fixes for NUMA merge
@ 2014-06-19 13:35 Paolo Bonzini
  2014-06-19 13:35 ` [Qemu-devel] [PATCH 1/2] fixup! memory: move preallocation code out of exec.c Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paolo Bonzini @ 2014-06-19 13:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst

Patch 1 adds a Win32 implementation of preallocation.  Patch 2 fixes
an initialization issue where the ram_list mutex was used before
initialization.  On Win32 this results in a deadlock.

Paolo

Paolo Bonzini (2):
  fixup! memory: move preallocation code out of exec.c
  fixup! numa: add -numa node,memdev= option

 include/sysemu/os-win32.h |  2 ++
 translate-all.c           |  7 -------
 util/oslib-win32.c        | 19 +++++++++++++++++++
 vl.c                      |  4 ++--
 4 files changed, 23 insertions(+), 9 deletions(-)

-- 
1.9.3

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

* [Qemu-devel] [PATCH 1/2] fixup! memory: move preallocation code out of exec.c
  2014-06-19 13:35 [Qemu-devel] [PATCH 0/2] win32 fixes for NUMA merge Paolo Bonzini
@ 2014-06-19 13:35 ` Paolo Bonzini
  2014-06-19 13:35 ` [Qemu-devel] [PATCH 2/2] fixup! numa: add -numa node, memdev= option Paolo Bonzini
  2014-06-19 13:47 ` [Qemu-devel] [PATCH 0/2] win32 fixes for NUMA merge Michael S. Tsirkin
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2014-06-19 13:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst

Since we need the page size for efficiency, move code to compute it
out of translate-all.c and into util/oslib-win32.c.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/sysemu/os-win32.h |  2 ++
 translate-all.c           |  7 -------
 util/oslib-win32.c        | 19 +++++++++++++++++++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index bf8523a..af3fbc4 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -89,6 +89,8 @@ static inline void os_setup_post(void) {}
 void os_set_line_buffering(void);
 static inline void os_set_proc_name(const char *dummy) {}
 
+size_t getpagesize(void);
+
 #if !defined(EPROTONOSUPPORT)
 # define EPROTONOSUPPORT EINVAL
 #endif
diff --git a/translate-all.c b/translate-all.c
index 6b7b46e..5425d03 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -295,14 +295,7 @@ void page_size_init(void)
 {
     /* NOTE: we can always suppose that qemu_host_page_size >=
        TARGET_PAGE_SIZE */
-#ifdef _WIN32
-    SYSTEM_INFO system_info;
-
-    GetSystemInfo(&system_info);
-    qemu_real_host_page_size = system_info.dwPageSize;
-#else
     qemu_real_host_page_size = getpagesize();
-#endif
     if (qemu_host_page_size == 0) {
         qemu_host_page_size = qemu_real_host_page_size;
     }
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 69552f7..ee6bcf1 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -350,3 +350,22 @@ gint g_poll_fixed(GPollFD *fds, guint nfds, gint timeout)
 
     return num_completed;
 }
+
+size_t getpagesize(void)
+{
+    SYSTEM_INFO system_info;
+
+    GetSystemInfo(&system_info);
+    return system_info.dwPageSize;
+}
+
+void os_mem_prealloc(int fd, char *area, size_t memory)
+{
+    int i;
+    size_t pagesize = getpagesize();
+
+    memory = (memory + pagesize - 1) & -pagesize;
+    for (i = 0; i < memory / pagesize; i++) {
+        memset(area + pagesize * i, 0, 1);
+    }
+}
-- 
1.9.3

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

* [Qemu-devel] [PATCH 2/2] fixup! numa: add -numa node, memdev= option
  2014-06-19 13:35 [Qemu-devel] [PATCH 0/2] win32 fixes for NUMA merge Paolo Bonzini
  2014-06-19 13:35 ` [Qemu-devel] [PATCH 1/2] fixup! memory: move preallocation code out of exec.c Paolo Bonzini
@ 2014-06-19 13:35 ` Paolo Bonzini
  2014-06-19 13:47 ` [Qemu-devel] [PATCH 0/2] win32 fixes for NUMA merge Michael S. Tsirkin
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2014-06-19 13:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 vl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index 317b436..54b4627 100644
--- a/vl.c
+++ b/vl.c
@@ -3959,6 +3959,8 @@ int main(int argc, char **argv, char **envp)
         exit(1);
     }
 
+    cpu_exec_init_all();
+
     current_machine = MACHINE(object_new(object_class_get_name(
                           OBJECT_CLASS(machine_class))));
     object_property_add_child(object_get_root(), "machine",
@@ -4296,8 +4298,6 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
-    cpu_exec_init_all();
-
     blk_mig_init();
     ram_mig_init();
 
-- 
1.9.3

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

* Re: [Qemu-devel] [PATCH 0/2] win32 fixes for NUMA merge
  2014-06-19 13:35 [Qemu-devel] [PATCH 0/2] win32 fixes for NUMA merge Paolo Bonzini
  2014-06-19 13:35 ` [Qemu-devel] [PATCH 1/2] fixup! memory: move preallocation code out of exec.c Paolo Bonzini
  2014-06-19 13:35 ` [Qemu-devel] [PATCH 2/2] fixup! numa: add -numa node, memdev= option Paolo Bonzini
@ 2014-06-19 13:47 ` Michael S. Tsirkin
  2 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2014-06-19 13:47 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On Thu, Jun 19, 2014 at 03:35:42PM +0200, Paolo Bonzini wrote:
> Patch 1 adds a Win32 implementation of preallocation.  Patch 2 fixes
> an initialization issue where the ram_list mutex was used before
> initialization.  On Win32 this results in a deadlock.
> 
> Paolo

Applied, thanks a lot.

> Paolo Bonzini (2):
>   fixup! memory: move preallocation code out of exec.c
>   fixup! numa: add -numa node,memdev= option
> 
>  include/sysemu/os-win32.h |  2 ++
>  translate-all.c           |  7 -------
>  util/oslib-win32.c        | 19 +++++++++++++++++++
>  vl.c                      |  4 ++--
>  4 files changed, 23 insertions(+), 9 deletions(-)
> 
> -- 
> 1.9.3

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

end of thread, other threads:[~2014-06-19 13:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-19 13:35 [Qemu-devel] [PATCH 0/2] win32 fixes for NUMA merge Paolo Bonzini
2014-06-19 13:35 ` [Qemu-devel] [PATCH 1/2] fixup! memory: move preallocation code out of exec.c Paolo Bonzini
2014-06-19 13:35 ` [Qemu-devel] [PATCH 2/2] fixup! numa: add -numa node, memdev= option Paolo Bonzini
2014-06-19 13:47 ` [Qemu-devel] [PATCH 0/2] win32 fixes for NUMA merge Michael S. Tsirkin

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.