From patchwork Wed Nov 15 15:33:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth <1724570@bugs.launchpad.net> X-Patchwork-Id: 838232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ycTKQ4wQnz9s7F for ; Thu, 16 Nov 2017 02:47:38 +1100 (AEDT) Received: from localhost ([::1]:36707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEzua-0000oE-Qf for incoming@patchwork.ozlabs.org; Wed, 15 Nov 2017 10:47:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEzuC-0000o0-2l for qemu-devel@nongnu.org; Wed, 15 Nov 2017 10:47:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEzu5-0001qL-ET for qemu-devel@nongnu.org; Wed, 15 Nov 2017 10:47:12 -0500 Received: from indium.canonical.com ([91.189.90.7]:57760) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eEzu5-0001oo-7m for qemu-devel@nongnu.org; Wed, 15 Nov 2017 10:47:05 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1eEztx-0003qX-NE for ; Wed, 15 Nov 2017 15:46:59 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id C610F2E82E7 for ; Wed, 15 Nov 2017 15:45:58 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 15 Nov 2017 15:33:38 -0000 From: Thomas Huth <1724570@bugs.launchpad.net> To: qemu-devel@nongnu.org X-Launchpad-Notification-Type: bug X-Launchpad-Bug: product=qemu; status=New; importance=Undecided; assignee=None; X-Launchpad-Bug-Information-Type: Public X-Launchpad-Bug-Private: no X-Launchpad-Bug-Security-Vulnerability: no X-Launchpad-Bug-Commenters: berrange th-huth X-Launchpad-Bug-Reporter: Daniel Berrange (berrange) X-Launchpad-Bug-Modifier: Thomas Huth (th-huth) References: <150833168269.1534.1058667524294729864.malonedeb@soybean.canonical.com> Message-Id: <151076001835.28762.7049356161441112067.malone@gac.canonical.com> X-Launchpad-Message-Rationale: Subscriber (QEMU) @qemu-devel-ml X-Launchpad-Message-For: qemu-devel-ml Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="18505"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: b504b24fc16ff47be2af779f280de61a18d3488e X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 91.189.90.7 Subject: [Qemu-devel] [Bug 1724570] Re: qemu-system-x86_64 generates ACPI tables with broken endianess when run on big-endian hosts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bug 1724570 <1724570@bugs.launchpad.net> Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" I think something like this should fix this issue: diff a/tests/bios-tables-test.c b/tests/bios-tables-test.c --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -279,8 +279,19 @@ static void dump_aml_files(test_data *data, bool rebuild) } g_assert(fd >= 0); + sdt->header.signature = cpu_to_le32(sdt->header.signature); + sdt->header.length = cpu_to_le32(sdt->header.length); + sdt->header.oem_revision = cpu_to_le32(sdt->header.oem_revision); + sdt->header.asl_compiler_revision = cpu_to_le32(sdt->header.asl_compiler_revision); + ret = qemu_write_full(fd, sdt, sizeof(AcpiTableHeader)); g_assert(ret == sizeof(AcpiTableHeader)); + + sdt->header.signature = le32_to_cpu(sdt->header.signature); + sdt->header.length = le32_to_cpu(sdt->header.length); + sdt->header.oem_revision = le32_to_cpu(sdt->header.oem_revision); + sdt->header.asl_compiler_revision = le32_to_cpu(sdt->header.asl_compiler_revision); + ret = qemu_write_full(fd, sdt->aml, sdt->aml_len); g_assert(ret == sdt->aml_len);