From nobody Sun May 19 08:30:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1640633741; cv=none; d=zohomail.com; s=zohoarc; b=FpvgTHGChEnE0cFnZXD6oDqm/QLnPbr+qv71qbCFKPMNA9sak8s/C/Cr3xMgZ0GjHmsrn6OtL3/fVAj+UtzZuHp6CuL+/+Acn+7DQV59QANCv91HgZkOBgk92uRz0s3WqGh3u8jYqeD5kcsHXdPyhWlH3DpH++MPNHdxBjNc0iE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640633741; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7waZA+pYw3jXrMhW063V3gWHhMqeP7udpsHgl8NTfU0=; b=XCxvlqHZVkIYfBRDE2DXfsgnQwrNTCySRQnp9kDM1KA7u25d3bkSu54OkEBmKO76Txkv+/xmjz3OJ6tRab3pDxSeo7ZwyIZ+fX9OkFphHaJDDsR3I5Vr05Lp/ukZCnAhVuUY8zxlCKe6kW0jvx9WYM+BIhjaMep66Ui/vHYZ4KE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1640633741838134.79551870493174; Mon, 27 Dec 2021 11:35:41 -0800 (PST) Received: from localhost ([::1]:44144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1vmW-0006Dq-Mc for importer@patchew.org; Mon, 27 Dec 2021 14:35:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1via-0003Jf-QO for qemu-devel@nongnu.org; Mon, 27 Dec 2021 14:31:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29805) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1viZ-00059q-2l for qemu-devel@nongnu.org; Mon, 27 Dec 2021 14:31:36 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-362-w3SJKeHANKuA0j_bpoKYtQ-1; Mon, 27 Dec 2021 14:31:30 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 77EF8102CC42; Mon, 27 Dec 2021 19:31:29 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9426E60BF4; Mon, 27 Dec 2021 19:31:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640633494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7waZA+pYw3jXrMhW063V3gWHhMqeP7udpsHgl8NTfU0=; b=Mm0ISbYeQT14soG8f4GX4K6B6XBHR8s8mCwbMt8k+thQ7CQmBylYor2iao7WbaK+MLAkxj zr0DaRaZLDiT2N+YuDvNhXA7UGuAwbON50GHjcsvHWmIjjQwvcQAXp3+YrOOiZB2f2TXXb LvIxsFhRs8UGyTSS2u51ttPY1zxTThQ= X-MC-Unique: w3SJKeHANKuA0j_bpoKYtQ-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH 1/4] acpi: fix QEMU crash when started with SLIC table Date: Mon, 27 Dec 2021 14:31:17 -0500 Message-Id: <20211227193120.1084176-2-imammedo@redhat.com> In-Reply-To: <20211227193120.1084176-1-imammedo@redhat.com> References: <20211227193120.1084176-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.575, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dlenski@gmail.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1640633744678000002 Content-Type: text/plain; charset="utf-8" if QEMU is started with used provided SLIC table blob, -acpitable sig=3DSLIC,oem_id=3D'CRASH ',oem_table_id=3D"ME",oem_rev=3D000= 02210,asl_compiler_id=3D"",asl_compiler_rev=3D00000000,data=3D/dev/null it will assert with: hw/acpi/aml-build.c:61:build_append_padded_str: assertion failed: (len <= =3D maxlen) and following backtrace: ... build_append_padded_str (array=3D0x555556afe320, str=3D0x555556afdb2e "CR= ASH ME", maxlen=3D0x6, pad=3D0x20) at hw/acpi/aml-build.c:61 acpi_table_begin (desc=3D0x7fffffffd1b0, array=3D0x555556afe320) at hw/ac= pi/aml-build.c:1727 build_fadt (tbl=3D0x555556afe320, linker=3D0x555557ca3830, f=3D0x7fffffff= d318, oem_id=3D0x555556afdb2e "CRASH ME", oem_table_id=3D0x555556afdb34 "ME= ") at hw/acpi/aml-build.c:2064 ... which happens due to acpi_table_begin() expecting NULL terminated oem_id and oem_table_id strings, which is normally the case, but in case of user provided SLIC table, oem_id points to table's blob directly and as result oem_id became longer than expected. Fix issue by handling oem_id consistently and make acpi_get_slic_oem() return NULL terminated strings. PS: After [1] refactoring, oem_id semantics became inconsistent, where NULL terminated string was coming from machine and old way pointer into byte array coming from -acpitable option. That used to work since build_header() wasn't expecting NULL terminated string and blindly copied the 1st 6 bytes only. However commit [2] broke that by replacing build_header() with acpi_table_begin(), which was expecting NULL terminated string and was checking oem_id size. 1) 602b45820 ("acpi: Permit OEM ID and OEM table ID fields to be changed") 2) Fixes: 4b56e1e4eb08 ("acpi: build_fadt: use acpi_table_begin()/acpi_table_e= nd() instead of build_header()") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/786 Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Alexander Tsoy Tested-by: Denis Lisov --- hw/acpi/core.c | 4 ++-- hw/i386/acpi-build.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 1e004d0078..3e811bf03c 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -345,8 +345,8 @@ int acpi_get_slic_oem(AcpiSlicOem *oem) struct acpi_table_header *hdr =3D (void *)(u - sizeof(hdr->_length= )); =20 if (memcmp(hdr->sig, "SLIC", 4) =3D=3D 0) { - oem->id =3D hdr->oem_id; - oem->table_id =3D hdr->oem_table_id; + oem->id =3D g_strndup(hdr->oem_id, 6); + oem->table_id =3D g_strndup(hdr->oem_table_id, 8); return 0; } } diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 8383b83ee3..0234fe7588 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2723,6 +2723,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState= *machine) =20 /* Cleanup memory that's no longer used. */ g_array_free(table_offsets, true); + g_free(slic_oem.id); + g_free(slic_oem.table_id); } =20 static void acpi_ram_update(MemoryRegion *mr, GArray *data) --=20 2.31.1 From nobody Sun May 19 08:30:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1640633742; cv=none; d=zohomail.com; s=zohoarc; b=SPIFo+qYw1FsNPF7ps5O3TVB4zYCAjIVG4GsMRkvCNhOE6/FCHt3Vo+Ph0FG8oHY3TkMLUcqNl38hXQPEz6utTpf9Y2IxD9x3Z6KX63IKlbPeR+TPY0/lfrBho4tYGfdV2G1a/EvcbsRM8Pzn9FK9G47NxYmrq0emkn8stMAM4A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640633742; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IohRrLv2IciQtMjeHPn1umJe1KHZbSz98hmfga1wT/Q=; b=fvkrM5loq2aUzCxaXSScNYKnvYwndIfKp78lUp6EezTQ4iCD3+Ke9MFHHnSThhHM9kUQPhUaqQGA4t44DEj5jIS4YfgWTAdbpjMPHDOVrwS/xvxqpjlnStnIRMPM1oTyFQ038qzb94xoTFohSm9LcFCFtfH0iD40s0SzxW7gTxc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1640633742283694.8871220720852; Mon, 27 Dec 2021 11:35:42 -0800 (PST) Received: from localhost ([::1]:44036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1vmX-0006AQ-0M for importer@patchew.org; Mon, 27 Dec 2021 14:35:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1via-0003J7-2g for qemu-devel@nongnu.org; Mon, 27 Dec 2021 14:31:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:25528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1viX-00058X-Cd for qemu-devel@nongnu.org; Mon, 27 Dec 2021 14:31:34 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-625-RAipG4w8Pnaom025TlrFbg-1; Mon, 27 Dec 2021 14:31:31 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A3A918397BF; Mon, 27 Dec 2021 19:31:30 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5CC260BF4; Mon, 27 Dec 2021 19:31:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640633492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IohRrLv2IciQtMjeHPn1umJe1KHZbSz98hmfga1wT/Q=; b=QRtEy9b9ZnWn2LsXH8kAP5+KvEkyAvZ5PpzBHp1KvoP+HqopVarwojp3nqKFKU+3KN4clY bWuOtQ7K2NHIqUgWENNUntsLwK0n0v3jh3y3y3F6wsRLYYSdrPvnBvILla8tIpKuxSi7Wh yNiaik8xtxp/cNI6iqIvdF7HmVlOFW0= X-MC-Unique: RAipG4w8Pnaom025TlrFbg-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH 2/4] tests: acpi: whitelist expected blobs before changing them Date: Mon, 27 Dec 2021 14:31:18 -0500 Message-Id: <20211227193120.1084176-3-imammedo@redhat.com> In-Reply-To: <20211227193120.1084176-1-imammedo@redhat.com> References: <20211227193120.1084176-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.575, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dlenski@gmail.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1640633744676000001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 2 ++ tests/data/acpi/q35/FACP.slic | Bin 0 -> 244 bytes tests/data/acpi/q35/SLIC.slic | 0 3 files changed, 2 insertions(+) create mode 100644 tests/data/acpi/q35/FACP.slic create mode 100644 tests/data/acpi/q35/SLIC.slic diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..49dbf8fa3e 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,3 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/FACP.slic", +"tests/data/acpi/q35/SLIC.slic", diff --git a/tests/data/acpi/q35/FACP.slic b/tests/data/acpi/q35/FACP.slic new file mode 100644 index 0000000000000000000000000000000000000000..f6a864cc863c7763f6c09d3814a= d184a658fa0a0 GIT binary patch literal 244 zcmZ>BbPo8!z`($~)5+i2BUr&HBEVSz2pEB4AU24G0Y(N+hD|^Y6El!tgNU*~X%LSC z$X0-fGcm9T0LA|E|L2FOWMD7?GM2V5Ffej3F#P0!h{7ddihwku0+2v57svwxMxcSn X_QAxFX+{NzJ3wNL4G8yu_%Hwf>-7!+ literal 0 HcmV?d00001 diff --git a/tests/data/acpi/q35/SLIC.slic b/tests/data/acpi/q35/SLIC.slic new file mode 100644 index 0000000000..e69de29bb2 --=20 2.31.1 From nobody Sun May 19 08:30:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1640633950; cv=none; d=zohomail.com; s=zohoarc; b=hhzUsyjQF6Jm/eBZT1NqPTb5Hqo70uc04p+OSFAQv6CR6dPaOSww5NmJdAdu+64pDF+UiTLSLwhA04gfly1hP+NWq17KCdC7gF3ugmAYdFJNL15XYlts3/squDKersxeWmO60D0I+6YkEvBJVX6Eu1JeKe7iixqnpioZuitnupI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640633950; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Z1Jrlzv+VyTzFZ5GrX5k7LoGumWAwouAPtyADK6iv84=; b=PvYtLkMst8wS/6YHiOgfPiWQ8zF+tjkJrCSyRYQtYgvMAzyDCqnMMxO36SUn8TPaY9q5MAm1V5G5DrxpH49dsFvieBno0KstB+IfpnIGcGhKQUU+ghnuBrl0sBGCeG1gORrvHErLHjAJdO5wKmXM9P/7151pZs/HywZ0283+Rhc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1640633950801916.5939746873672; Mon, 27 Dec 2021 11:39:10 -0800 (PST) Received: from localhost ([::1]:50440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1vpu-0002Fe-1f for importer@patchew.org; Mon, 27 Dec 2021 14:39:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1via-0003Je-IP for qemu-devel@nongnu.org; Mon, 27 Dec 2021 14:31:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:23955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1viY-00059p-LC for qemu-devel@nongnu.org; Mon, 27 Dec 2021 14:31:36 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-125-SpbPUgwPMy63BuW1l9QKzQ-1; Mon, 27 Dec 2021 14:31:33 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A8BC12F25; Mon, 27 Dec 2021 19:31:31 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4C9960BF4; Mon, 27 Dec 2021 19:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640633494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z1Jrlzv+VyTzFZ5GrX5k7LoGumWAwouAPtyADK6iv84=; b=N9l5bcE/dXXDxotFZjn0R3T4VeFZm69AZ0VeB3mL1ABFURUJiGWuF1ZhWOntRZKzv0VKob K+J42R+vvKYqNPwSmreCJQpmoPl8Sh25AylWf+cGPbRCSagFvu2XdiF2o4LXU+Draq4xJM WeJ1wg0MninHTfiVQ82sOhIcV36TNHk= X-MC-Unique: SpbPUgwPMy63BuW1l9QKzQ-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH 3/4] tests: acpi: add SLIC table test Date: Mon, 27 Dec 2021 14:31:19 -0500 Message-Id: <20211227193120.1084176-4-imammedo@redhat.com> In-Reply-To: <20211227193120.1084176-1-imammedo@redhat.com> References: <20211227193120.1084176-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.575, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dlenski@gmail.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1640633951968000002 Content-Type: text/plain; charset="utf-8" When user uses '-acpitable' to add SLIC table, some ACPI tables (FADT) will change its 'Oem ID'/'Oem Table ID' fields to match that of SLIC. Test makes sure thati QEMU handles those fields correctly when SLIC table is added with '-acpitable' option. Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 9a468e29eb..e6b72d9026 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1502,6 +1502,20 @@ static void test_acpi_virt_viot(void) free_test_data(&data); } =20 +static void test_acpi_q35_slic(void) +{ + test_data data =3D { + .machine =3D MACHINE_Q35, + .variant =3D ".slic", + }; + + test_acpi_one("-acpitable sig=3DSLIC,oem_id=3D'CRASH ',oem_table_id=3D= 'ME'," + "oem_rev=3D00002210,asl_compiler_id=3D'qemu'," + "asl_compiler_rev=3D00000000,data=3D/dev/null", + &data); + free_test_data(&data); +} + static void test_oem_fields(test_data *data) { int i; @@ -1677,6 +1691,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar); } qtest_add_func("acpi/q35/viot", test_acpi_q35_viot); + qtest_add_func("acpi/q35/slic", test_acpi_q35_slic); } else if (strcmp(arch, "aarch64") =3D=3D 0) { if (has_tcg) { qtest_add_func("acpi/virt", test_acpi_virt_tcg); --=20 2.31.1 From nobody Sun May 19 08:30:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1640634147; cv=none; d=zohomail.com; s=zohoarc; b=BjUsA2lXLxR8ZxnMvHUvffJHiaZyndFpz8T1Ilo4xbzPtD6rI9EKAoo7We+4nCyjQxNjhXYxo9BHOrNRaNPpQvkEwaORdCbi/tXJXpxVmNMN6YuiJX1Y1zi579h1JVa02sSb6Xtot8HiFBncUVpRJp1SvoAUbtxSLeDjvSZg9zA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640634147; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QBYUK7VxZy9M2kaoqYbflC51sHliXuuRV4MPHXaCvsY=; b=S+bRvSavsllnvyX4FHiYx7BOwYUtXjvZmjrEsOCmW9r37pwtvgVMPCXNFkBYY5XHAZ0l4jYXA9r7tX4tkyCboQ0Ot7Z4DOFZ0ZuljDK6QZEk4n81pdfpb8U8rF1rKKT5FygQAPaICJ/2sObw9KIfeuUWqqDRs+7HMbIMGmhbOUY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1640634147883188.00424445454098; Mon, 27 Dec 2021 11:42:27 -0800 (PST) Received: from localhost ([::1]:54764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1vt4-0005IW-6E for importer@patchew.org; Mon, 27 Dec 2021 14:42:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1vib-0003Kh-H9 for qemu-devel@nongnu.org; Mon, 27 Dec 2021 14:31:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25020) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1viZ-0005A9-QG for qemu-devel@nongnu.org; Mon, 27 Dec 2021 14:31:37 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-424-ccir3uLSPA2n2t7FHVDlzg-1; Mon, 27 Dec 2021 14:31:33 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7E25102CC43; Mon, 27 Dec 2021 19:31:32 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3A3B60BF4; Mon, 27 Dec 2021 19:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640633495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QBYUK7VxZy9M2kaoqYbflC51sHliXuuRV4MPHXaCvsY=; b=FYRkUxOTJuJadjETQL5gFEiF0WnRvRazQaU9hIMb3lzVqmtDZ7jfCmfBZUc3U5VWWygbaf Aejr/GiorP91pgsz2c9xcdMK7UpuVK7VVepAe+NrpBW6T2zmKoj17OwuG92kOkwrb1AkaD 0pwGcsKhPszOn/BVRG40w9aYzaaXSC0= X-MC-Unique: ccir3uLSPA2n2t7FHVDlzg-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH 4/4] tests: acpi: SLIC: update expected blobs Date: Mon, 27 Dec 2021 14:31:20 -0500 Message-Id: <20211227193120.1084176-5-imammedo@redhat.com> In-Reply-To: <20211227193120.1084176-1-imammedo@redhat.com> References: <20211227193120.1084176-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.575, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dlenski@gmail.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1640634149765000001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 2 -- tests/data/acpi/q35/FACP.slic | Bin 244 -> 244 bytes tests/data/acpi/q35/SLIC.slic | Bin 0 -> 36 bytes 3 files changed, 2 deletions(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index 49dbf8fa3e..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,3 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/q35/FACP.slic", -"tests/data/acpi/q35/SLIC.slic", diff --git a/tests/data/acpi/q35/FACP.slic b/tests/data/acpi/q35/FACP.slic index f6a864cc863c7763f6c09d3814ad184a658fa0a0..891fd4b784b7b6b3ea303976db7= ecd5b669bc84b 100644 GIT binary patch delta 28 jcmeyu_=3DQo#&CxmF3j+fKvygL;W3Y#Uud9N>M3Dyoc<=3D}c delta 28 jcmeyu_=3DQo#&CxmF3j+fK^G+v!XOCb7r-%UOi6RdGgN+Fa diff --git a/tests/data/acpi/q35/SLIC.slic b/tests/data/acpi/q35/SLIC.slic index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..fd26592e2480c5d02a018e0d855= a04106661a7b5 100644 GIT binary patch literal 36 mcmWIc@pM*UU|?YMbPjS1_E7M31#*C(gN1>iFg3Rn#0CI%)&>Cp literal 0 HcmV?d00001 --=20 2.31.1