Commit db4cd75b authored by Zhuling's avatar Zhuling Committed by Zheng Zengkai
Browse files

arm64: register persistent memory via protected memory

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4O31I



----------------------------

This patch is to support persistent memory(legacy) register on arm64.

Firstly, support memory region marked as protected memory, which
removed from memblock, the ranges for persistent memory are described
by the 'memmap=nn[KMG]!ss[KMG]' kernel parameter", then they will
be passed to the 'pmem' driver so they can be used for persistent
storage. For now, the maximum memory regions supported is 8.

Secondly, add ARM64_PMEM_LEGACY Kconfig to select PMEM_LEGACY and
PMEM_LEGACY_DEVICE to reuse the nvdimm resource discovery and pmem
device registering mechanism provided by pmem_legacy.c and e820.c.

Note, the functions in those file should not only used by x86, but
the file and function naming is x86 specific, will update after this
feature upstreamed.

Here are steps to show how to use this feature on arm64,
1. setup the memmap kernel parameter, memmap=nn[KMG]!ss[KMG],
   eg, memmap=100K!0x1a0000000.
2. load nd_e820.ko driver, modprobe nd_e820.
3. check pmem device in /dev, eg, /dev/pmem0

Signed-off-by: default avatarZhuling <zhuling8@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 88ecee4b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment