Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0DF050262 for ; Tue, 28 Nov 2023 22:44:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q/yVF7z7" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-5bddf66ed63so219906a12.1 for ; Tue, 28 Nov 2023 14:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701211443; x=1701816243; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ALR8k+T7yG2e6Hu3D9MLUgYh7XPeC0FJx/tuV2JKN1I=; b=Q/yVF7z7XY+n76DeT/4ayLE5H537FYRIYY5aZYwsa+wrPWaeQXOq6NpRZ5Cda7qBZy 0eocHBYEBRMHafW5vGiVxS3u8g33/QN3WSchVoxoyEpcL3xjdiutFcj94Abu5CPbDYkM Sypfp5siG61BXdv9QlIhiK9A7dnthwnJBJPXoJ3twqs5BpziLqs4ytxgOWgtwEheJr0n JIATbozumSn0rfs6/cOt/dQXHKjboP1g2vBskDdOs2UaxdjyA4ETxnRXUr7ZcbF4mtlV POrzSCLdcKJL/8Vm+4DMbo52aayvSf1I78gyYVKAVuQ4HwDqkJGGYYki/ZeH2qkyS0lu a+Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701211443; x=1701816243; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ALR8k+T7yG2e6Hu3D9MLUgYh7XPeC0FJx/tuV2JKN1I=; b=qM5Wy6aVTK0rlklrdYnzGCKK0B2VjM2xYBicMZ42XB2zL3xGZ4D9Nsvadf7pzFGmEv C930Pbk335nBc5XLA8PQA2xP+35qOkOOQRP/6aStvTyrqdzLxhaWd4+9Rq0UL/wT6llW pygYnaVf7NQAsapGcmesmPDIjyWMx84p2Vlhu0qdaFYDnlWWbCI01dnWAWJt7EOOtVRQ hYHGqdPG78jHDUvez86WlP6rrumbNAiLq8wrCoccSffTtcttEN1lhcxKHx7Jqu/OJoCM zZeS1WfPBXKGy1awHNnRwAWdiBr27ijdRWwwua+dvEnPmWXlkRc21tRFg8YI4khOIUsy +rnw== X-Gm-Message-State: AOJu0YyyYckecg/kyDgNxoQQdxhlYip/DhZSd0ZumJWYI/w+/Zzf2DsT SFK/0lvx1YNE8kae2q3ebuw= X-Google-Smtp-Source: AGHT+IHlI7vnjJnwMAKXOYPXY/Ywel0rsnMWknR1cpa0e/KcZcd5daaOJtrlFvTuTN2a8ER6/9wpFQ== X-Received: by 2002:a17:90b:4d08:b0:27f:e955:5682 with SMTP id mw8-20020a17090b4d0800b0027fe9555682mr22464718pjb.3.1701211443101; Tue, 28 Nov 2023 14:44:03 -0800 (PST) Received: from DT.local (c-71-202-158-162.hsd1.ca.comcast.net. [71.202.158.162]) by smtp.gmail.com with ESMTPSA id s5-20020a17090a5d0500b00280469602bcsm9868120pji.2.2023.11.28.14.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 14:44:02 -0800 (PST) From: nifan.cxl@gmail.com To: mcgrof@kernel.org Cc: nmtadam.samsung@gmail.com, kdevops@lists.linux.dev, jlayton@kernel.org, a.manzanares@samsung.com, Fan Ni Subject: [PATCH 2/4] CXL: Add a new topology to support DCD device emulation Date: Tue, 28 Nov 2023 14:42:02 -0800 Message-ID: <20231128224331.324500-3-nifan.cxl@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231128224331.324500-1-nifan.cxl@gmail.com> References: <20231128224331.324500-1-nifan.cxl@gmail.com> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Fan Ni 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 fixed 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 --- playbooks/roles/gen_nodes/defaults/main.yml | 1 + playbooks/roles/gen_nodes/templates/Vagrantfile.j2 | 11 ++++++++--- scripts/gen-nodes.Makefile | 3 +++ vagrant/Kconfig | 8 ++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/gen_nodes/defaults/main.yml b/playbooks/roles/gen_nodes/defaults/main.yml index 3a16d861..ef5e0c26 100644 --- a/playbooks/roles/gen_nodes/defaults/main.yml +++ b/playbooks/roles/gen_nodes/defaults/main.yml @@ -54,6 +54,7 @@ libvirt_qemu_qmp_wait: 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 0dafe2c2..20cdd592 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" {% if libvirt_enable_qmp %} libvirt.qemuargs :value => "-qmp" {% if libvirt_qemu_qmp_wait %} diff --git a/scripts/gen-nodes.Makefile b/scripts/gen-nodes.Makefile index 59771a6c..8906b49f 100644 --- a/scripts/gen-nodes.Makefile +++ b/scripts/gen-nodes.Makefile @@ -208,6 +208,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 177e1ee0..daf235e1 100644 --- a/vagrant/Kconfig +++ b/vagrant/Kconfig @@ -1681,6 +1681,14 @@ 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 where dynamic extents can be added. + endchoice endif # QEMU_ENABLE_CXL -- 2.42.0