From patchwork Thu Dec 14 04:08:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 10111421 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 E152C60327 for ; Thu, 14 Dec 2017 04:10:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8DD829B07 for ; Thu, 14 Dec 2017 04:10:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDAEB29B17; Thu, 14 Dec 2017 04:10:32 +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 C9CB529B07 for ; Thu, 14 Dec 2017 04:10:31 +0000 (UTC) Received: from localhost ([::1]:39064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePKqt-0005Su-47 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Dec 2017 23:10:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePKpj-0004WV-C7 for qemu-devel@nongnu.org; Wed, 13 Dec 2017 23:09:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePKph-00013K-EV for qemu-devel@nongnu.org; Wed, 13 Dec 2017 23:09:19 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:5208 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePKpg-00011Q-GI for qemu-devel@nongnu.org; Wed, 13 Dec 2017 23:09:17 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="31400366" Received: from localhost (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 14 Dec 2017 12:09:08 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id 49728486A789; Thu, 14 Dec 2017 12:09:06 +0800 (CST) Received: from localhost.localdomain (10.167.226.106) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 14 Dec 2017 12:09:05 +0800 From: Dou Liyang To: , , Date: Thu, 14 Dec 2017 12:08:54 +0800 Message-ID: <20171214040855.22231-2-douly.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171214040855.22231-1-douly.fnst@cn.fujitsu.com> References: <20171214040855.22231-1-douly.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 49728486A789.AEF3C 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] [RESEND PATCH for-2.12 1/2] 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: peter.maydell@linaro.org, indou.takao@jp.fujitsu.com, qemu-devel@nongnu.org, Dou Liyang 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 Reviewed-by: Igor Mammedov --- tests/acpi-test-data/pc/DSDT.numamem | Bin 0 -> 5150 bytes tests/acpi-test-data/pc/SRAT.numamem | Bin 0 -> 224 bytes tests/acpi-test-data/q35/DSDT.numamem | Bin 0 -> 7834 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..224cfdd9e983e02dac5f4bf7e210eaa64cb0dc78 GIT binary patch literal 5150 zcmb7I-EJG#5uUTVl$K{nX(_FLmDq$F*GSsf{PABDd4?gJ9 zBCr+q7#@Q(wF7SV)@soj!DZQq2dgp)G;(Rl6mz|r6^j~UVFn5s+K?!kL-|k!bx{v!mWd`eLBpjH z5AJ9rk8~&@kBU5cSv^Xkj%_*(ron5jVv3VsVh(Pk@nNOij#IjWM^SxE8Kse67Bi(g zs3_K|b*AZ|f&{Zz+o+~pR$Mbz!MJRjr8|;)iKM~6Z+JWtt$&pk*P-_1Hmqs(i;fy?*F=5;PYG;eS-IboekzruWO%zQ2|pPMkBi!h%X znzts+;|1}HqtB0-&j;r76Xx>~=JRfMUBT#`N%Kl*UZfD+BDm$E>}tkTu-S$dt}(fa zQ?$GK`mON7Gx_FG(YNcRkqJH(Bv;b3H`3)tpZlLa`Ahoo$DciV^7z5WpMlFvdu?@C zev_Q9FgSn%mcSZ~NflI)1DSP(J{6w|C)SZd}7B%4lY zEsaR4&`2AJW~Ek9eV|FVTl{b{s8Z-l=wGs6+LcTun;{Rv`#ff(%*OJcq#oaI!=9PR zWF8vjDXd|IxO-{ynj$VXijjP$N;El*#(eO4=l3TSlJ@?8n&Dv_;GpaF)=+_xy zlT^rXBEM0dF&(p}Muow=R|Rd~!z&p}PtaBoF97ErJgxLlKPTzuvq^9<2G^Ionh zz4CFYU_Vc$;_`7Wgd^90pc4IX@WTO9h~$o9m+gAEkUuBEr8uFg9p{4A@R}LeC%wOk=AC?V zZc1V3Gmft}=TrrIN9+nwx7Eo))VNrRjiXN@kM8& zHvDr3Uy;F>3zCz%GBQAFg64>ppm?dEDTHEk8vzxpF#(N5LGywYual5TY_~) zKxZPMf)(4v(AU{0=xxEO3#c9m6|5-%O+`UJ60CCqIu{8Qtn&go9|bK4R?Pe`EF%&s zSWgM)sVHbsu$~ss(~(fYdPYFcL_tl#dR9QsMnVPaIRQNv1+@h0c>z5i2^Fjh0=f_d zEeY0l1oWLqs9=3pK;MmmE(_KR0(v15Dp)TH=*5$uMtQ-yS8GVU#BLjJ-aV>y4+B9* z0jpUkq)8B(B^0nCg_;ftq)G0!HN3X>94sqCNg`>aQ&7UM^HY}<889%;L#C!Y%Nee((5GSArSg>ARp4S(dF@+v4lRd{A(^J%#Vk14pZH?(Ea!i(yK27qNehFpV_L06rGU|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..8c9fa445b0119b6f67533cb968855b41fb9925d9 GIT binary patch literal 7834 zcmb7JTW=f38J#7U)M`meOKN5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vLoJ4Bdkr@o7*j z7VrA?bb#u!y_dGH+G;(3Jkr=lqrpzR8N~)78lFFh@1W5S-1(^Y^2DC?wZq77rpVFh z3R&^4(8JXJ{rX(c2{xRQY*^7ZrOZKum5gX0;+laqacj=rWFZO#Upoo@Cdqf?L9#9-lgaCeHYft!f867~IfBc@>L z=z5>5*>qar3d09yC{8WskWMh1gw0YnpK%?5|MT>u=V$tKhSNzQ{5dQHb~EHm?A(1H z*X!F&;a|WRU29ePmEtuVGhVHtvzrdI=hGg(4#($t@pa+V=H)dY7awW)>W1t7?em;S z;J-CKBl^N})KT^*YdL7QvRJVc00jxWw+#J zWWe$5WF@_lwy;v>{b(DK&h>sFZCj{^?brGR$95Ag7IuJsMti8b_sbU()Z2fxdMl8( z^4wOXc@xL&8nI(lyp)%so0hj>Z}VzZ)t0N2nNG2Yn%cO|8|hZC(G~v(I>Rw) 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 e28e0c98cf..def81fc243 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -810,6 +810,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(); @@ -832,6 +854,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);