Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cxl create-region not working for --type=ram #276

Open
hextag opened this issue Nov 24, 2024 · 0 comments
Open

cxl create-region not working for --type=ram #276

hextag opened this issue Nov 24, 2024 · 0 comments

Comments

@hextag
Copy link

hextag commented Nov 24, 2024

The following 4 devices are shown in QEMU VM when I do 'cxl list'.

[root@fedora dev]# cxl list
[
  {
    "memdevs":[
      {
        "memdev":"mem3",
        "ram_size":268435456,
        "serial":0,
        "host":"0000:c2:00.0"
      },
      {
        "memdev":"mem2",
        "ram_size":268435456,
        "serial":0,
        "host":"0000:c3:00.0"
      },
      {
        "memdev":"mem1",
        "pmem_size":268435456,
        "serial":0,
        "host":"0000:36:00.0"
      },
      {
        "memdev":"mem0",
        "pmem_size":268435456,
        "serial":0,
        "host":"0000:37:00.0"
      }
    ]
  },
  {
    "regions":[
      {
        "region":"region0",
        "resource":328833433600,
        "size":536870912,
        "type":"pmem",
        "interleave_ways":2,
        "interleave_granularity":8192,
        "decode_state":"commit"
      }
    ]
  }
]

I want to create a region from devices mem2 and mem3( which are listed as ram in cxl list) and create a device node from this region to access in SysRAM mode. However, I get failure when I use create region command

cxl create-region -m -d decoder0.0 -w 2 -g 8192 mem2 mem3 --type=ram

cxl region: collect_memdevs: no active memdevs found: decoder: decoder0.0 filter: mem2,mem3
cxl region: cmd_create_region: created 0 regions

I tried to enable these devices using cxl enable-memdev but it doesn't help to resolve the above error,

cxl enable-memdev mem2
cxl enable-memdev mem3

Earlier I created a region (region0) as you can see in cxl list output from memory devices mem0 and mem1 both listed as pmem.

I created a namespace for this region0 using 'sudo ndctl create-namespace --mode=devdax --force --region=region0'

daxctl list shows this device node which is devdax.

[root@fedora dev]# daxctl list
[                                                                                                                                                                                             {
    "chardev":"dax0.0",
    "size":526385152,
    "target_node":32,
    "align":2097152,
    "mode":"devdax"
  }
]

The above dax0.0 node is created from mem0 and mem1 both for which are listed as pmem in cxl list. I'm able to read and write to this node.

When I try to re-configure the above dax0.0 to system-ram mode, I get the following error and hence I want to create a new region and a new device node in SysRAM from the other two devices (mem2 and mem3) which are listed as ram in cxl list output.

[root@fedora dev]# daxctl reconfigure-device -m system-ram dax0.0
dax0.0: error: kernel policy will auto-online memory, aborting
error reconfiguring devices: Device or resource busy

How do I go about SysRAM emulation ? Can anyone please help me here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant