[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 42/46] qtest/cxl: Add aarch64 virt test for CXL
From: |
Jonathan Cameron |
Subject: |
[PATCH v7 42/46] qtest/cxl: Add aarch64 virt test for CXL |
Date: |
Sun, 6 Mar 2022 17:41:33 +0000 |
Add a single complex case for aarch64 virt machine.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
tests/qtest/cxl-test.c | 48 +++++++++++++++++++++++++++++++++--------
tests/qtest/meson.build | 1 +
2 files changed, 40 insertions(+), 9 deletions(-)
diff --git a/tests/qtest/cxl-test.c b/tests/qtest/cxl-test.c
index 0bb93b0191..c96469a435 100644
--- a/tests/qtest/cxl-test.c
+++ b/tests/qtest/cxl-test.c
@@ -17,6 +17,11 @@
"-device pxb-cxl,id=cxl.1,bus=pcie.0,bus_nr=53 " \
"-cxl-fixed-memory-window
targets.0=cxl.0,targets.1=cxl.1,size=4G "
+#define QEMU_VIRT_2PXB_CMD "-machine virt,cxl=on " \
+ "-device pxb-cxl,id=cxl.0,bus=pcie.0,bus_nr=52 " \
+ "-device pxb-cxl,id=cxl.1,bus=pcie.0,bus_nr=53 " \
+ "-cxl-fixed-memory-window
targets.0=cxl.0,targets.1=cxl.1,size=4G "
+
#define QEMU_RP "-device cxl-rp,id=rp0,bus=cxl.0,chassis=0,slot=0 "
/* Dual ports on first pxb */
@@ -134,18 +139,43 @@ static void cxl_2pxb_4rp_4t3d(void)
qtest_end();
}
+static void cxl_virt_2pxb_4rp_4t3d(void)
+{
+ g_autoptr(GString) cmdline = g_string_new(NULL);
+ char template[] = "/tmp/cxl-test-XXXXXX";
+ const char *tmpfs;
+
+ tmpfs = mkdtemp(template);
+
+ g_string_printf(cmdline, QEMU_VIRT_2PXB_CMD QEMU_4RP QEMU_4T3D,
+ tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs,
+ tmpfs, tmpfs);
+
+ qtest_start(cmdline->str);
+ qtest_end();
+}
+
int main(int argc, char **argv)
{
+ const char *arch = qtest_get_arch();
+
g_test_init(&argc, &argv, NULL);
- qtest_add_func("/pci/cxl/basic_hostbridge", cxl_basic_hb);
- qtest_add_func("/pci/cxl/basic_pxb", cxl_basic_pxb);
- qtest_add_func("/pci/cxl/pxb_with_window", cxl_pxb_with_window);
- qtest_add_func("/pci/cxl/pxb_x2_with_window", cxl_2pxb_with_window);
- qtest_add_func("/pci/cxl/rp", cxl_root_port);
- qtest_add_func("/pci/cxl/rp_x2", cxl_2root_port);
- qtest_add_func("/pci/cxl/type3_device", cxl_t3d);
- qtest_add_func("/pci/cxl/rp_x2_type3_x2", cxl_1pxb_2rp_2t3d);
- qtest_add_func("/pci/cxl/pxb_x2_root_port_x4_type3_x4", cxl_2pxb_4rp_4t3d);
+ if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+ qtest_add_func("/pci/cxl/basic_hostbridge", cxl_basic_hb);
+ qtest_add_func("/pci/cxl/basic_pxb", cxl_basic_pxb);
+ qtest_add_func("/pci/cxl/pxb_with_window", cxl_pxb_with_window);
+ qtest_add_func("/pci/cxl/pxb_x2_with_window", cxl_2pxb_with_window);
+ qtest_add_func("/pci/cxl/rp", cxl_root_port);
+ qtest_add_func("/pci/cxl/rp_x2", cxl_2root_port);
+ qtest_add_func("/pci/cxl/type3_device", cxl_t3d);
+ qtest_add_func("/pci/cxl/rp_x2_type3_x2", cxl_1pxb_2rp_2t3d);
+ qtest_add_func("/pci/cxl/pxb_x2_root_port_x4_type3_x4",
+ cxl_2pxb_4rp_4t3d);
+ } else if (strcmp(arch, "aarch64") == 0) {
+ qtest_add_func("/pci/cxl/virt/pxb_x2_root_port_x4_type3_x4",
+ cxl_virt_2pxb_4rp_4t3d);
+ }
+
return g_test_run();
}
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 7e072d9a84..f384b2096d 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -222,6 +222,7 @@ qtests_aarch64 = \
(config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ?
['tpm-tis-device-test'] : []) + \
(config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ?
['tpm-tis-device-swtpm-test'] : []) + \
(config_all_devices.has_key('CONFIG_XLNX_ZYNQMP_ARM') ? ['xlnx-can-test',
'fuzz-xlnx-dp-test'] : []) + \
+ qtests_cxl +
\
['arm-cpu-features',
'numa-test',
'boot-serial-test',
--
2.32.0
- [PATCH v7 32/46] mem/cxl_type3: Add read and write functions for associated hostmem., (continued)
- [PATCH v7 32/46] mem/cxl_type3: Add read and write functions for associated hostmem., Jonathan Cameron, 2022/03/06
- [PATCH v7 33/46] cxl/cxl-host: Add memops for CFMWS region., Jonathan Cameron, 2022/03/06
- [PATCH v7 34/46] RFC: softmmu/memory: Add ops to memory_region_ram_init_from_file, Jonathan Cameron, 2022/03/06
- [PATCH v7 35/46] hw/cxl/component Add a dumb HDM decoder handler, Jonathan Cameron, 2022/03/06
- [PATCH v7 36/46] i386/pc: Enable CXL fixed memory windows, Jonathan Cameron, 2022/03/06
- [PATCH v7 37/46] tests/acpi: q35: Allow addition of a CXL test., Jonathan Cameron, 2022/03/06
- [PATCH v7 38/46] qtests/bios-tables-test: Add a test for CXL emulation., Jonathan Cameron, 2022/03/06
- [PATCH v7 39/46] tests/acpi: Add tables for CXL emulation., Jonathan Cameron, 2022/03/06
- [PATCH v7 40/46] qtest/cxl: Add more complex test cases with CFMWs, Jonathan Cameron, 2022/03/06
- [PATCH v7 41/46] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl, Jonathan Cameron, 2022/03/06
- [PATCH v7 42/46] qtest/cxl: Add aarch64 virt test for CXL,
Jonathan Cameron <=
- [PATCH v7 43/46] docs/cxl: Add initial Compute eXpress Link (CXL) documentation., Jonathan Cameron, 2022/03/06
- [PATCH v7 44/46] pci-bridge/cxl_upstream: Add a CXL switch upstream port, Jonathan Cameron, 2022/03/06
- [PATCH v7 45/46] pci-bridge/cxl_downstream: Add a CXL switch downstream port, Jonathan Cameron, 2022/03/06
- [PATCH v7 46/46] cxl/cxl-host: Support interleave decoding with one level of switches., Jonathan Cameron, 2022/03/06
- Re: [PATCH v7 00/46] CXl 2.0 emulation Support, Michael S. Tsirkin, 2022/03/06