[Qemu-devel] [PATCH v3 25/29] numa: Move remaining NUMA declarations from sysemu.h to numa.h

Markus Armbruster posted 29 patches 6 years, 6 months ago
Maintainers: Helge Deller <deller@gmx.de>, Marek Vasut <marex@denx.de>, Kevin Wolf <kwolf@redhat.com>, Andrey Smirnov <andrew.smirnov@gmail.com>, Stefan Berger <stefanb@linux.ibm.com>, Yuval Shaia <yuval.shaia@oracle.com>, Jia Liu <proljc@gmail.com>, Alberto Garcia <berto@igalia.com>, Jiri Pirko <jiri@resnulli.us>, Riku Voipio <riku.voipio@iki.fi>, Laurent Vivier <laurent@vivier.eu>, "Hervé Poussineau" <hpoussin@reactos.org>, Halil Pasic <pasic@linux.ibm.com>, Leif Lindholm <leif.lindholm@linaro.org>, John Snow <jsnow@redhat.com>, Jean-Christophe Dubois <jcd@tribudubois.net>, Igor Mitsyanko <i.mitsyanko@gmail.com>, Juan Quintela <quintela@redhat.com>, Paul Durrant <paul.durrant@citrix.com>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, Jason Wang <jasowang@redhat.com>, Jiri Slaby <jslaby@suse.cz>, Aleksandar Markovic <amarkovic@wavecomp.com>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>, Alistair Francis <alistair@alistair23.me>, Radoslaw Biernacki <radoslaw.biernacki@linaro.org>, Guan Xuetao <gxt@mprc.pku.edu.cn>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, Greg Kurz <groug@kaod.org>, Fabien Chouteau <chouteau@adacore.com>, Cornelia Huck <cohuck@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>, Paul Burton <pburton@wavecomp.com>, Peter Chubb <peter.chubb@nicta.com.au>, Laszlo Ersek <lersek@redhat.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Andrzej Zaborowski <balrogg@gmail.com>, Liu Yuan <namei.unix@gmail.com>, Joel Stanley <joel@jms.id.au>, Subbaraya Sundeep <sundeep.lkml@gmail.com>, Stefano Stabellini <sstabellini@kernel.org>, Peter Lieven <pl@kamp.de>, "Michael S. Tsirkin" <mst@redhat.com>, Alex Williamson <alex.williamson@redhat.com>, Artyom Tarasenko <atar4qemu@gmail.com>, Alistair Francis <Alistair.Francis@wdc.com>, "Alex Bennée" <alex.bennee@linaro.org>, Amit Shah <amit@kernel.org>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Thomas Huth <huth@tuxfamily.org>, Aurelien Jarno <aurelien@aurel32.net>, Anthony Perard <anthony.perard@citrix.com>, Xie Changlong <xiechanglong.d@gmail.com>, Shannon Zhao <shannon.zhaosl@gmail.com>, Andrew Jeffery <andrew@aj.id.au>, Magnus Damm <magnus.damm@gmail.com>, Max Filippov <jcmvbkbc@gmail.com>, Eric Auger <eric.auger@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Xiao Guangrong <xiaoguangrong.eric@gmail.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Keith Busch <keith.busch@intel.com>, Hannes Reinecke <hare@suse.com>, Rob Herring <robh@kernel.org>, Aleksandar Rikalo <arikalo@wavecomp.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Max Reitz <mreitz@redhat.com>, Beniamino Galvani <b.galvani@gmail.com>, Samuel Thibault <samuel.thibault@ens-lyon.org>, Igor Mammedov <imammedo@redhat.com>, David Hildenbrand <david@redhat.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Tony Krowiak <akrowiak@linux.ibm.com>, Gonglei <arei.gonglei@huawei.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Pierre Morel <pmorel@linux.ibm.com>, Antony Pavlov <antonynpavlov@gmail.com>, Jan Kiszka <jan.kiszka@web.de>, Richard Henderson <rth@twiddle.net>, Wen Congyang <wencongyang2@huawei.com>, James Hogan <jhogan@kernel.org>, Corey Minyard <cminyard@mvista.com>, Ben Warren <ben@skyportsystems.com>, Anthony Green <green@moxielogic.com>, Eduardo Habkost <ehabkost@redhat.com>, Collin Walling <walling@linux.ibm.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Eric Blake <eblake@redhat.com>, BALATON Zoltan <balaton@eik.bme.hu>, Thomas Huth <thuth@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Andrew Baumann <Andrew.Baumann@microsoft.com>, Eric Farman <farman@linux.ibm.com>, Palmer Dabbelt <palmer@sifive.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, zhanghailiang <zhang.zhanghailiang@huawei.com>, Gerd Hoffmann <kraxel@redhat.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Laurent Vivier <lvivier@redhat.com>, Michael Roth <mdroth@linux.vnet.ibm.com>, Sagar Karandikar <sagark@eecs.berkeley.edu>, Chris Wulff <crwulff@gmail.com>, Stefan Weil <sw@weilnetz.de>, "Cédric Le Goater" <clg@kaod.org>, Markus Armbruster <armbru@redhat.com>, KONRAD Frederic <frederic.konrad@adacore.com>, Stafford Horne <shorne@gmail.com>, Corey Minyard <minyard@acm.org>, Michael Walle <michael@walle.cc>, David Gibson <david@gibson.dropbear.id.au>
There is a newer version of this series
[Qemu-devel] [PATCH v3 25/29] numa: Move remaining NUMA declarations from sysemu.h to numa.h
Posted by Markus Armbruster 6 years, 6 months ago
Commit e35704ba9c "numa: Move NUMA declarations from sysemu.h to
numa.h" left a few NUMA-related macros behind.  Move them now.

Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
---
 exec.c                   | 2 +-
 hw/core/numa.c           | 1 +
 hw/mem/pc-dimm.c         | 1 +
 hw/pci/pci.c             | 2 +-
 hw/ppc/spapr.c           | 1 +
 include/sysemu/hostmem.h | 2 +-
 include/sysemu/numa.h    | 9 +++++++--
 include/sysemu/sysemu.h  | 7 -------
 8 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/exec.c b/exec.c
