From patchwork Fri Jun 10 09:15:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 69752 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp195112qgf; Fri, 10 Jun 2016 02:25:09 -0700 (PDT) X-Received: by 10.55.172.73 with SMTP id v70mr748481qke.98.1465550709732; Fri, 10 Jun 2016 02:25:09 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v70si5774660qkv.221.2016.06.10.02.25.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 10 Jun 2016 02:25:09 -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]:39284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBIgf-0001yl-4N for patch@linaro.org; Fri, 10 Jun 2016 05:25:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBIXq-0003Oy-5I for qemu-devel@nongnu.org; Fri, 10 Jun 2016 05:16:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBIXh-0004kt-LN for qemu-devel@nongnu.org; Fri, 10 Jun 2016 05:16:01 -0400 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]:36557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBIXh-0004kl-Ev for qemu-devel@nongnu.org; Fri, 10 Jun 2016 05:15:53 -0400 Received: by mail-oi0-x241.google.com with SMTP id d132so12096371oig.3 for ; Fri, 10 Jun 2016 02:15:53 -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=IoAsuuoIV0rkZSvXcDpVWTz/644gXb0bT2VgazC98Oo=; b=GIGzcikVFqK/983mvT5oS0LmtmORvQO35Mp106Fi5b3XIC+Ftp0EBrIduFIyxbOaFX pZnzblmDm58KK3/mQKtot2NxvNF9LjZff2HJTg0A/NdiOW4Trp3weX1YHid2yQ1lT433 +ZIi52EUO90UWHUpJtAd2BELBynXrJlP/xyKMfi6zTZ53rSBJU3xpt+ABHvKGpK4GvBh PG6xN6agXlxgtYICGcl3SWUz31f1+5zCrnKHW9pXe9TYKAFD/7kHGIiirYj8yKbgEbU7 +PSfpKRnpjPNeH58ZH0eREjQ9Rv9u+GhshllvKEwRnqIE5hFypTPcjEZMrFyc8gMpXbS kqew== 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=IoAsuuoIV0rkZSvXcDpVWTz/644gXb0bT2VgazC98Oo=; b=DDf2hLVQLMN3pXUBdFYnoRegwOPyJLOMCYLZ3hvvUef6s8fcsrtGWbd5rKQN+pvtsS URO/EkOTcC9X586+fyYyQVteGRO/MGgb6BXUYKXTU5464gGQXozf05meknXGn0oDucp1 TJQMiFBrthp7X5+Q9ELIDfpwJMqRymtfv8loEDrPmcTjUKP2hM9fwl5GskIlgETTNuQD KRAYU3qTynxSmMJvOLr+/PgbzFJHqguRqwrUQIm7jWAw8hp8gY6mDgqgcortw6SQDxyD I/qWVhnO5vIhwndFPFOWCIcHtk2UFhVFGeaXVRsKhExioCT5kulxBArjO3EhfvlnzET9 7kCg== X-Gm-Message-State: ALyK8tI+OyycQYvIrmXphnwZ6cKdYuVUHb99eApBHcTAjBKoY8/tkZ4IQhJeWtuSKeNANA== X-Received: by 10.202.52.85 with SMTP id b82mr367304oia.158.1465550152780; Fri, 10 Jun 2016 02:15:52 -0700 (PDT) Received: from serve.minyard.net ([108.19.215.157]) by smtp.gmail.com with ESMTPSA id 97sm4794614ote.39.2016.06.10.02.15.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jun 2016 02:15:50 -0700 (PDT) Received: from t430.minyard.net (unknown [111.93.218.67]) by serve.minyard.net (Postfix) with ESMTPA id 1101BF8A; Fri, 10 Jun 2016 04:15:49 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id D8FF7301363; Fri, 10 Jun 2016 04:15:45 -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: Fri, 10 Jun 2016 04:15:43 -0500 Message-Id: <1465550143-12611-5-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1465550143-12611-1-git-send-email-minyard@acm.org> References: <1465550143-12611-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::241 Subject: [Qemu-devel] [PATCH v8 4/4] 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 -> 5575 bytes tests/acpi-test-data/q35/DSDT.ipmibt | Bin 0 -> 8340 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..f10cd9e296c942b66d6f2404f1a95fe5cc4a6796 GIT binary patch literal 5575 zcmb7I-ESMm5ud#yrQ?#6j?!6{?Ib4Tug0xye%Nw?7KO+=N~FxA&OFL>aYpYb$tcw( z^+Ab&$U*>_0Td^1DdVDjqg_7Re?s%tKITtI|AiDy{1kQOj!Ushu1E>+I3K^Ancbb4 z-J@X}t-qfDU|*Ei^s1dL-?elDWefm_reC!dy9ds`QC@LbQi?I>aWbIsQC75{8RhjA z_UDfGC(nETV~@3c*m$l!-DvwCJ@GbxKo2*3&WTVLT)XT#-7}V6%PDTPW~54Aa#?Xp zMiUfwy=E}gR6b|%B84iY$HG!8L< zT~IGvrD!Nzr+dn}n=b~jret6kij^P?vhB#bU!d=hl68AWUd+|3{ z$qJ1Gs9uA~x>ac~cnf5`M1-uD@khON?wTwdlQpM%rP_=eKc@-_V_@B z#}_~)U`bgv^wB0x4kJ3l=U3R*^4BuNR@k@lx42LXOK>?B*v>E4t&-U6WurEeRe{I( z8qYEQl1uyoerNa@e#qb9-|%U!DDJXR$(-aGrQ!HTLdNO-vTn6TvBp4~54WC{)ay^+ zb`RiLY&2(;r&rhq@&~e_EbIsIRATy?nHP&1XJG~kGqfR5W?sp!WKb5=z|1n4DI7Dy zrI8)n(MUVeD+%o=Lpx?IKb+6S1YkIJtC`;R-`#e9zxm# zY_g;pDu~g`jde5YuyS3$1=m3;#5AG z!CkA_0)Ix@_k3tSFDIV1`M&?C%_Z3I_jcMFz-8F%tG!JGC9wSJjavq6_0RVY|cZeR4*y+|Mahg~ZVPU7R5mB2{aINgj9H0GU3KDW0 zvz_BNiQiq&ro&pMASgU7;~F&^J|vp&2a;*(4ltmQ0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6#BxTX`+jjD#Hu!>hoG@;*gAJMzap3K{aA=Bt_S<~ z-JbgC-eI_hCoCe$X$-chnzLxuRrA?qMfbjd=CF4@EWSF#9!0YrhpkebNYrRjA~c$H zB2c4ANw%n)8pNf54-H6ch>)57`+-g zqbDFnZ}0JG`cb&n?xe;*H^Q~bmH4+f7^sx~Qiy9mF$Q$dJsg0?*F4{*xndACmX~ow z`$upStca^Grt~*Jy6Wjt^%~jXt-)V;$pTB0^7kL-L;`OWXkuuCZ+efikFt)7en(B- zw>bPLyC3Ix8vkQXuEeC$lQjJjf{*ZXI>N8^_Wtr69}r)?OyB;36mC@Ym3ibgr2hZA zvJ}#Vw1W?b-t$*!-C60)rc(|Ip?$VD>!xG^i!4Pi(Ge=@{o=9Y?)ItbD}l15+@(r* z8S{09&?D=YH{neLVNjVD!?go1Pr`=x{PIu8fSE4g&XN8SnY`a0dp?SY5)KL literal 0 HcmV?d00001 diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 16d11aa..92c90dd 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -49,6 +49,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) \ @@ -334,7 +336,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); @@ -661,7 +663,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++) { @@ -701,8 +702,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)); } } @@ -742,6 +743,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; @@ -751,6 +756,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); } @@ -762,6 +769,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); } @@ -772,6 +781,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); } @@ -783,11 +794,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(); @@ -804,6 +854,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);