All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samarth Saxena <samarths@cadence.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
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	[thread overview]
Message-ID: <DM6PR07MB8143B8DC1FDD96EA63B023EADDF49@DM6PR07MB8143.namprd07.prod.outlook.com> (raw)

[-- 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 --]

                 reply	other threads:[~2021-08-07 12:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR07MB8143B8DC1FDD96EA63B023EADDF49@DM6PR07MB8143.namprd07.prod.outlook.com \
    --to=samarths@cadence.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.