On Thu, 2023-02-09 at 12:04 +0100, Brice Goglin wrote:
> 
> Le 08/02/2023 à 21:00, Vishal Verma a écrit :
> > While enumeration of ram type regions already works in libcxl and
> > cxl-cli, it lacked an attribute to indicate pmem vs. ram. Add a new
> > 'type' attribute to region listings to address this. Additionally, add
> > support for creating ram regions to the cxl-create-region command. The
> > region listings are also updated with dax-region information for
> > volatile regions.
> > 
> > This also includes fixed for a few bugs / usability issues identified
> > along the way - patches 1, 4, and 6. Patch 5 is a usability improvement
> > where based on decoder capabilities, the type of a region can be
> > inferred for the create-region command.
> > 
> > These have been tested against the ram-region additions to cxl_test
> > which are part of the kernel support patch set[1].
> > Additionally, tested against qemu using a WIP branch for volatile
> > support found here[2]. The 'run_qemu' script has a branch that creates
> > volatile memdevs in addition to pmem ones. This is also in a branch[3]
> > since it depends on [2].
> > 
> > These cxl-cli / libcxl patches themselves are also available in a
> > branch at [4].
> > 
> > [1]: 
> > https://lore.kernel.org/linux-cxl/167564534874.847146.5222419648551436750.st...@dwillia2-xfh.jf.intel.com/
> > [2]: https://gitlab.com/jic23/qemu/-/commits/cxl-2023-01-26
> > [3]: https://github.com/pmem/run_qemu/commits/vv/ram-memdevs
> > [4]: https://github.com/pmem/ndctl/tree/vv/volatile-regions
> 
> 
> Hello Vishal
> 
> I am trying to play with this but all my attempts failed so far. Could 
> you provide Qemu and cxl-cli command-lines to get a volatile region 
> enabled in a Qemu VM?

Hi Brice,

Greg had posted his working config in another thread:
https://lore.kernel.org/linux-cxl/y9sms0fgulqsi...@memverge.com/

I've also pasted below, the qemu command line generated by the run_qemu
script I referenced. (Note that this adds a bunch of stuff not strictly
needed for a minimal CXL configuration - you can certainly trim a lot
of that out - this is just the default setup that is generated and I
usually run).

Feel free to post what errors / problems you're hitting and we can
debug further from there.

Thanks
Vishal


