kdevops.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: fan.ni@gmx.us
To: mcgrof@kernel.org
Cc: nmtadam.samsung@gmail.com, fan.ni@samsung.com,
	kdevops@lists.linux.dev, jlayton@kernel.org,
	Fan Ni <fan.ni@gmx.us>
Subject: [PATCH 1/3] CXL: Add a new topology to support DCD emulation
Date: Tue, 29 Aug 2023 13:36:32 -0700	[thread overview]
Message-ID: <20230829203634.29635-2-fan.ni@gmx.us> (raw)
In-Reply-To: <20230829203634.29635-1-fan.ni@gmx.us>

From: Fan Ni <fan.ni@gmx.us>

The change adds a new cxl topology to enable dynamic capacity device
emulation in Qemu. The device includes no static volatile/non-volatile
capacity but 2 dynamic capacity regions where dynamic capacity extents
can be added. Also, increase the fix memory window size and host backend size
which gives more room for testing as the dc extents needs to be a least one
memory block (256MB).

Signed-off-by: Fan Ni <fan.ni@samsung.com>
---
 playbooks/roles/gen_nodes/defaults/main.yml        |  1 +
 playbooks/roles/gen_nodes/templates/Vagrantfile.j2 | 11 ++++++++---
 scripts/gen-nodes.Makefile                         |  3 +++
 vagrant/Kconfig                                    |  9 +++++++++
 4 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/playbooks/roles/gen_nodes/defaults/main.yml b/playbooks/roles/gen_nodes/defaults/main.yml
index c57effe7..55827e5b 100644
--- a/playbooks/roles/gen_nodes/defaults/main.yml
+++ b/playbooks/roles/gen_nodes/defaults/main.yml
@@ -51,6 +51,7 @@ libvirt_enable_cxl: False
 libvirt_enable_cxl_demo_topo1: False
 libvirt_enable_cxl_demo_topo2: False
 libvirt_enable_cxl_switch_topo1: False
+libvirt_enable_cxl_dcd_topo1: False
 libvirt_extra_drive_id_prefix: 'drv'
 libvirt_extra_storage_drive_nvme: True
 libvirt_extra_storage_drive_virtio: False
diff --git a/playbooks/roles/gen_nodes/templates/Vagrantfile.j2 b/playbooks/roles/gen_nodes/templates/Vagrantfile.j2
index 7ed59ff7..124cabd6 100644
--- a/playbooks/roles/gen_nodes/templates/Vagrantfile.j2
+++ b/playbooks/roles/gen_nodes/templates/Vagrantfile.j2
@@ -292,7 +292,7 @@ Vagrant.configure("2") do |config|

         cxl_mem1_path = cxl_path + "/cxl-mem1.raw"
         libvirt.qemuargs :value => "-object"
-        libvirt.qemuargs :value => "memory-backend-file,id=kdevops-cxl-mem1,share=on,mem-path=#{cxl_mem1_path},size=256M"
+        libvirt.qemuargs :value => "memory-backend-file,id=kdevops-cxl-mem1,share=on,mem-path=#{cxl_mem1_path},size=4G"

 	# Label Storage Area, used to store CXL namespace labels and region labels
         cxl_lsa1_path = cxl_path + "/cxl-lsa1.raw"
@@ -319,12 +319,17 @@ Vagrant.configure("2") do |config|
 	libvirt.qemuargs :value => "cxl-downstream,port=1,bus=kdevops_cxl_us0,id=kdevops_cxl_swport1,chassis=0,slot=5"
 	libvirt.qemuargs :value => "-device"
 	libvirt.qemuargs :value => "cxl-type3,bus=kdevops_cxl_swport0,memdev=kdevops-cxl-mem1,lsa=kdevops-cxl-lsa1,id=kdevops-cxl-pmem0"
