From patchwork Tue May 24 17:37:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 68527 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp770107qge; Tue, 24 May 2016 10:43:37 -0700 (PDT) X-Received: by 10.140.132.73 with SMTP id 70mr4689088qhe.42.1464111817761; Tue, 24 May 2016 10:43:37 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l55si3515053qta.73.2016.05.24.10.43.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 May 2016 10:43:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:54596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5GMj-0008RO-8w for patch@linaro.org; Tue, 24 May 2016 13:43:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5GH1-0003mg-60 for qemu-devel@nongnu.org; Tue, 24 May 2016 13:37:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5GGt-0004bn-TD for qemu-devel@nongnu.org; Tue, 24 May 2016 13:37:42 -0400 Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244]:34560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5GGt-0004bf-Ls for qemu-devel@nongnu.org; Tue, 24 May 2016 13:37:35 -0400 Received: by mail-oi0-x244.google.com with SMTP id r64so5630829oie.1 for ; Tue, 24 May 2016 10:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=sScuPDe8oppdbzSqtEvcoXv8AlyFX2PlidS3yU+5T8E=; b=idUxiqGvRqY3WczqdaPEdQC8kX3W4YaqVCNrvk2cgTvtBLjXMx6rVhu4PUEZyAumxc o0VIzRBYONGcVfXgLBSt0krqDyVbGT7wnM4oLBJ5wR6qqIzZ0ThjknFxJQ6mlnoa8JAE T6N/DX+m/5lSmyYoZkPTcLvY2QXbVGoKRodS5AKi/1IOAPN9bZBZfcgWWEJq5YyfIdPl dtWZ2VkFJv2gBvbc5to2fyzilkMiEWz6y5w0BLQ/FSW6oz+Mibilun1eRY8YKK1039z8 UDDqIhmXJGizMnxlAclheNVW6uP4/iIGZ93SZxif/mRQpfTliVMvr/9x9A29uuxrE+wx Yq6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=sScuPDe8oppdbzSqtEvcoXv8AlyFX2PlidS3yU+5T8E=; b=TI+hCT1dyQa+eYzlLnhWwWfrqYj4DBtgLfiOea74tmnMXLrXoPIa3zYV0xgVbcG4LP FJDXMij6BPPIGYtw4n5fsKhIsTH6aSKXpCxS4qQP1Je5ZywNszxlIKPX8NOsR5Gk7eK7 Y1mP/eS8R5NsMdtpNrpqhgMiPGF4hP0/lkfewxyk3g4JcyeDYS5I9S6r4NchJW3elxne ilCKiSLewz1NfG6u/Uj4LFMzwByvFpt2EvPCGvbggvv2OCerYrNDO/PhcClUeMAXdG5N Dti+wnVVpwkqjOak3TeHC6jxp7bBKa2H9Q/ulmq1wP4jHU/e+LhA606YpNiwsBQAL9LI jyUg== X-Gm-Message-State: ALyK8tIJQ3ts46LU69OFCfqOlgdZH0Lp1pTqMVi3xlUMvT43UPksS+SwwPdTkAcCPV7wcw== X-Received: by 10.157.40.107 with SMTP id h40mr3019216otd.167.1464111454994; Tue, 24 May 2016 10:37:34 -0700 (PDT) Received: from serve.minyard.net ([108.19.215.157]) by smtp.gmail.com with ESMTPSA id l103sm1867541otl.5.2016.05.24.10.37.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 May 2016 10:37:34 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 2647E1E6D; Tue, 24 May 2016 12:37:28 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id D37BC300556; Tue, 24 May 2016 12:37:25 -0500 (CDT) From: minyard@acm.org To: Igor Mammedov , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org, minyard@acm.org, cminyard@mvista.com Date: Tue, 24 May 2016 12:37:22 -0500 Message-Id: <1464111442-10387-7-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1464111442-10387-1-git-send-email-minyard@acm.org> References: <1464111442-10387-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::244 Subject: [Qemu-devel] [PATCH v7 6/6] bios: Add tests for the IPMI ACPI and SMBIOS entries 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Corey Minyard Signed-off-by: Corey Minyard --- tests/acpi-test-data/pc/DSDT.ipmikcs | Bin 0 -> 5659 bytes tests/acpi-test-data/q35/DSDT.ipmibt | Bin 0 -> 8432 bytes tests/bios-tables-test.c | 60 ++++++++++++++++++++++++++++++++--- 3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 tests/acpi-test-data/pc/DSDT.ipmikcs create mode 100644 tests/acpi-test-data/q35/DSDT.ipmibt -- 2.7.4 diff --git a/tests/acpi-test-data/pc/DSDT.ipmikcs b/tests/acpi-test-data/pc/DSDT.ipmikcs new file mode 100644 index 0000000000000000000000000000000000000000..b715983862972b4d02b488d4317434aa55bac244 GIT binary patch literal 5659 zcmb7IUvC@75ud#yrQ?#6j?!6{tt2L7J8sh2<{w*j(4r7|M~Req)R{-QF3#v3B^jmL zq&~>K4(mnEeba~>yyF+R$Q_7kJL zvC973@&4p_4?p!-+lS5P>eJ1(|H%_?6A1KZ)90K9>Y{6xU8lQX>9w5VR%=G8^d*-S zw`4RyaW`rPQ%xnrRFtY!X$cTR5Q@=_s?{3&W(%>0WHMbW|E{SrRvk{GI0~R+$ez zsL~>^Rki~=AWiIo)4g`1Y>eQttR;e787(xJ=z#|eXKlkaz8582uhYF?u5XMcPR|~n zsPOnAs01u2D~3Kg#L1yY3w(Z+eJy`2Lu{43l3(FQEiS{mu|RizrEZnPVXqjqnXC#t z&ewU4@t0iU=kafbFYrVDKL3VKb477ij7sJt*C-6fe-aW-_vdx1HS#qE+I)EQw548u z0*`wD&tjuBt318RK9oO{6=iWh@TU^f*Uh}x)Hn+xP^h5;iBj`gel3Hts0M0QNKN6G z8ZM3W;E6`+kzPxvM;YodYx&`N-cA6zW4D^=d;SOa+~00J80JTK@M+Fh+4Iz2Q%u@L zL2ac)=;o~?NNQC%3dVg)w_7X;FSvrKLWGX7yphF+k#+X%${MD$@`55WNrYa`Rn|~Y zZkSD$R6_v~dbzP-W*t_p>o-615>f=sy8^L zk7jV!YPP_ik@h_w+Rw|0r)|FPf7Ip@Z2EgU?M>h^Z1vUN7J?F(e)Yx;1Gf9;dRwfY z>9u)m#I|AkS$ag35R~a{acRUU4>|IPqr;*#_|U+Gy{|HUoeAiPwfl z?Sbb!K6hCrZz<;}Ynj!&nN#qQr$>PvMMayf-Naq(C-(S$2a88yz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XN3R)6cG4jJ@X^~K&^@M<)h=P`d z);R&4i-ZcTCk6Cm6jT>l=LK{=5-PNw63|moP(x@vEug0(p+f6|fG$KqD?;lV0{TWI zRA_xuK;Mjlt_ZDf3FupqP@(mVfS&n2s8(GtZZ%p`KegAv4~+w=b@u{7MFOi?NMwl+ zl4T^YB88HDB1n?n>m>32Wd}Bvl_4b&HIl`U!s0NLk*%vE85zSAAIiwu(nv<;Fj0px zvUiPS(|aAPu6QFK*qCsF#yc75BRSs82R5dTkmHvW(noTYXiNej&j$37e3@trXCdDY z=p%WsVhl_n$IIlv*2m+(s=A6`99Go*UnH6iT^yL R|K89M;$64Fh697k{{=@~V@v=5 literal 0 HcmV?d00001 diff --git a/tests/acpi-test-data/q35/DSDT.ipmibt b/tests/acpi-test-data/q35/DSDT.ipmibt new file mode 100644 index 0000000000000000000000000000000000000000..74fc9b69204df80de3855657d3a4ff74e0eb964c GIT binary patch literal 8432 zcmb7JO>Y~=8J;C6YBeOKrL>miub5Daq)F>UvK%M<3QR6PZLYK?X(s^WElwOO1GWr}L1hr}JHB#3^_injV>p7W3%IV(Aa2uPF z>;I%&x>9rgwAuf>-@o;7-&v2v#uwg$jrI7$Px>2zK({wyDXHN-+iRD4-MdlH?l>9o zrOa}>{nt6C=WGODAgU>$Wyc(c%SXubUwh5WkxR#=0DrfIMwaZ!I;3*|1hh1sl@W` zn_lQDJr%beRXSRa0~HuQ&Tc*Ggd!`%*WYDCs(a6)c8;)iR2NIAFaY-oSn_0j1sTXTr5B z`^1^KQKBm+7KKN^SD>^TPH$O=cJ``($YC; z>qKbkbS<5(rPH-_A~bbkvN6syZa#JP_+(DmIuV*WrKM9^I;E`>p{X-t>C9Ls+W9vj{>hvs~ zo~6^Xbs{u%<}IChOK0BJiO|$JYw4V|bk5p35t=&ZES+GUm~zO56X zsq=`X^N6MMh^-T$sdL`aIdAElw{;>kbsn{J9<_8HwRIvibuL&s7c89%woZhm&ST6h z4rjt+%q$HjyJLzO9E8Ly53$EB=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4$%dg0#`#%;UixX)7zS~nj-8&5T@Jd2NIgPZ&8 zhsD>1*yCu{6@mD`)ek<;jn6iyufPsU(vmvb>eEQX+j1n$VmEci5cAfO;`iro%BM zr-Lz#lMW595YhIV=g;{+45QaVXY>NZ=#(5=kGbBg$)+6}Y4q@tJA?x$*3RJ)Se1!{-)X)0e)yDAodv%}K76iYr;nv}o$ zBqtL1>rWShHduIjlzo(ST=YBYf_;m_kFxu5jxXJR%?m1VA?bCOehI-x_+=X5S9^PZ z`Hl~WuU?@Ax*&z~q?Uq59)0RJ9(Y>nD$0ynQp`zNa|-D~+QBNH_v|&y7VVYZY&zwj z5ZdQ@vu;WzFcVVrA|0Wk-p>ytcekIfz8Wa+$X%|4S8$2W5_+VHH{ne>6E{ z?)IhB^YqsvYE|0$B|zfc2e1CQAi7ehkIhx%Nx#W{lXVKvk5_(LHUB0n3*CEJ4rubd z;B`M-2_oDq{KGn3SnP;hn)+$cj#iBkv^&Dj^>8mb2r3uFrk|$?Hi0R3Q+!19n=Z}V zvq{InTJ^Pq)molzdEzwAC;p~Lu|R{WM_~&~`BE-)@13R~Nz+7uCJk(w)M}!Irw5}x zMS!BXAbH}$V~OdMXHPs0SpPqw_?T=9^dMo=4hnvnX555VO{vxDOnYew%bK+I-`#$$ fz4WpQaHlx}F9+@AGG=&coYjpLZlt4NwIluy>u}v_ literal 0 HcmV?d00001 diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 0352814..6de4e13 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -50,6 +50,8 @@ typedef struct { GArray *tables; uint32_t smbios_ep_addr; struct smbios_21_entry_point smbios_ep_table; + uint8_t *required_struct_types; + int required_struct_types_len; } test_data; #define ACPI_READ_FIELD(field, addr) \ @@ -335,7 +337,7 @@ static void test_acpi_tables(test_data *data) for (i = 0; i < tables_nr; i++) { AcpiSdtTable ssdt_table; - memset(&ssdt_table, 0 , sizeof(ssdt_table)); + memset(&ssdt_table, 0, sizeof(ssdt_table)); uint32_t addr = data->rsdt_tables_addr[i + 1]; /* fadt is first */ test_dst_table(&ssdt_table, addr); g_array_append_val(data->tables, ssdt_table); @@ -654,7 +656,6 @@ static void test_smbios_structs(test_data *data) uint32_t addr = ep_table->structure_table_address; int i, len, max_len = 0; uint8_t type, prv, crt; - uint8_t required_struct_types[] = {0, 1, 3, 4, 16, 17, 19, 32, 127}; /* walk the smbios tables */ for (i = 0; i < ep_table->number_of_structures; i++) { @@ -694,8 +695,8 @@ static void test_smbios_structs(test_data *data) g_assert_cmpuint(ep_table->max_structure_size, ==, max_len); /* required struct types must all be present */ - for (i = 0; i < ARRAY_SIZE(required_struct_types); i++) { - g_assert(test_bit(required_struct_types[i], struct_bitmap)); + for (i = 0; i < data->required_struct_types_len; i++) { + g_assert(test_bit(data->required_struct_types[i], struct_bitmap)); } } @@ -735,6 +736,10 @@ static void test_acpi_one(const char *params, test_data *data) g_free(args); } +static uint8_t base_required_struct_types[] = { + 0, 1, 3, 4, 16, 17, 19, 32, 127 +}; + static void test_acpi_piix4_tcg(void) { test_data data; @@ -744,6 +749,8 @@ static void test_acpi_piix4_tcg(void) */ memset(&data, 0, sizeof(data)); data.machine = MACHINE_PC; + data.required_struct_types = base_required_struct_types; + data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); test_acpi_one("-machine accel=tcg", &data); free_test_data(&data); } @@ -755,6 +762,8 @@ static void test_acpi_piix4_tcg_bridge(void) memset(&data, 0, sizeof(data)); data.machine = MACHINE_PC; data.variant = ".bridge"; + data.required_struct_types = base_required_struct_types; + data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); test_acpi_one("-machine accel=tcg -device pci-bridge,chassis_nr=1", &data); free_test_data(&data); } @@ -765,6 +774,8 @@ static void test_acpi_q35_tcg(void) memset(&data, 0, sizeof(data)); data.machine = MACHINE_Q35; + data.required_struct_types = base_required_struct_types; + data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); test_acpi_one("-machine q35,accel=tcg", &data); free_test_data(&data); } @@ -776,11 +787,50 @@ static void test_acpi_q35_tcg_bridge(void) memset(&data, 0, sizeof(data)); data.machine = MACHINE_Q35; data.variant = ".bridge"; + data.required_struct_types = base_required_struct_types; + data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); test_acpi_one("-machine q35,accel=tcg -device pci-bridge,chassis_nr=1", &data); free_test_data(&data); } +static uint8_t ipmi_required_struct_types[] = { + 0, 1, 3, 4, 16, 17, 19, 32, 38, 127 +}; + +static void test_acpi_q35_tcg_ipmi(void) +{ + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = MACHINE_Q35; + data.variant = ".ipmibt"; + data.required_struct_types = ipmi_required_struct_types; + data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types); + test_acpi_one("-machine q35,accel=tcg -device ipmi-bmc-sim,id=bmc0" + " -device isa-ipmi-bt,bmc=bmc0", + &data); + free_test_data(&data); +} + +static void test_acpi_piix4_tcg_ipmi(void) +{ + test_data data; + + /* Supplying -machine accel argument overrides the default (qtest). + * This is to make guest actually run. + */ + memset(&data, 0, sizeof(data)); + data.machine = MACHINE_PC; + data.variant = ".ipmikcs"; + data.required_struct_types = ipmi_required_struct_types; + data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types); + test_acpi_one("-machine accel=tcg -device ipmi-bmc-sim,id=bmc0" + " -device isa-ipmi-kcs,irq=0,bmc=bmc0", + &data); + free_test_data(&data); +} + int main(int argc, char *argv[]) { const char *arch = qtest_get_arch(); @@ -797,6 +847,8 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/piix4/tcg/bridge", test_acpi_piix4_tcg_bridge); qtest_add_func("acpi/q35/tcg", test_acpi_q35_tcg); qtest_add_func("acpi/q35/tcg/bridge", test_acpi_q35_tcg_bridge); + qtest_add_func("acpi/piix4/tcg/ipmi", test_acpi_piix4_tcg_ipmi); + qtest_add_func("acpi/q35/tcg/ipmi", test_acpi_q35_tcg_ipmi); } ret = g_test_run(); boot_sector_cleanup(disk);