From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awmXR-0007Uu-N9 for qemu-devel@nongnu.org; Sun, 01 May 2016 04:15:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awmXF-0003sv-RE for qemu-devel@nongnu.org; Sun, 01 May 2016 04:15:32 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awmXE-0003nj-FH for qemu-devel@nongnu.org; Sun, 01 May 2016 04:15:25 -0400 Received: by mail-wm0-x243.google.com with SMTP id w143so12661422wmw.3 for ; Sun, 01 May 2016 01:15:09 -0700 (PDT) Reply-To: marcel@redhat.com References: <1461933880-214779-1-git-send-email-imammedo@redhat.com> From: Marcel Apfelbaum Message-ID: <5725BB02.1060001@gmail.com> Date: Sun, 1 May 2016 11:14:58 +0300 MIME-Version: 1.0 In-Reply-To: <1461933880-214779-1-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.6] acpi: fix bios linker loadder COMMAND_ALLOCATE on bigendian host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , qemu-devel@nongnu.org Cc: dan@danny.cz, lvivier@redhat.com, david@gibson.dropbear.id.au, mst@redhat.com On 04/29/2016 03:44 PM, Igor Mammedov wrote: > 'make check' fails with: > > ERROR:tests/bios-tables-test.c:493:load_expected_aml: > assertion failed: (g_file_test(aml_file, G_FILE_TEST_EXISTS)) > > since commit: > caf50c7166a6ed96c462ab5db4b495e1234e4cc6 > tests: pc: acpi: drop not needed 'expected SSDT' blobs > > Assert happens because qemu-system-x86_64 generates > SSDT table and test looks for a corresponding expected > table to compare with. > > However there is no expected SSDT blob anymore, since > QEMU souldn't generate one. As it happens BIOS is not > able to read ACPI tables from QEMU and fallbacks to > embeded legacy ACPI codepath, which generates SSDT. > That happens due to wrongly sized endiannes conversion > which makes > uint8_t BiosLinkerLoaderEntry.alloc.zone > end up with 0 due to truncation of 32 bit integer > which on host is 1 or 2. > > Fix it by dropping invalid cpu_to_le32() as uint8_t > doesn't require any conversion. > > RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1330174 > > Signed-off-by: Igor Mammedov > --- > hw/acpi/bios-linker-loader.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/hw/acpi/bios-linker-loader.c b/hw/acpi/bios-linker-loader.c > index ace9abb..5153ab1 100644 > --- a/hw/acpi/bios-linker-loader.c > +++ b/hw/acpi/bios-linker-loader.c > @@ -135,9 +135,8 @@ void bios_linker_loader_alloc(GArray *linker, > strncpy(entry.alloc.file, file, sizeof entry.alloc.file - 1); > entry.command = cpu_to_le32(BIOS_LINKER_LOADER_COMMAND_ALLOCATE); > entry.alloc.align = cpu_to_le32(alloc_align); > - entry.alloc.zone = cpu_to_le32(alloc_fseg ? > - BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG : > - BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH); > + entry.alloc.zone = alloc_fseg ? BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG : > + BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH; > > /* Alloc entries must come first, so prepend them */ > g_array_prepend_vals(linker, &entry, sizeof entry); > Reviewed-by: Marcel Apfelbaum Thanks, Marcel