From patchwork Wed Oct 18 03:48:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 10013411 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 96594603FF for ; Wed, 18 Oct 2017 03:50:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E74428AA3 for ; Wed, 18 Oct 2017 03:49:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 310E328AA4; Wed, 18 Oct 2017 03:49:58 +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 EAB4B28A8D for ; Wed, 18 Oct 2017 03:49:56 +0000 (UTC) Received: from localhost ([::1]:42420 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4fMh-0001Y1-Lm for patchwork-qemu-devel@patchwork.kernel.org; Tue, 17 Oct 2017 23:49:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4fM4-0001Xk-Ca for qemu-devel@nongnu.org; Tue, 17 Oct 2017 23:49:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4fM1-0001Bl-35 for qemu-devel@nongnu.org; Tue, 17 Oct 2017 23:49:16 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:57647 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4fM0-00015N-6R for qemu-devel@nongnu.org; Tue, 17 Oct 2017 23:49:13 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="29333538" Received: from localhost (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 18 Oct 2017 11:49:04 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id CF80647F13CE; Wed, 18 Oct 2017 11:49:05 +0800 (CST) Received: from localhost.localdomain.localdomain (10.167.226.106) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 18 Oct 2017 11:49:03 +0800 From: Dou Liyang To: , Date: Wed, 18 Oct 2017 11:48:58 +0800 Message-ID: <1508298538-28753-1-git-send-email-douly.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: CF80647F13CE.A4E44 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 183.91.158.132 Subject: [Qemu-devel] [PATCH] ACPI/unit-test: Add a testcase for RAM allocation in numa node 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: Dou Liyang , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP As QEMU supports the memory-less node, it is possible that there is no RAM in the first numa node(also be called as node0). eg: ... \ -m 128,slots=3,maxmem=1G \ -numa node -numa node,mem=128M \ But, this makes it hard for QEMU to build a known-to-work ACPI SRAT table. Only fixing it is not enough. Add a testcase for this situation to make sure the ACPI table is correct for guest. Suggested-by: Eduardo Habkost Signed-off-by: Dou Liyang --- Changelog: This patch can pass the 'make check' in Peter's machine, But, in my own and Eduardo's machine, we can pass it. So I rebase and spilt it independently. Peter: could you help me test it in your machine. then, give me the output files, such as /tmp/asl-6QYK7Y.dsl and /tmp/asl-1H1I7Y.dsl file. tests/acpi-test-data/pc/DSDT.numamem | Bin 0 -> 5104 bytes tests/acpi-test-data/pc/SRAT.numamem | Bin 0 -> 224 bytes tests/acpi-test-data/q35/DSDT.numamem | Bin 0 -> 7788 bytes tests/acpi-test-data/q35/SRAT.numamem | Bin 0 -> 224 bytes tests/bios-tables-test.c | 24 ++++++++++++++++++++++++ 5 files changed, 24 insertions(+) create mode 100644 tests/acpi-test-data/pc/DSDT.numamem create mode 100644 tests/acpi-test-data/pc/SRAT.numamem create mode 100644 tests/acpi-test-data/q35/DSDT.numamem create mode 100644 tests/acpi-test-data/q35/SRAT.numamem diff --git a/tests/acpi-test-data/pc/DSDT.numamem b/tests/acpi-test-data/pc/DSDT.numamem new file mode 100644 index 0000000000000000000000000000000000000000..bc703d77ee48720af1b801c518b43511c95c852d GIT binary patch literal 5104 zcmb7IZExE~5}qX~n_5aXWizjC8^LKVXmL&SlDFc3gC$b76k9SQ%DEh9oG8b|DMfK1 z(gvt&6i`&ab^ERG;xE-sw(qx*XF!z}jjPX%ajXzq&jTQFq zw)Zd3`{YZHwS3rmsXyOp`CsgNTR@obq*UN7;@fd>bkHW>7wH}lOw3;x+kz<+;?^`Xya)uvf@QYk*O7srT^929^Z z(63x0Z^&J@d%=E?%?G|FWMJruoz0sP@PWP*8-tlj#VIsH94;*3Ze&b}dmP>U!{4qE z3%vBYS9|OW!Z=at1=2Sc+mq77{0X)+xWdGVZ3hlYIS{M^y2LNdbhD6aE$wxA%i+Vt_OfTwcvY}08l4PJ2-Q=9}7b8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88d`38YEx zwl%zn_Z%!MLrEfOq*GAB;xN>at(zkq8N(w!)RDDYBORH;gF4iaz1yUl-ECua#am?0 z!2>5`yhl(z*5hrm=it#1dTbU@KGy3b;~^0GbRZw=mq^BR7Wz&gAM1mNF)@W6FOxmT z9MeiGn0^Um-1d>aLo(`(OVoJae}w3#J#8W0bsKCru(jB1F=Cg2*ZH@DxXmUE`z~9*2k!U%mXRq Yf~!ZCL8t>-1O^}2VG2>z!9?-X08OU~0RR91 literal 0 HcmV?d00001 diff --git a/tests/acpi-test-data/q35/DSDT.numamem b/tests/acpi-test-data/q35/DSDT.numamem new file mode 100644 index 0000000000000000000000000000000000000000..fcb18d947b28c09c8b5a4fa65692efb41ef3a5d9 GIT binary patch literal 7788 zcmb7JTW=f38J#7U)M~kumeR`dU4ruvv}j_=PLrZV1CzVFRiZ?Zbew0D2nJQ>iNFm$TLd{i1Cv5m>(Yk5>h?S3es3>yTVbQ<^y`ht zD}C=ePCt}eX{TR`+QRAIY(!SDHr3zgg!YqrB8+aW4A(RJ+l6`8?=}B<{fDKCH@>;` zu=MP=|M{Ta~UFtA!C_Y?zOFtJ@Tw5a0ip6LxRcCp`aFWj$JMwWI!W@Or<~ zEr|iO!~<%&{pZ;AB}}cr9Mv;2C#&|v>NTrlpDKVZ)XihFy-#Jsow56+7{tP zvy>JVe#-b+YjvX(vnnZfk5~&}RYX{-tXp9jUu!LV`8O7?rd36%*4ulf-3?Jx9j2+qnGr}4+bEN1yYJhhJt`fk2veU$zv?KoF< zxKPE$oUABE8EbUbjk=);IjNh&^kG^!SA6cKO5I#bbmOMfaA;0X>?d`YLO%}raaxVA zDgv*MUu&>U$p6bb799dV{5M}Nt#-FHxB6gbE@$KH5o_zK6(P4RY*)pcN9}G3pr$|? zpf2X}ws&-di&^qUh*TiX$bGB>RY6jsf99rG3GN7yQc+Wam7uZ`kdzn=bJMI;BcSt- zdu3``DnV6{l&T8Od&%W~Y*s3&EtP8UfV$6&;WNWZMa@X18a$xxGi&(F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3xVXvV6(ohpy{Ucgf4xEtuWm zS!1j_**3AevFmcq><$kgW8KNNiQSD|XY*!vcq$p|PPR?#ZtS`V%^xmGyTg;tSa-6`?9ShKL#_~n?$(QU z<*jz5qs~MZ7a;N{AGU5T*FStX_~6kWm+!y#;KN7vfB)VC(X+zV+Un?x%)4&QdhR{< zEDx`?kvj;)+;a~v^mkt(P!h`_y_XLg>m4g>H{Y_t%I}Jnu*0w!IlbLEBBjGlWo;SE zsMKA?tK`Od!x;!_?Cq6b+2R!hj75$wUkY1|VsWKNBao{vnV=AMtM8)TBcT)-J!YgPJ{;x!yIUag|Dn+~)e&>p@HN9TF*bu46h@*0qfkF6MP8)v z-x{AI`oeP5p?Bz64%#gb>lZ@&fZd1QG0tQ0MTq}?j+=tqPtTJ_NAx^NpOoM|{Im-A z?C9vbA9;s(_9iV`g*JvJ7eDi@^;WTjp~?FMwQDyBEI@WkZcauP-yoK=%UKI+U;fXw zAn9E1&t+{3g|Pivf6lSpl#8VrpkLA+D(e5{h2`GftJPbfygBDLE6tlY64!{GsN!e* z4BdwOb$g4~pQ^T8cg%H)MJ%|{3T7If!u78B EKkzjyY5)KL literal 0 HcmV?d00001 diff --git a/tests/acpi-test-data/q35/SRAT.numamem b/tests/acpi-test-data/q35/SRAT.numamem new file mode 100644 index 0000000000000000000000000000000000000000..dbc595d9cb85d3fcb5a4243153f42bb431c9de8f GIT binary patch literal 224 zcmWFzatwLEz`(%x#mV2jB1F=Cg2*ZH@DxXmUE`z~9*2k!U%mXRq Yf~!ZCL8t>-1O^}2VG2>z!9?-X08OU~0RR91 literal 0 HcmV?d00001 diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 564da45..f092315 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -808,6 +808,28 @@ static void test_acpi_piix4_tcg_memhp(void) free_test_data(&data); } +static void test_acpi_q35_tcg_numamem(void) +{ + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = MACHINE_Q35; + data.variant = ".numamem"; + test_acpi_one(" -numa node -numa node,mem=128", &data); + free_test_data(&data); +} + +static void test_acpi_piix4_tcg_numamem(void) +{ + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = MACHINE_PC; + data.variant = ".numamem"; + test_acpi_one(" -numa node -numa node,mem=128", &data); + free_test_data(&data); +} + int main(int argc, char *argv[]) { const char *arch = qtest_get_arch(); @@ -830,6 +852,8 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/cpuhp", test_acpi_q35_tcg_cphp); qtest_add_func("acpi/piix4/memhp", test_acpi_piix4_tcg_memhp); 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); } ret = g_test_run(); boot_sector_cleanup(disk);