From patchwork Wed May 11 16:38:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 9073021 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8779FBF29F for ; Wed, 11 May 2016 16:39:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3DB8200E7 for ; Wed, 11 May 2016 16:39:26 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 6AD1A200E6 for ; Wed, 11 May 2016 16:39:25 +0000 (UTC) Received: from localhost ([::1]:53196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0XAS-00052h-I8 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 11 May 2016 12:39:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0XAF-0004pK-2i for qemu-devel@nongnu.org; Wed, 11 May 2016 12:39:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0XA7-0002BV-KM for qemu-devel@nongnu.org; Wed, 11 May 2016 12:39:09 -0400 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]:36385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0XA7-0002BJ-Ai for qemu-devel@nongnu.org; Wed, 11 May 2016 12:39:03 -0400 Received: by mail-pa0-x242.google.com with SMTP id i5so3946599pag.3 for ; Wed, 11 May 2016 09:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=hXUnusIFWqfS4lSfjgLY5gvBE/O8sBGMHRwUv/woq9U=; b=VhxYETZJ8AkBPNpb+ijlArH5dpDIH0DJwKO2ZnxJ/Qv3PUWbeHmdIl6xtwhqVXhSMu Ny9Lm+4WNVsYp4nMDGagiZ0OfjZmefSfQMe9MdUrYCdMfWp26xIOYUKsQ7fSM7SoMEOh 5SWFHLtS6vn11eEwK+CtqKYo3Za56ZFHlmJEIo2oRv5q9iY0pvkZGUhMOdYLpr6mBTnz ZvCA2iMnlMgbrv3YWDj8X8Rx3m3CMTpfz1MiUBkKa8sDD9aS6zNZiVv67bQ9J20iDGcE d0YSTPoCPCzAuoQ7Q/si0L8kT2/7IleOgSro7zQRj8z63LrcmHbnwa0B2UbIIWvAcT+y aZfg== 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:cc:subject:date:message-id :in-reply-to:references; bh=hXUnusIFWqfS4lSfjgLY5gvBE/O8sBGMHRwUv/woq9U=; b=NbaDZxRL36VymdJccQBp1pkM7myP7w9BufxNt93xuOCW2rOSvDvckh9VrRz9+TPTTD mSuD6IhraSt2yMbQK48kxfRhmYlCTBNYKMfcYdF1lX79QOMC3Vcrm/xWeJFi7f3hd6cC ir3HN710uZvo30teWPN+9+R90qBJG41OE/PZDyLbOaIYE3iRBl14NfvCThhmSJGFKKf+ vhMmym1eNVBz1xoEtqaZQfbo/O9e4aOrDk4MtSuxevZe/efHt/610w8XyvCP48BuUl+8 ZFXCjTeHryfB0J1y37F4glN1ZYNoxi4AnrMkYx2p0lDoTzouFdyD59lgrTxtGQtXu01n 8KPg== X-Gm-Message-State: AOPr4FWIoRr8rnOL/3t4+scTgsNhvw2rXLCmeN/d8MdMpDDBv2v2jKr+5rZAjmYJ0HPg+g== X-Received: by 10.66.237.66 with SMTP id va2mr6401987pac.2.1462984742618; Wed, 11 May 2016 09:39:02 -0700 (PDT) Received: from serve.minyard.net ([108.19.215.157]) by smtp.gmail.com with ESMTPSA id ym8sm13394265pab.22.2016.05.11.09.38.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2016 09:38:59 -0700 (PDT) Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:a430:dab6:589a:a3a1]) by serve.minyard.net (Postfix) with ESMTPA id 5964219A4; Wed, 11 May 2016 11:38:58 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id ACBFB30054B; Wed, 11 May 2016 11:38:56 -0500 (CDT) From: minyard@acm.org To: Igor Mammedov , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org, minyard@acm.org Date: Wed, 11 May 2016 11:38:54 -0500 Message-Id: <1462984734-23803-6-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462984734-23803-1-git-send-email-minyard@acm.org> References: <1462984734-23803-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:400e:c03::242 Subject: [Qemu-devel] [PATCH v2 5/5] 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: , Cc: Corey Minyard Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Corey Minyard Signed-off-by: Corey Minyard --- tests/acpi-test-data/pc/DSDT.ipmikcs | Bin 0 -> 5683 bytes tests/acpi-test-data/q35/DSDT.ipmibt | Bin 0 -> 8456 bytes tests/bios-tables-test.c | 58 ++++++++++++++++++++++++++++++++--- 3 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 tests/acpi-test-data/pc/DSDT.ipmikcs create mode 100644 tests/acpi-test-data/q35/DSDT.ipmibt diff --git a/tests/acpi-test-data/pc/DSDT.ipmikcs b/tests/acpi-test-data/pc/DSDT.ipmikcs new file mode 100644 index 0000000000000000000000000000000000000000..280aeb3059eb9220108b9a2b7f0ac07819023b06 GIT binary patch literal 5683 zcmb7IUvC@75ud#yrQ?#6j?!6{?Kmc6J8sh2<{w*j(4r7|M~Req)R{-QF3#v3B^jmL zq&_Gy5Jd}jr|mL=8j9Tat?3_@OEeBw==W5 zGqZbV*hZ^32f+STUel{~wtU;t4dgKZpgy%~Ep`W-J)^whvZNGa&ckHT$46Pweqxl@ zSJ^p$eX`N^KY#3P0D&HC_?%NmU2yHP>vT_9dM&58)tZqiea&UX zEg4Nv-1VBlR8t8t6{TubS^~rngkp4~YPC#A0et;^5@OCnmFU@9m4=bEnueRz7G1kl z0-rdZPptN*9#_47>Z_gyJui81Fo6ElSG_j;v7Lf{{U<(v0iRY}y=iAMd}=>|Ge+eQ z1K0ue{3Y^++;zGqtlRlw;A=_-hOSuoqAmeHP?zFkFg;eYOKyn6g(cjToGx*Xqr30? z>Jn+8kpR`pFj==M4F=ai)=Sip^)fc9e&(_)43jped$HNlQE9kjNn9-Qcb*?xVLtev zN(;bN*fwl~G_eCt_u7rJF@npomIzj5G|^z72OcmSwFO()E=V|Er+dL%TOSRao;^BH z;qe7f30P8=4SlqUlS7YA@%a_@t^BPFu@&}Geu)dUumtbL0^RxLx>XXJy=>HGvMTU6 zU*kE(UvP<^$NvmJ#Si!g{5w9)6~$dPDw*S4qc9x*Nk}-|pVzI{$k!NX^WoOhl6w6K z-0lH9jg984^7IP(ME*opl!d*(pGr($GxK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S zM>NW{GjxZtyq?gf*ReDES?aGTCgBUL;?|b&hQKtAFRQm;kOb+!4tZ%z 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..6704538dee7dcfade6a1dc74eda5b8b832d7c6a2 GIT binary patch literal 8456 zcmb7KO>Y~=8J;C6YBeOKrL>l1$BtFCNSd@xWXo~VPncYO+FWT((oO;z;7X2LxoMh( z;s8mE0JZ|;!-oQi>Y%;RfzJ60&9TSa8la~FMGw6eMSP0-yzg+N8PWn`9d_rPeV+H7 zXFujy?x@nKblo2a;k3(ZL8G%+ekBSj=yQY+)TX`H%v=+_JC$<1@8nV$r*}8UZEVV} z|IA-ddia+x0x+Ww+mGR`R8z3?9^-<~>g;q#YomA?Ab-+y!Ob(sO+ zEcPz;D+vXZhZ-xC>NaiUN!kv)&vtG)@8ifBMxPnXf3~A>s@tQ334y8qL06^cVf}{Z6+e66%Q) z>RNvx_f4UQkojA9*w<`wIpYE)SKdtA*KmRweD|Y1!&Q`lqEXwH*r*I*WTx5iJ zS9ljDpQGW>sqJkC*=DEI=hKM+oWfwDX8UqV#&mgFxF1sTj!gCL9;3Dh*1}R+IM|i3 zYen5kic!^++$Pi!psFG$Rac#$j7=-T#=CIz`LwP`)q2~f+uZ;~)pgC`I?_lN^>6`^8J;%04`u_NVxK>`P=~EMnn+^_qAM`=u0=_O_o6*RJdn zXXZwUuAEpB9sz$1E&ITX@E6n>r}4*wEY9+-c#zpI=*dFec_;l&+I5%iaG`1j=j4o5 zG~uW_Q>UR5a#)&&>4$0IE_s}$MrqEDq>-upJUFL^=1DzFA&-kZZqy8F!q4}ycalwt zyg$C`&?WGK|L`LfwY$;mrMK?P<}$c@L~Hd@Rj9Uuc1_IYsb8iL)OCQZA%mkE~2#JZ&FgDFhJp#J_I4eWbiV3I= ziK(mLzE@bzlVPTYW)xEo9-*mo!qPdxObwk-Og(snrp~O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72VRIe>>L*m04kwhH4kk2C zIyAgOMB8tkKj;4_j9v+y(F>5Ew|{V%ejKiKx|uQ1&2X)HHTfM51}de$6jm=Tr^bK| zx`zYs%CcXN)I3)x1yOT(8MibZ=+^SG+MN-;*RL+071z{rfalIXhK?0+?fHye38SZi zZe=E(Q^Xh4ZkX*w6}_Z(KU2Gs+LhHVP&>R&Q~9de)v#)tAC~6zQ(9dsPs%@hTo5Vz z^rwqK8?2T+%s&6lOw-UZ5jX)ceJOmBmy5l-c@Ajuz2Nme zSP3HBEc}Ocy0Fw0yEOIFq8%;uBItC5U+CjrbP!Z8icP;r6Ko1o?xy&V=r>)Oxo6Xk zg9YYm2TQCx-SWg~oKO5rkz#=c)ri72*59RE=-oXoA`Xm8L z;)3Lf5053LQ=UEXG+@#Gh~i_iU8DyIn@+IkXKBVwd9{pMV$OAzm$9}=3--P3XFJO; zsQ`DHBk*$2Ia9$5PmQy>vBHgP6s&fISI!#R)bjCKCTvnlT0edY-`eOJv7_+jF;;+^HJogj_9b4?u8Q59Nc|sVisEVj literal 0 HcmV?d00001 diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 0352814..3b7689e 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,9 @@ 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 +748,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 +761,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 +773,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 +786,49 @@ 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 +845,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);