[PATCH 3/6] include/hw/ppc/spapr: extract SPAPR_MAX_RAM_SLOTS in a new header

Pierrick Bouvier posted 6 patches 1 week, 3 days ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
There is a newer version of this series
[PATCH 3/6] include/hw/ppc/spapr: extract SPAPR_MAX_RAM_SLOTS in a new header
Posted by Pierrick Bouvier 1 week, 3 days ago
Allow to include it from common code (vhost-user, in next commit), else
it pulls ppc/cpu.h which has target specifics.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 include/hw/ppc/spapr.h        |  8 +-------
 include/hw/ppc/spapr_common.h | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 7 deletions(-)
 create mode 100644 include/hw/ppc/spapr_common.h

diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 5476ac7ce7b..b022f8dd25d 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -4,6 +4,7 @@
 #include "qemu/units.h"
 #include "system/dma.h"
 #include "hw/core/boards.h"
+#include "hw/ppc/spapr_common.h"
 #include "hw/ppc/spapr_drc.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/ppc/spapr_ovec.h"
@@ -946,13 +947,6 @@ int spapr_rtc_import_offset(SpaprRtcState *rtc, int64_t legacy_offset);
 
 #define SPAPR_MEMORY_BLOCK_SIZE ((hwaddr)1 << 28) /* 256MB */
 
-/*
- * This defines the maximum number of DIMM slots we can have for sPAPR
- * guest. This is not defined by sPAPR but we are defining it to 32 slots
- * based on default number of slots provided by PowerPC kernel.
- */
-#define SPAPR_MAX_RAM_SLOTS     32
-
 /* 1GB alignment for hotplug memory region */
 #define SPAPR_DEVICE_MEM_ALIGN (1 * GiB)
 
diff --git a/include/hw/ppc/spapr_common.h b/include/hw/ppc/spapr_common.h
new file mode 100644
index 00000000000..d799927ff5c
--- /dev/null
+++ b/include/hw/ppc/spapr_common.h
@@ -0,0 +1,16 @@
+/*
+ * Common definitions for PPC SPAPR
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef HW_SPAPR_COMMON_H
+#define HW_SPAPR_COMMON_H
+
+/*
+ * This defines the maximum number of DIMM slots we can have for sPAPR
+ * guest. This is not defined by sPAPR but we are defining it to 32 slots
+ * based on default number of slots provided by PowerPC kernel.
+ */
+#define SPAPR_MAX_RAM_SLOTS     32
+
+#endif /* HW_SPAPR_COMMON_H */
-- 
2.47.3
Re: [PATCH 3/6] include/hw/ppc/spapr: extract SPAPR_MAX_RAM_SLOTS in a new header
Posted by Philippe Mathieu-Daudé 1 week, 1 day ago
On 31/1/26 03:00, Pierrick Bouvier wrote:
> Allow to include it from common code (vhost-user, in next commit), else
> it pulls ppc/cpu.h which has target specifics.
> 
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>   include/hw/ppc/spapr.h        |  8 +-------
>   include/hw/ppc/spapr_common.h | 16 ++++++++++++++++
>   2 files changed, 17 insertions(+), 7 deletions(-)
>   create mode 100644 include/hw/ppc/spapr_common.h

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Re: [PATCH 3/6] include/hw/ppc/spapr: extract SPAPR_MAX_RAM_SLOTS in a new header
Posted by Philippe Mathieu-Daudé 1 week, 1 day ago
On 1/2/26 23:26, Philippe Mathieu-Daudé wrote:
> On 31/1/26 03:00, Pierrick Bouvier wrote:
>> Allow to include it from common code (vhost-user, in next commit), else
>> it pulls ppc/cpu.h which has target specifics.
>>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> ---
>>   include/hw/ppc/spapr.h        |  8 +-------
>>   include/hw/ppc/spapr_common.h | 16 ++++++++++++++++
>>   2 files changed, 17 insertions(+), 7 deletions(-)
>>   create mode 100644 include/hw/ppc/spapr_common.h
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>