All of lore.kernel.org
 help / color / mirror / Atom feed
* [CXL Volatile MEM]: How to change the CXL persistent memory device to a volatile memory
@ 2021-08-07 12:37 Samarth Saxena
  0 siblings, 0 replies; only message in thread
From: Samarth Saxena @ 2021-08-07 12:37 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2261 bytes --]

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]<https://www.cadence.com/en_US/home.html>
Samarth Saxena
Sr Principal Software Engineer
T: +911204308300
[UIcorrectsize1583179003.png]<https://www.cadence.com/en_US/home.html>
[16066EmailSignatureFortune100Best2021White92x1271617625037.png]<https://www.cadence.com/en_US/home/company/careers.html>





[-- Attachment #2: Type: text/html, Size: 10073 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-07 12:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-07 12:37 [CXL Volatile MEM]: How to change the CXL persistent memory device to a volatile memory Samarth Saxena

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.