pmem / run_qemu

A script to create bootable OS images, and run qemu with a locally built kernel.
Creative Commons Zero v1.0 Universal
57 stars 22 forks source link

CXL devices does not seem to setup correctly #31

Closed Ninlives closed 1 year ago

Ninlives commented 1 year ago

I'm running run_qemu.sh --cxl on Ubuntu 22.10 with qemu 7.2.0 and kernel 6.2, lspci returns the following result:

...
35:00.0 PCI bridge: Intel Corporation Device 7075
35:01.0 PCI bridge: Intel Corporation Device 7075
36:00.0 CXL: Intel Corporation Device 0d93 (rev 01)
37:00.0 CXL: Intel Corporation Device 0d93 (rev 01)
bf:00.0 PCI bridge: Intel Corporation Device 7075
bf:01.0 PCI bridge: Intel Corporation Device 7075
c0:00.0 CXL: Intel Corporation Device 0d93 (rev 01)
c1:00.0 CXL: Intel Corporation Device 0d93 (rev 01)

and here is the content under /sys/bus/cxl/devices:

decoder0.0  decoder1.0  nvdimm-bridge0  port2
decoder0.1  decoder2.0  port1           root0

which does not match the content described in README. I'm not using --git-qemu since qemu 7.2.0 has already merged the CXL support, but maybe it's still needed? Could you please point out potential issues in my setup? Thanks!

BTW, I found the following log in dmesg:

[   14.127689] cxl_pci 0000:c0:00.0: Failed to get interrupt for event Info log
[   14.129074] cxl_pci 0000:c1:00.0: Failed to get interrupt for event Info log

Is this an expected behavior?

stellarhopper commented 1 year ago

@Ninlives just to rule out a qemu dependency, can you try with this branch using --git-qemu https://gitlab.com/jic23/qemu/-/commits/cxl-2023-02-21?ref_type=heads

Ninlives commented 1 year ago

@stellarhopper Hi, thanks for your help! Switched to that qemu and now memdev appears under /sys/bus/cxl/devices:

decoder0.0  decoder2.1  decoder4.0  decoder5.3  endpoint5       pmem0
decoder0.1  decoder2.2  decoder4.1  decoder6.0  endpoint6       pmem1
decoder1.0  decoder2.3  decoder4.2  decoder6.1  mem0            pmem2
decoder1.1  decoder3.0  decoder4.3  decoder6.2  mem1            pmem3
decoder1.2  decoder3.1  decoder5.0  decoder6.3  mem2            port1
decoder1.3  decoder3.2  decoder5.1  endpoint3   mem3            port2
decoder2.0  decoder3.3  decoder5.2  endpoint4   nvdimm-bridge0  root0

The cxl list command also recognizes the CXL devices:

[
  {
    "memdev":"mem1",
    "pmem_size":268435456,
    "serial":0,
    "host":"0000:c0:00.0"
  },
  {
    "memdev":"mem3",
    "pmem_size":268435456,
    "serial":0,
    "host":"0000:c1:00.0"
  },
  {
    "memdev":"mem2",
    "pmem_size":268435456,
    "serial":0,
    "host":"0000:37:00.0"
  },
  {
    "memdev":"mem0",
    "pmem_size":268435456,
    "serial":0,
    "host":"0000:36:00.0"
  }
]

but lspci returns the same result. Does the README need to be updated to match the latest implementation, or I'm still missing something?

stellarhopper commented 1 year ago

@Ninlives Ah yeah the quick sanity check stuff in the readme is definitely outdated and needs to be removed or updated. Your lspci isn't missing anything you expected to be there right?

Ninlives commented 1 year ago

@stellarhopper Yeah the result looks fine, thanks for your help!