• Z
    arm64: register persistent memory via protected memory · db4cd75b
    Zhuling 提交于
    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: NZhuling <zhuling8@huawei.com>
    Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
    Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
    db4cd75b
init.c 19.3 KB