summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/118/none/1724570
blob: ec06020994922219a2bf99775b0c9508fcd189ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
permissions: 0.757
register: 0.727
assembly: 0.726
semantic: 0.724
architecture: 0.722
mistranslation: 0.691
peripherals: 0.688
PID: 0.679
graphic: 0.670
files: 0.669
arm: 0.668
user-level: 0.665
device: 0.663
socket: 0.647
debug: 0.645
ppc: 0.626
network: 0.619
hypervisor: 0.618
risc-v: 0.617
performance: 0.600
boot: 0.585
kernel: 0.572
x86: 0.565
vnc: 0.563
TCG: 0.514
virtual: 0.505
KVM: 0.450
VMM: 0.446
i386: 0.404

qemu-system-x86_64 generates ACPI tables with broken endianess when run on big-endian hosts

The bios-tables-test always fails when run on a big-endian host, which has iasl installed. When it calls iasl to dumps the AML files into ASL files, iasl complains

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20170831
Copyright (c) 2000 - 2017 Intel Corporation

Input file aml-4L677Y, Length 0x38 (56) bytes
Table [TEPH] is too long for file - needs: 0x38000000, remaining in file: 0x38
Could not get ACPI tables from aml-4L677Y, AE_BAD_HEADER


At first I thought this was an iasl bug, but the latest version of iasl in rawhide is ported to big endian.

So I looked at the actual AML files that bios-tables-test extracts from the qemu-system-x86_64 memory space, when running on ppc64 host. These do indeed have different content from the AML files generated by qemu-system-x86_64 when running on an x86_64 host.


eg the AML file for the HPET shows

< 0000000   T   E   P   H nul nul nul   8 soh etx   B   O   C   H   S  sp
<            4554    4850    0000    3800    0301    4f42    4843    2053
< 0000020   B   X   P   C   H   P   E   T nul nul nul soh   B   X   P   C
<            5842    4350    5048    5445    0000    0100    5842    4350
< 0000040 nul nul nul soh soh   " ack nul nul nul nul nul nul nul   P   ~
<            0000    0100    a201    8086    0000    0000    0000    fed0
---
> 0000000   H   P   E   T   8 nul nul nul soh etx   B   O   C   H   S  sp
>            5048    5445    0038    0000    0301    4f42    4843    2053
> 0000020   B   X   P   C   H   P   E   T soh nul nul nul   B   X   P   C
>            5842    4350    5048    5445    0001    0000    5842    4350
> 0000040 soh nul nul nul soh   " ack nul nul nul nul nul nul nul   P   ~
>            0001    0000    a201    8086    0000    0000    0000    fed0

so not only is the table name inverted, but the lenght is inverted, and several fields later on are inverted too.

Other AML files for APIC and DSDT show similar brokenness

This is seen with QEMU 2.10.0













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);
 


Fixed here:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=3831c07b89ab1f7aa1427