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: 10059801 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2ADDD604D4 for ; Wed, 15 Nov 2017 15:48:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8AAD28614 for ; Wed, 15 Nov 2017 15:47:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC45E2A075; Wed, 15 Nov 2017 15:47:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 31F7528614 for ; Wed, 15 Nov 2017 15:47:57 +0000 (UTC) Received: from localhost ([::1]:36707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEzuu-0000oE-FO for patchwork-qemu-devel@patchwork.kernel.org; Wed, 15 Nov 2017 10:47:56 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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);