On Thu, 13 Jan 2022, Dmitry V. Orekhov wrote:
> I can't apply the patch to the qemu-6.1.0 source code on my own.
> There is no acpi_table_begin function in the qemu-6.1.0 source code
> (hw/acpi/aml-buld.c).
>
Try the following patch :

>From 10620c384bf05f0a7561c1afd0ec8ad5af9b7c0f Mon Sep 17 00:00:00 2001
From: Ani Sinha <a...@anisinha.ca>
Date: Thu, 13 Jan 2022 15:48:16 +0530
Subject: [PATCH] acpi: fix OEM ID/OEM Table ID padding for qemu 6.1.1

Replace whitespace padding with '\0' padding in accordance with spec
and expectations of guest OS.

Signed-off-by: Ani Sinha <a...@anisinha.ca>
---
 hw/acpi/aml-build.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index d5103e6..0df053c 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -1703,9 +1703,9 @@ build_header(BIOSLinker *linker, GArray *table_data,
     h->length = cpu_to_le32(len);
     h->revision = rev;

-    strpadcpy((char *)h->oem_id, sizeof h->oem_id, oem_id, ' ');
+    strpadcpy((char *)h->oem_id, sizeof h->oem_id, oem_id, '\0');
     strpadcpy((char *)h->oem_table_id, sizeof h->oem_table_id,
-              oem_table_id, ' ');
+              oem_table_id, '\0');

     h->oem_revision = cpu_to_le32(1);
     memcpy(h->asl_compiler_id, ACPI_BUILD_APPNAME8, 4);
-- 
2.6.3


Reply via email to