$ run_qemu.sh -g --cxl --cxl-debug --rw -r none --cmdline
/home/vverma7/git/qemu/build/qemu-system-x86_64 
-machine q35,accel=kvm,nvdimm=on,cxl=on 
-m 8192M,slots=4,maxmem=40964M 
-smp 8,sockets=2,cores=2,threads=2 
-enable-kvm 
-display none 
-nographic 
-drive if=pflash,format=raw,unit=0,file=OVMF_CODE.fd,readonly=on 
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd 
-debugcon file:uefi_debug.log 
-global isa-debugcon.iobase=0x402 
-drive file=root.img,format=raw,media=disk 
-kernel ./mkosi.extra/lib/modules/6.2.0-rc6+/vmlinuz 
-initrd mkosi.extra/boot/initramfs-6.2.0-rc2+.img 
-append selinux=0 audit=0 console=tty0 console=ttyS0 root=/dev/sda2 
ignore_loglevel rw cxl_acpi.dyndbg=+fplm cxl_pci.dyndbg=+fplm 
cxl_core.dyndbg=+fplm cxl_mem.dyndbg=+fplm cxl_pmem.dyndbg=+fplm 
cxl_port.dyndbg=+fplm cxl_region.dyndbg=+fplm cxl_test.dyndbg=+fplm 
cxl_mock.dyndbg=+fplm cxl_mock_mem.dyndbg=+fplm memmap=2G!4G 
efi_fake_mem=2G@6G:0x40000 
-device e1000,netdev=net0,mac=52:54:00:12:34:56 
-netdev user,id=net0,hostfwd=tcp::10022-:22 
-object 
memory-backend-file,id=cxl-mem0,share=on,mem-path=cxltest0.raw,size=256M 
-object 
memory-backend-file,id=cxl-mem1,share=on,mem-path=cxltest1.raw,size=256M 
-object 
memory-backend-file,id=cxl-mem2,share=on,mem-path=cxltest2.raw,size=256M 
-object 
memory-backend-file,id=cxl-mem3,share=on,mem-path=cxltest3.raw,size=256M 
-object memory-backend-ram,id=cxl-mem4,share=on,size=256M 
-object memory-backend-ram,id=cxl-mem5,share=on,size=256M 
-object memory-backend-ram,id=cxl-mem6,share=on,size=256M 
-object memory-backend-ram,id=cxl-mem7,share=on,size=256M 
-object memory-backend-file,id=cxl-lsa0,share=on,mem-path=lsa0.raw,size=1K 
-object memory-backend-file,id=cxl-lsa1,share=on,mem-path=lsa1.raw,size=1K 
-object memory-backend-file,id=cxl-lsa2,share=on,mem-path=lsa2.raw,size=1K 
-object memory-backend-file,id=cxl-lsa3,share=on,mem-path=lsa3.raw,size=1K 
-device pxb-cxl,id=cxl.0,bus=pcie.0,bus_nr=53 
-device pxb-cxl,id=cxl.1,bus=pcie.0,bus_nr=191 
-device cxl-rp,id=hb0rp0,bus=cxl.0,chassis=0,slot=0,port=0 
-device cxl-rp,id=hb0rp1,bus=cxl.0,chassis=0,slot=1,port=1 
-device cxl-rp,id=hb0rp2,bus=cxl.0,chassis=0,slot=2,port=2 
-device cxl-rp,id=hb0rp3,bus=cxl.0,chassis=0,slot=3,port=3 
-device cxl-rp,id=hb1rp0,bus=cxl.1,chassis=0,slot=4,port=0 
-device cxl-rp,id=hb1rp1,bus=cxl.1,chassis=0,slot=5,port=1 
-device cxl-rp,id=hb1rp2,bus=cxl.1,chassis=0,slot=6,port=2 
-device cxl-rp,id=hb1rp3,bus=cxl.1,chassis=0,slot=7,port=3 
-device cxl-type3,bus=hb0rp0,memdev=cxl-mem0,id=cxl-dev0,lsa=cxl-lsa0 
-device cxl-type3,bus=hb0rp1,memdev=cxl-mem1,id=cxl-dev1,lsa=cxl-lsa1 
-device cxl-type3,bus=hb1rp0,memdev=cxl-mem2,id=cxl-dev2,lsa=cxl-lsa2 
-device cxl-type3,bus=hb1rp1,memdev=cxl-mem3,id=cxl-dev3,lsa=cxl-lsa3 
-device cxl-type3,bus=hb0rp2,volatile-memdev=cxl-mem4,id=cxl-dev4 
-device cxl-type3,bus=hb0rp3,volatile-memdev=cxl-mem5,id=cxl-dev5 
-device cxl-type3,bus=hb1rp2,volatile-memdev=cxl-mem6,id=cxl-dev6 
-device cxl-type3,bus=hb1rp3,volatile-memdev=cxl-mem7,id=cxl-dev7 
-M 
cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.size=4G,cxl-fmw.0.interleave-granularity=8k,cxl-fmw.1.targets.0=cxl.0,cxl-fmw.1.targets.1=cxl.1,cxl-fmw.1.size=4G,cxl-fmw.1.interleave-granularity=8k
 
-object memory-backend-ram,id=mem0,size=2048M 
-numa node,nodeid=0,memdev=mem0, 
-numa cpu,node-id=0,socket-id=0 
-object memory-backend-ram,id=mem1,size=2048M 
-numa node,nodeid=1,memdev=mem1, 
-numa cpu,node-id=1,socket-id=1 
-object memory-backend-ram,id=mem2,size=2048M 
-numa node,nodeid=2,memdev=mem2, 
-object memory-backend-ram,id=mem3,size=2048M 
-numa node,nodeid=3,memdev=mem3, 
-numa node,nodeid=4, 
-object 
memory-backend-file,id=nvmem0,share=on,mem-path=nvdimm-0,size=16384M,align=1G 
-device nvdimm,memdev=nvmem0,id=nv0,label-size=2M,node=4 
-numa node,nodeid=5, 
-object 
memory-backend-file,id=nvmem1,share=on,mem-path=nvdimm-1,size=16384M,align=1G 
-device nvdimm,memdev=nvmem1,id=nv1,label-size=2M,node=5 
-numa dist,src=0,dst=0,val=10 
-numa dist,src=0,dst=1,val=21 
-numa dist,src=0,dst=2,val=12 
-numa dist,src=0,dst=3,val=21 
-numa dist,src=0,dst=4,val=17 
-numa dist,src=0,dst=5,val=28 
-numa dist,src=1,dst=1,val=10 
-numa dist,src=1,dst=2,val=21 
-numa dist,src=1,dst=3,val=12 
-numa dist,src=1,dst=4,val=28 
-numa dist,src=1,dst=5,val=17 
-numa dist,src=2,dst=2,val=10 
-numa dist,src=2,dst=3,val=21 
-numa dist,src=2,dst=4,val=28 
-numa dist,src=2,dst=5,val=28 
-numa dist,src=3,dst=3,val=10 
-numa dist,src=3,dst=4,val=28 
-numa dist,src=3,dst=5,val=28 
-numa dist,src=4,dst=4,val=10 
-numa dist,src=4,dst=5,val=28 
-numa dist,src=5,dst=5,val=10 

Reply via email to