@samitouri / QOSamiQemu / commits / fe25b9213c

hw/ppc/spapr: extract SPAPR_MAX_RAM_SLOTS in a new header

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> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20260131020100.1115203-4-pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Pierrick Bouvier committed Jan 30, 2026 at 18:00 UTC fe25b9213ca36074f038a5ad8a3c1474f69eb632
2 files changed +18 -7
include/hw/ppc/spapr.h
+1 -7
@@ -4,6 +4,7 @@
4 #include "qemu/units.h"
5 #include "system/dma.h"
6 #include "hw/core/boards.h"
7 +#include "hw/ppc/spapr_common.h"
8 #include "hw/ppc/spapr_drc.h"
9 #include "hw/mem/pc-dimm.h"
10 #include "hw/ppc/spapr_ovec.h"
@@ -946,13 +947,6 @@ int spapr_rtc_import_offset(SpaprRtcState *rtc, int64_t legacy_offset);
947
948 #define SPAPR_MEMORY_BLOCK_SIZE ((hwaddr)1 << 28) /* 256MB */
949
949 -/*
950 - * This defines the maximum number of DIMM slots we can have for sPAPR
951 - * guest. This is not defined by sPAPR but we are defining it to 32 slots
952 - * based on default number of slots provided by PowerPC kernel.
953 - */
954 -#define SPAPR_MAX_RAM_SLOTS 32
955 -
950 /* 1GB alignment for hotplug memory region */
951 #define SPAPR_DEVICE_MEM_ALIGN (1 * GiB)
952
include/hw/ppc/spapr_common.h new
+17
@@ -0,0 +1,17 @@
1 +/*
2 + * Common definitions for PPC sPAPR
3 + *
4 + * SPDX-License-Identifier: GPL-2.0-or-later
5 + */
6 +
7 +#ifndef HW_SPAPR_COMMON_H
8 +#define HW_SPAPR_COMMON_H
9 +
10 +/*
11 + * The maximum number of DIMM slots we can have for sPAPR guest.
12 + * This is not defined by sPAPR but we are defining it to 32 slots
13 + * based on default number of slots provided by PowerPC kernel.
14 + */
15 +#define SPAPR_MAX_RAM_SLOTS 32
16 +
17 +#endif /* HW_SPAPR_COMMON_H */