Multiple root ports are not detected in PCIe CXL by Qemu

The bus does not identify an additional root port that I added to it, I am not sure why. This only works if the ID is cxl.0 and cxl.1, but if I put other values, it does not work. The following statements show how I am configuring the root ports

//qemu/build/qemu-system-x86_64 -M q35 -drive file=os_image,if=floppy,media=disk -boot order=d
-M q35,cxl=on -m 4G,maxmem=16G,slots=12

-device pxb-cxl,bus_nr=1,bus=pcie.0,id=cxl.1
-device pxb-cxl,bus_nr=5,bus=pcie.0,id=cxl.2

-device cxl-rp,port=0,bus=cxl.1,id=rp0,chassis=0,slot=2
-device cxl-rp,port=1,bus=cxl.1,id=rp1,chassis=0,slot=3
-device cxl-rp,port=0,bus=cxl.2,id=rp2,chassis=0,slot=4
-device cxl-rp,port=1,bus=cxl.2,id=rp3,chassis=0,slot=5

-device cxl-type3,bus=rp0,volatile-memdev=mem0,id=cxl-mem0
-device cxl-type3,bus=rp1,volatile-memdev=mem1,id=cxl-mem1
-device cxl-type3,bus=rp2,volatile-memdev=mem2,id=cxl-mem2
-device cxl-type3,bus=rp3,volatile-memdev=mem3,id=cxl-mem3

-object memory-backend-file,id=mem0,mem-path=/tmp/mem0,size=4G,share=true
-object memory-backend-file,id=mem1,mem-path=/tmp/mem1,size=4G,share=true
-object memory-backend-file,id=mem2,mem-path=/tmp/mem2,size=4G,share=true
-object memory-backend-file,id=mem3,mem-path=/tmp/mem3,size=4G,share=true

-M cxl-fmw.0.targets.0=cxl.1,cxl-fmw.0.targets.1=cxl.2,cxl-fmw.0.size=4G,cxl-fmw.0.interleave-granularity=8k

Leave a Comment