qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Haozhong Zhang <haozhong.zhang@intel.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: [Qemu-devel] [PULL 21/22] tests/bios-tables-test: add test cases for DIMM proximity
Date: Tue, 13 Mar 2018 23:45:41 +0200	[thread overview]
Message-ID: <1520977432-187679-22-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1520977432-187679-1-git-send-email-mst@redhat.com>

From: Haozhong Zhang <haozhong.zhang@intel.com>

QEMU now builds one SRAT memory affinity structure for each PC-DIMM
and NVDIMM device presented at boot time with the proximity domain
specified in the device option 'node', rather than only one SRAT
memory affinity structure covering the entire hotpluggable address
space with the proximity domain of the last node.

Add test cases on PC and Q35 machines with 4 proximity domains, and
one PC-DIMM and one NVDIMM attached to the 2nd and 3rd proximity
domains respectively. Check whether the QEMU-built SRAT tables match
with the expected ones.

The following ACPI tables need to be added for this test:
  tests/acpi-test-data/pc/APIC.dimmpxm
  tests/acpi-test-data/pc/DSDT.dimmpxm
  tests/acpi-test-data/pc/NFIT.dimmpxm
  tests/acpi-test-data/pc/SRAT.dimmpxm
  tests/acpi-test-data/pc/SSDT.dimmpxm
  tests/acpi-test-data/q35/APIC.dimmpxm
  tests/acpi-test-data/q35/DSDT.dimmpxm
  tests/acpi-test-data/q35/NFIT.dimmpxm
  tests/acpi-test-data/q35/SRAT.dimmpxm
  tests/acpi-test-data/q35/SSDT.dimmpxm
New APIC and DSDT are needed because of the multiple processors
configuration. New NFIT and SSDT are needed because of NVDIMM.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/bios-tables-test.c | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index cd753ff..bf3e193 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -823,6 +823,42 @@ static void test_acpi_piix4_tcg_numamem(void)
     free_test_data(&data);
 }
 
+static void test_acpi_tcg_dimm_pxm(const char *machine)
+{
+    test_data data;
+
+    memset(&data, 0, sizeof(data));
+    data.machine = machine;
+    data.variant = ".dimmpxm";
+    test_acpi_one(" -machine nvdimm=on"
+                  " -smp 4,sockets=4"
+                  " -m 128M,slots=3,maxmem=1G"
+                  " -numa node,mem=32M,nodeid=0"
+                  " -numa node,mem=32M,nodeid=1"
+                  " -numa node,mem=32M,nodeid=2"
+                  " -numa node,mem=32M,nodeid=3"
+                  " -numa cpu,node-id=0,socket-id=0"
+                  " -numa cpu,node-id=1,socket-id=1"
+                  " -numa cpu,node-id=2,socket-id=2"
+                  " -numa cpu,node-id=3,socket-id=3"
+                  " -object memory-backend-ram,id=ram0,size=128M"
+                  " -object memory-backend-ram,id=nvm0,size=128M"
+                  " -device pc-dimm,id=dimm0,memdev=ram0,node=1"
+                  " -device nvdimm,id=dimm1,memdev=nvm0,node=2",
+                  &data);
+    free_test_data(&data);
+}
+
+static void test_acpi_q35_tcg_dimm_pxm(void)
+{
+    test_acpi_tcg_dimm_pxm(MACHINE_Q35);
+}
+
+static void test_acpi_piix4_tcg_dimm_pxm(void)
+{
+    test_acpi_tcg_dimm_pxm(MACHINE_PC);
+}
+
 int main(int argc, char *argv[])
 {
     const char *arch = qtest_get_arch();
@@ -847,6 +883,8 @@ int main(int argc, char *argv[])
         qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp);
         qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem);
         qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem);
+        qtest_add_func("acpi/piix4/dimmpxm", test_acpi_piix4_tcg_dimm_pxm);
+        qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm);
     }
     ret = g_test_run();
     boot_sector_cleanup(disk);
-- 
MST

  parent reply	other threads:[~2018-03-13 21:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 21:45 [Qemu-devel] [PULL 00/22] virtio,vhost,pci,pc: features, cleanups Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 01/22] scripts/update-linux-headers: add ethtool.h and update to 4.16.0-rc4 Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 03/22] virtio-net: add linkspeed and duplex settings to virtio-net Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 02/22] virtio-net: use 64-bit values for feature flags Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 04/22] acpi: remove unused acpi-dsdt.aml Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 05/22] pc: replace pm object initialization with one-liner in acpi_get_pm_info() Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 06/22] acpi: reuse AcpiGenericAddress instead of Acpi20GenericAddress Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 07/22] acpi: add build_append_gas() helper for Generic Address Structure Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 08/22] acpi: move ACPI_PORT_SMI_CMD define to header it belongs to Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 09/22] pc: acpi: isolate FADT specific data into AcpiFadtData structure Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 11/22] acpi: move build_fadt() from i386 specific to generic ACPI source Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 10/22] pc: acpi: use build_append_foo() API to construct FADT Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 12/22] virt_arm: acpi: reuse common build_fadt() Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 13/22] tests: acpi: don't read all fields in test_acpi_fadt_table() Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 15/22] qemu-options-wrapper.h: fix include patch Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 14/22] vhost: used_memslots refactoring Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 16/22] standard-headers: update virtio_net.h Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 17/22] hw/pci: remove obsolete PCIDevice->init() Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 18/22] pc-dimm: make qmp_pc_dimm_device_list() sort devices by address Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 20/22] hw/acpi-build: build SRAT memory affinity structures for DIMM devices Michael S. Tsirkin
2018-03-13 21:45 ` [Qemu-devel] [PULL 19/22] qmp: distinguish PC-DIMM and NVDIMM in MemoryDeviceInfoList Michael S. Tsirkin
2018-03-13 21:45 ` Michael S. Tsirkin [this message]
2018-03-13 21:45 ` [Qemu-devel] [PULL 22/22] test/acpi-test-data: add ACPI tables for dimmpxm test Michael S. Tsirkin
2018-03-16 16:31 ` [Qemu-devel] [PULL 00/22] virtio, vhost, pci, pc: features, cleanups Peter Maydell

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=1520977432-187679-22-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=haozhong.zhang@intel.com \
    --cc=imammedo@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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 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).