aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc
diff options
context:
space:
mode:
authorShivaprasad G Bhat <sbhat@linux.ibm.com>2021-05-18 08:03:17 -0400
committerDavid Gibson <david@gibson.dropbear.id.au>2021-06-03 13:22:06 +1000
commitf93c8f148c0f6c2e20c29c54276862ee79a53d02 (patch)
tree7cea267c21c08ac1be92d715903e4d7a0b56260a /hw/ppc
parentac9ef668321ebb6eb871a0c4dd380fa7d7891b4e (diff)
downloadqemu-f93c8f148c0f6c2e20c29c54276862ee79a53d02.zip
qemu-f93c8f148c0f6c2e20c29c54276862ee79a53d02.tar.gz
qemu-f93c8f148c0f6c2e20c29c54276862ee79a53d02.tar.bz2
spapr: nvdimm: Forward declare and move the definitions
The subsequent patches add definitions which tend to get the compilation to cyclic dependency. So, prepare with forward declarations, move the definitions and clean up. Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com> Message-Id: <162133925415.610.11584121797866216417.stgit@4f1e6f2bd33e> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr_nvdimm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/ppc/spapr_nvdimm.c b/hw/ppc/spapr_nvdimm.c
index 252204e..3f57a8b 100644
--- a/hw/ppc/spapr_nvdimm.c
+++ b/hw/ppc/spapr_nvdimm.c
@@ -35,6 +35,18 @@
/* SCM device is unable to persist memory contents */
#define PAPR_PMEM_UNARMED PPC_BIT(0)
+/*
+ * The nvdimm size should be aligned to SCM block size.
+ * The SCM block size should be aligned to SPAPR_MEMORY_BLOCK_SIZE
+ * in order to have SCM regions not to overlap with dimm memory regions.
+ * The SCM devices can have variable block sizes. For now, fixing the
+ * block size to the minimum value.
+ */
+#define SPAPR_MINIMUM_SCM_BLOCK_SIZE SPAPR_MEMORY_BLOCK_SIZE
+
+/* Have an explicit check for alignment */
+QEMU_BUILD_BUG_ON(SPAPR_MINIMUM_SCM_BLOCK_SIZE % SPAPR_MEMORY_BLOCK_SIZE);
+
bool spapr_nvdimm_validate(HotplugHandler *hotplug_dev, NVDIMMDevice *nvdimm,
uint64_t size, Error **errp)
{