summaryrefslogtreecommitdiff
path: root/drivers/nvdimm/pfn.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-03-03 20:38:00 +0300
committerDan Williams <dan.j.williams@intel.com>2016-03-05 23:25:45 +0300
commitcfe30b872058f211630eda7f65fb19d83beaaa3c (patch)
tree44dd4131a1dd92ef45babff885cb6add604746a9 /drivers/nvdimm/pfn.h
parentd9cbe09d39aa13f6924dc5fb88325de7ef01a72e (diff)
downloadlinux-cfe30b872058f211630eda7f65fb19d83beaaa3c.tar.xz
libnvdimm, pmem: adjust for section collisions with 'System RAM'
On a platform where 'Persistent Memory' and 'System RAM' are mixed within a given sparsemem section, trim the namespace and notify about the sub-optimal alignment. Cc: Toshi Kani <toshi.kani@hpe.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/pfn.h')
-rw-r--r--drivers/nvdimm/pfn.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/nvdimm/pfn.h b/drivers/nvdimm/pfn.h
index 6ee707e5b279..8e343a3ca873 100644
--- a/drivers/nvdimm/pfn.h
+++ b/drivers/nvdimm/pfn.h
@@ -27,10 +27,13 @@ struct nd_pfn_sb {
__le32 flags;
__le16 version_major;
__le16 version_minor;
- __le64 dataoff;
+ __le64 dataoff; /* relative to namespace_base + start_pad */
__le64 npfns;
__le32 mode;
- u8 padding[4012];
+ /* minor-version-1 additions for section alignment */
+ __le32 start_pad;
+ __le32 end_trunc;
+ u8 padding[4004];
__le64 checksum;
};
@@ -45,4 +48,7 @@ struct nd_pfn_sb {
#define PFN_SECTION_ALIGN_DOWN(x) (x)
#define PFN_SECTION_ALIGN_UP(x) (x)
#endif
+
+#define PHYS_SECTION_ALIGN_DOWN(x) PFN_PHYS(PFN_SECTION_ALIGN_DOWN(PHYS_PFN(x)))
+#define PHYS_SECTION_ALIGN_UP(x) PFN_PHYS(PFN_SECTION_ALIGN_UP(PHYS_PFN(x)))
#endif /* __NVDIMM_PFN_H */