From patchwork Tue Aug 22 03:24:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 9914145 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 4E5C5603FA for ; Tue, 22 Aug 2017 03:25:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47E4128576 for ; Tue, 22 Aug 2017 03:25:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BCED2881A; Tue, 22 Aug 2017 03:25:59 +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, NORMAL_HTTP_TO_IP, 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 1AB9428576 for ; Tue, 22 Aug 2017 03:25:58 +0000 (UTC) Received: from localhost ([::1]:58532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djzpF-0000pX-7v for patchwork-qemu-devel@patchwork.kernel.org; Mon, 21 Aug 2017 23:25:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djznz-0000mK-Iw for qemu-devel@nongnu.org; Mon, 21 Aug 2017 23:24:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djznx-0006qk-3G for qemu-devel@nongnu.org; Mon, 21 Aug 2017 23:24:39 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:31593 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djznw-0006oB-7o for qemu-devel@nongnu.org; Mon, 21 Aug 2017 23:24:37 -0400 X-IronPort-AV: E=Sophos;i="5.41,410,1498492800"; d="scan'208";a="24320735" Received: from localhost (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 22 Aug 2017 11:24:21 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id EFBDE4724996; Tue, 22 Aug 2017 11:24:20 +0800 (CST) Received: from localhost.localdomain.localdomain (10.167.226.106) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 22 Aug 2017 11:24:18 +0800 From: Dou Liyang To: , , Date: Tue, 22 Aug 2017 11:24:10 +0800 Message-ID: <1503372250-5092-3-git-send-email-douly.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1503372250-5092-1-git-send-email-douly.fnst@cn.fujitsu.com> References: <1503372250-5092-1-git-send-email-douly.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: EFBDE4724996.A3897 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 v4 2/2] ACPI/unit-test: Add a new 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: pbonzini@redhat.com, mst@redhat.com, Dou Liyang , rth@twiddle.net 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 --- tests/acpi-test-data/pc/DSDT.numamem | Bin 0 -> 6463 bytes tests/acpi-test-data/pc/SLIT.numamem | Bin 0 -> 48 bytes tests/acpi-test-data/pc/SRAT.numamem | Bin 0 -> 264 bytes tests/acpi-test-data/q35/DSDT.numamem | Bin 0 -> 9147 bytes tests/acpi-test-data/q35/SLIT.numamem | Bin 0 -> 48 bytes tests/acpi-test-data/q35/SRAT.numamem | Bin 0 -> 264 bytes tests/bios-tables-test.c | 30 ++++++++++++++++++++++++++++++ 7 files changed, 30 insertions(+) create mode 100644 tests/acpi-test-data/pc/DSDT.numamem create mode 100644 tests/acpi-test-data/pc/SLIT.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/SLIT.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..53f6d5824359ff0ca20179b19b3b5cb79f017f82 GIT binary patch literal 6463 zcmcgw-EJGl6`tiTrR9*4meR(St)wR8{4{A|^T&}Bv}jH4QX(xbwdPW;i#5unETdGA z)(a&rq6h(G22h;b1+0tqjy8C0KSKKmd4%*8QZ(^Z)bH$aD2CDk$wf;*t2uMN{mwZv zXU@#5>6p#moMTMdFKrkVCsVp*8z%ZB#u&BfzgAUlGxxwOt+k|NOp)9N$)Jr#N!8yp zOPg!b-#Xr3J@3QMJgM!ottZ-}t+xN^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2|g{gskx(qk>I#p!UVmHpenHPN~kjD89A9APA#Y!+8?`kv!<-*9q6 z0plHGI@oe1HVbOxMWa9sxBI%2dj~H%oAu%MAiN?oeLh%ebZsRAq$X&dXbFl_H%tMF z+kXU9u*L;69tAB3R-Cs()~QISV4W7w=_u$G!HTaLA*&h*6|4yXO+-Q87OY%Ac_dV@ zBJn~8l2OnV!I~1#R3uce&IssC6!fZKofXj8NT^`NeLD1YE(-dNVATXvi-Zc+w1B3g zpzjLSc>$e|gbLOL0bPiK76mIZKMYHcgbLOd1oVX{Xi2c15zsS{P{DduK+i@&4Z*r7 zpo@`E!Foym&jMM2Ag^+f@FF%l|RUlP!lqM)mS^=AV5vq-35 zy&#|$PJ`-|CG%#z8SAI^JGh!0Qmxww1PubJStw*k5SnWcP?18-0STm;+3zHAuQ_y3 zR)$iHq>)a6gyJyNk*&8!Ix>bOKGc!5m649jVWAFnWbZ2J=Jq?NuGmEm9V|E@V;_Nh ztjBJ0=wRsxJ?>tRkM$bKSOh|!3FKq_HIk9eLVpm*$NC^*B&N_~GdXmOF+D|%6dUO& uZgWgekt10~`V7fq`fHFe?IZmG$dYwdQV#b literal 0 HcmV?d00001 diff --git a/tests/acpi-test-data/pc/SLIT.numamem b/tests/acpi-test-data/pc/SLIT.numamem new file mode 100644 index 0000000000000000000000000000000000000000..74ec3b4b461ffecca36d8537975c202a5f011185 GIT binary patch literal 48 scmWIc@eDCwU|?X>aq@Te2v%^42yhMtiZKGkKx`1r1jHb~B`V4V0NaKK0RR91 literal 0 HcmV?d00001 diff --git a/tests/acpi-test-data/pc/SRAT.numamem b/tests/acpi-test-data/pc/SRAT.numamem new file mode 100644 index 0000000000000000000000000000000000000000..f8ec8fa242adc6132ba033bfc13cf7e858ad22cc GIT binary patch literal 264 zcmWFzatz^MWME*N>*Vk35v<@85#SsQ6axw|fY=}!gyBE{mCvYwA`4W;1y_nJgHQ)F m01Q5`!xW;bgNZV5z*$fR4t40tQ1}RY;qLwcQ@{*k0BHdBCkg=o 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..1b7c484a5e31ec456685bc246197252cb48a3adf GIT binary patch literal 9147 zcmcgyO>Y~=8J;C6YBi*!rL>mik3@tWG;Nv>N^+f|AA!kTie$umB%&THng0GFI;}C))U^ z*zVJQ<$BHf^KSS>7~cIbv~ET0_Lt7*w{J!7e-z$k1bXXs#5pybP2TTR`n@BMx4cHl z?$;ZBzWg<}?Y<{lX}e$c+sy7?Z}^tmobGRTyv)7VndiT}I^3EX>=qWe(+mEw{_V=e zYhS#4xBS&F|NiTHuk#E5Yxr;D|9V6p;kzMU35U+7gFWj#qKjjz!^KYr;;`&<=tvY& z&;7jYqExG+*PXzYW3AftR<*0fYGH&J8|I_l>IN*&*w^3XSf+RAP`vn3b;~cd+J3+2 zUhQ|fWfoCS7*W@)KZe{1hxtziAsd9b1Sy;G;Nr^Y@<`|i>bl@Rxp@WqrH>jA?nmB_ge!x?`!*kST z-gZzRf?vpc-6&eXhKd)^C0~o&Fo8#NV7p{))HxWN)3nR^wd152Px#Sk;iT| zybb2&`}l7~yA(Npdc~qs;CTNMmrJYNZ7poRd9aYnVD+%()@GH-wuSZvTgX#CPa&wO zAdR5T7G^W~<6~UR5*J6r0&q?q6FfjwNKE7x*py%b8%M-c&=eC)Km`*aF)s+w6?956)!-58IrEdI&DLzZRoU3od|WE*der;o-uUJm^u;aI=P{f8#=kE6QQm% zXXwlsI&-E@gt|`bRNDE>8#?o*PK3J7SwrWnp>x*MiBQ)$XXu0f}P z3MLsSLX1WksKmw*)l^$|V8TE(C>f}P3MLsSLZuT1DzSnI1J$5ppb{#WWS|I@P8g`f3MLFxgOY(ts9=(T zB2+qIpb{&XFi;Ij1}dR~Nd}5g>4bqwtYE@GH7FUVgbF4ZC_<$Z1}d?F2?N!jWS|l% zm}H;`l};F_#0n-1RD+U%N~mCxfg)5oVW1K#m@rTc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m!(x#wI?cU6et+C3no()>f-j zE?q@Ax-f$~zk6fE7Y9+CU zJcg^GcbSeIAAk9a&qHEFAtf9x4rFz#SzI(?DEF6!?m!NQdTHHKv>(z+r6eQEeI}rN zO-md7WtWMBxq;9mHwb|a-STpPTVL!5atI1*2kom@3hTUd@5hYg@q)?x`|eo&sopp| z#uo=7@;QvWDVqyu)@Abt&8q5s3eC88DJb8FvFFjOM|7HqM2#jTLZewH0yUbHWS_dJ zL0k&NVPX&6}&?^A4v&VuN)?w<5et4YV2Lw|Ze-B>{F^|itZzxW}H=%HkiN-{~J zkhi|ZInwu`3C%fh=?hSK;U7n)$+Mc$ZuB+{ob~oA+9G5m)aVp~525g~DBQN(r z`CAU0l|p5j|Nf&{mcpY-T9)*IxBCzB5Av3ceoHRhZ*llR{v@6ii}>IA(&kvw^!1$n zQcN5XU;Yt(b$tA{@5BN2)eH11055}~$={MB_F(GQ?zixJj&7Ofw5`3EEoLqJl)(AX zO`L_!dVe9Cu}}!@EBysK!&4j&?h*Zjj!;qO=MN?Kj-K6k*^~FWvpdz`I*g6ZX0nPi zDPHGqWaQ5{a-C8Mzh9sqy!4Kq>Xd#e1I&)aa0A|1^|3!wV@);IMI+nt Hwz}-UIV`hz literal 0 HcmV?d00001 diff --git a/tests/acpi-test-data/q35/SLIT.numamem b/tests/acpi-test-data/q35/SLIT.numamem new file mode 100644 index 0000000000000000000000000000000000000000..74ec3b4b461ffecca36d8537975c202a5f011185 GIT binary patch literal 48 scmWIc@eDCwU|?X>aq@Te2v%^42yhMtiZKGkKx`1r1jHb~B`V4V0NaKK0RR91 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..f8ec8fa242adc6132ba033bfc13cf7e858ad22cc GIT binary patch literal 264 zcmWFzatz^MWME*N>*Vk35v<@85#SsQ6axw|fY=}!gyBE{mCvYwA`4W;1y_nJgHQ)F m01Q5`!xW;bgNZV5z*$fR4t40tQ1}RY;qLwcQ@{*k0BHdBCkg=o literal 0 HcmV?d00001 diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 564da45..79728c6 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -808,6 +808,34 @@ 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(" -m 128,slots=3,maxmem=1G" + " -numa node -numa node,mem=128" + " -numa dist,src=0,dst=1,val=21", + &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(" -m 128,slots=3,maxmem=1G" + " -numa node -numa node,mem=128" + " -numa dist,src=0,dst=1,val=21", + &data); + free_test_data(&data); +} + int main(int argc, char *argv[]) { const char *arch = qtest_get_arch(); @@ -830,6 +858,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);