-{% else %} # switch topo1
+{% else %} # !switch topo1
+	{% if not libvirt_enable_cxl_dcd_topo1 %}
         libvirt.qemuargs :value => "-device"
         libvirt.qemuargs :value => "cxl-type3,bus=kdevops_cxl_root_port0,memdev=kdevops-cxl-mem1,lsa=kdevops-cxl-lsa1,id=kdevops-cxl-pmem0"
+	{% else %} # dcd_topo1
+        libvirt.qemuargs :value => "-device"
+        libvirt.qemuargs :value => "cxl-type3,bus=kdevops_cxl_root_port0,nonvolatile-dc-memdev=kdevops-cxl-mem1,lsa=kdevops-cxl-lsa1,id=kdevops-cxl-dcd0,num-dc-regions=2"
+	{% endif %} # dcd topo1
 {% endif %} # !switch topo1
         libvirt.qemuargs :value => "-M"
-        libvirt.qemuargs :value => "cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.size=512M"
+        libvirt.qemuargs :value => "cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.size=8G"
 {% endif %} # CXL
 {% endif %}

diff --git a/scripts/gen-nodes.Makefile b/scripts/gen-nodes.Makefile
index 533b19db..eebd0b2b 100644
--- a/scripts/gen-nodes.Makefile
+++ b/scripts/gen-nodes.Makefile
@@ -199,6 +199,9 @@ endif # QEMU_ENABLE_CXL_DEMO_TOPOLOGY_2
 ifeq (y,$(CONFIG_QEMU_ENABLE_CXL_SWITCH_TOPOLOGY_1))
 GEN_NODES_EXTRA_ARGS += libvirt_enable_cxl_switch_topo1='True'
 endif # QEMU_ENABLE_CXL_SWITCH_TOPOLOGY_1
+ifeq (y,$(CONFIG_QEMU_ENABLE_CXL_DEMO_DCD_TOPOLOGY_1))
+GEN_NODES_EXTRA_ARGS += libvirt_enable_cxl_dcd_topo1='True'
+endif # QEMU_ENABLE_CXL_DEMO_DCD_TOPOLOGY_1
 endif # CONFIG_QEMU_ENABLE_CXL

 endif # CONFIG_LIBVIRT_MACHINE_TYPE_Q35
diff --git a/vagrant/Kconfig b/vagrant/Kconfig
index 3bf096fc..4e382264 100644
--- a/vagrant/Kconfig
+++ b/vagrant/Kconfig
@@ -1666,6 +1666,15 @@ config QEMU_ENABLE_CXL_SWITCH_TOPOLOGY_1
 	  is connected to one of the down stream ports. The upstream port
 	  is connected to a root port on the host bridge.

+config QEMU_ENABLE_CXL_DEMO_DCD_TOPOLOGY_1
+	bool "CXL DCD demo directly attached to a single-port HB"
+	help
+	  This topology adds a DCD device in the topology, directly attached to
+	  a Host bridge with only one root port.
+	  The device has zero (volatile or non-volatile) static capacity
+	  and 2 dynamic capacity regions which host dynamic extents  to be
+	  added.
+
 endchoice

 endif # QEMU_ENABLE_CXL
--
2.40.1


  reply	other threads:[~2023-08-29 20:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 20:36 [PATCH 0/3] CXL: Add dynamic capacity device test support in kdevops fan.ni
2023-08-29 20:36 ` fan.ni [this message]
2023-08-29 20:36 ` [PATCH 2/3] qemu: Add QMP connection option for QMP interface access fan.ni
2023-08-29 20:36 ` [PATCH 3/3] CXL: Add support to create a DC region for DCD fan.ni
2023-08-29 20:48 ` [PATCH 0/3] CXL: Add dynamic capacity device test support in kdevops Fan Ni

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=20230829203634.29635-2-fan.ni@gmx.us \
    --to=fan.ni@gmx.us \
    --cc=fan.ni@samsung.com \
    --cc=jlayton@kernel.org \
    --cc=kdevops@lists.linux.dev \
    --cc=mcgrof@kernel.org \
    --cc=nmtadam.samsung@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).