index 78f849de99..4aaa14b075 100644
--- a/exec.c
+++ b/exec.c
@@ -45,7 +45,7 @@
 #include "exec/memory.h"
 #include "exec/ioport.h"
 #include "sysemu/dma.h"
-#include "sysemu/numa.h"
+#include "sysemu/hostmem.h"
 #include "sysemu/hw_accel.h"
 #include "exec/address-spaces.h"
 #include "sysemu/xen-mapcache.h"
diff --git a/hw/core/numa.c b/hw/core/numa.c
index d817f06ead..450c522dd8 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "sysemu/hostmem.h"
 #include "sysemu/numa.h"
 #include "exec/cpu-common.h"
 #include "exec/ramlist.h"
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index dea48f9163..7c324a1329 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -28,6 +28,7 @@
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "qemu/module.h"
+#include "sysemu/hostmem.h"
 #include "sysemu/numa.h"
 #include "trace.h"
 
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 9001b81daa..4b6ffab13d 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -34,7 +34,7 @@
 #include "migration/vmstate.h"
 #include "monitor/monitor.h"
 #include "net/net.h"
-#include "sysemu/sysemu.h"
+#include "sysemu/numa.h"
 #include "hw/loader.h"
 #include "qemu/error-report.h"
 #include "qemu/range.h"
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 06d23a5004..4044e61a0c 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -29,6 +29,7 @@
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/hostmem.h"
 #include "sysemu/numa.h"
 #include "sysemu/qtest.h"
 #include "sysemu/reset.h"
diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h
index afeb5db1b1..4dbdadd39e 100644
--- a/include/sysemu/hostmem.h
+++ b/include/sysemu/hostmem.h
@@ -13,7 +13,7 @@
 #ifndef SYSEMU_HOSTMEM_H
 #define SYSEMU_HOSTMEM_H
 
-#include "sysemu/sysemu.h" /* for MAX_NODES */
+#include "sysemu/numa.h"
 #include "qapi/qapi-types-machine.h"
 #include "qom/object.h"
 #include "exec/memory.h"
diff --git a/include/sysemu/numa.h b/include/sysemu/numa.h
index 4c4c1dee9b..7a4ce89765 100644
--- a/include/sysemu/numa.h
+++ b/include/sysemu/numa.h
@@ -2,13 +2,18 @@
 #define SYSEMU_NUMA_H
 
 #include "qemu/bitmap.h"
-#include "sysemu/sysemu.h"
-#include "sysemu/hostmem.h"
 #include "qapi/qapi-types-machine.h"
 #include "exec/cpu-common.h"
 
 struct CPUArchId;
 
+#define MAX_NODES 128
+#define NUMA_NODE_UNASSIGNED MAX_NODES
+#define NUMA_DISTANCE_MIN         10
+#define NUMA_DISTANCE_DEFAULT     20
+#define NUMA_DISTANCE_MAX         254
+#define NUMA_DISTANCE_UNREACHABLE 255
+
 extern int nb_numa_nodes;   /* Number of NUMA nodes */
 extern bool have_numa_distance;
 
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index ac18a1184a..227202999d 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -117,13 +117,6 @@ extern QEMUClockType rtc_clock;
 extern const char *mem_path;
 extern int mem_prealloc;
 
-#define MAX_NODES 128
-#define NUMA_NODE_UNASSIGNED MAX_NODES
-#define NUMA_DISTANCE_MIN         10
-#define NUMA_DISTANCE_DEFAULT     20
-#define NUMA_DISTANCE_MAX         254
-#define NUMA_DISTANCE_UNREACHABLE 255
-
 #define MAX_OPTION_ROMS 16
 typedef struct QEMUOptionRom {
     const char *name;
-- 
2.21.0


Re: [Qemu-devel] [PATCH v3 25/29] numa: Move remaining NUMA declarations from sysemu.h to numa.h
Posted by Philippe Mathieu-Daudé 6 years, 6 months ago
On 8/9/19 8:46 AM, Markus Armbruster wrote:
> Commit e35704ba9c "numa: Move NUMA declarations from sysemu.h to
> numa.h" left a few NUMA-related macros behind.  Move them now.
> 
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>