pmem / ndctl

A "device memory" enabling project encompassing tools and libraries for CXL, NVDIMMs, DAX, memory tiering and other platform memory device topics.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cxl memory's space can't access

cwk08 opened this issue · comments

commented

I'm using qemu to build cxl device simulation environment. When using ndctl's cxl command I can find the below output:
[ { "memdev":"mem0", "pmem_size":536870912, "serial":0, "host":"0000:0d:00.0" } ]

But I don't know how to access this cxl space.
I can only find cxl file in /dev/cxl.
Does libcxl provide any API to access cxl address space such as mmap function?

@cwk08 Yes there are a few steps before you can use this space. In case of pmem space (persistent memory) as you show in your example, the support is available today - see the cxl create-region command - you'd use this to create a pmem region, that would show up as an nvdimm region. This would allow you to have (create / modify) nvdimm namespaces using ndctl create-namespace.

Similar support for volatile space on a CXL memdev is currently being developed. Some patches for enabling this in the kernel have been posted here:
https://lore.kernel.org/linux-cxl/167564534874.847146.5222419648551436750.stgit@dwillia2-xfh.jf.intel.com/

I believe a QEMU implementation for volatile capacity is in progress too, and I'll be posting libcxl / cxl-cli patches to plumb this through shortly as well.

commented

Thanks for your reply. After creating namespace by ndctl, I can find pmem file in /dev path now , and it is able to be mounted on file system.