qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[CXL Volatile MEM]: How to change the CXL persistent memory device to a


From: Samarth Saxena
Subject: [CXL Volatile MEM]: How to change the CXL persistent memory device to a volatile memory
Date: Sat, 7 Aug 2021 12:37:35 +0000

Hi All,

 

I am trying to modify the CXL persistent memory device, given at:

               hw/mem/cxl_type3.c

to a volatile memory device.

 

I tried the following:

  • In hw/cxl/cxl-mailbox-utils.c:
    • changed the IDENTIFY_MEMORY_DEVICE mailbox handler to return persistent capacity as 0, and expose entire memory as volatile.
    • changed the IDENTIFY_MEMORY_DEVICE mailbox handler to indicate the lba_size as 0 in  the payload.
  • In hw/mem/cxl_type3.c
    • Changed function get_lsa_size to return 0.
    • Changed function get_lsa to return 0.
    • In the ct3_class_init function, changed the ps->class_id from PCI_CLASS_STORAGE_EXPRESS to PCI_CLASS_MEMORY_RAM
    • In the ct3_class_init function, set_bit(DEVICE_CLASS_STORGE,dc->categories) was commented
    • In the setup_cxl_memory function, ensured that the non-volatile flag is false.

 

Still, when I boot this setup with Kernel 5.14, I see that the device shows up as a persistent memory in /proc/iomem.

 

What else needs to be changed in the Qemu device and CXL model to support volatile memory?

Is volatile memory Type 3 cxl device not supported in Qemu?

 

I use the following command:

../build/qemu-system-x86_64 -M q35,accel=kvm,nvdimm=on -m 8192M,slots=4,maxmem=40964M -smp 8,sockets=2,cores=2,threads=2 -hda /lan/dscratch/singhabh/shradha/ubuntu-20.10-64_with_orig_driver_backup.qcow2 -enable-kvm -usbdevice tablet -L $VB_ROOT/etc/vm/common/ -object memory-backend-file,id=cxl-mem1,share=on,mem-path=$PWD/cxl_type_mem,size=512M -object memory-backend-file,id=cxl-lsa,share=on,mem-path=$PWD/cxl_lsa_mem,size=2M -device "pxb-cxl,id=cxl.0,bus=pcie.0,bus_nr=52,uid=0,len-window-base=1,window-base[0]=0x5c0000000,memdev[0]=cxl-mem1" -device cxl-rp,id=rp0,bus=cxl.0,addr=0.0,chassis=0,slot=0 -device cxl-type3,bus=rp0,memdev=cxl-mem1,id=cxl-pmem0,size=256M,lsa=cxl-lsa

 

Regards,   

CadenceLogoRed185Regcopy1583174817new51584636989.png

Samarth Saxena 
Sr Principal Software Engineer
T: +911204308300   

UIcorrectsize1583179003.png

16066EmailSignatureFortune100Best2021White92x1271617625037.png

 



 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]