From patchwork Sun Mar 11 03:02:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haozhong Zhang X-Patchwork-Id: 10274501 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 971B060390 for ; Sun, 11 Mar 2018 03:07:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8859A28D38 for ; Sun, 11 Mar 2018 03:07:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CEC728DD0; Sun, 11 Mar 2018 03:07:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D99D628D38 for ; Sun, 11 Mar 2018 03:07:01 +0000 (UTC) Received: from localhost ([::1]:52778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eurK9-0007yd-4Z for patchwork-qemu-devel@patchwork.kernel.org; Sat, 10 Mar 2018 22:07:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eurFu-0004Jr-02 for qemu-devel@nongnu.org; Sat, 10 Mar 2018 22:02:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eurFq-00027X-Ll for qemu-devel@nongnu.org; Sat, 10 Mar 2018 22:02:38 -0500 Received: from mga04.intel.com ([192.55.52.120]:52978) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eurFq-00023F-9n for qemu-devel@nongnu.org; Sat, 10 Mar 2018 22:02:34 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2018 19:02:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,453,1515484800"; d="scan'208";a="24605833" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.13.35]) by orsmga006.jf.intel.com with ESMTP; 10 Mar 2018 19:02:31 -0800 From: Haozhong Zhang To: qemu-devel@nongnu.org Date: Sun, 11 Mar 2018 11:02:14 +0800 Message-Id: <20180311030215.11488-5-haozhong.zhang@intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180311030215.11488-1-haozhong.zhang@intel.com> References: <20180311030215.11488-1-haozhong.zhang@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.120 Subject: [Qemu-devel] [PATCH v6 4/5] tests/bios-tables-test: add test cases for DIMM proximity X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haozhong Zhang , Xiao Guangrong , mst@redhat.com, Eduardo Habkost , Stefan Hajnoczi , Paolo Bonzini , Marcel Apfelbaum , Igor Mammedov , Dan Williams , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Suggested-by: Igor Mammedov --- 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 65b271a173..34b55ff812 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -869,6 +869,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(); @@ -893,6 +929,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);