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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
TCG: 0.899
graphic: 0.884
virtual: 0.877
risc-v: 0.873
PID: 0.872
register: 0.867
user-level: 0.865
peripherals: 0.859
performance: 0.849
vnc: 0.846
arm: 0.844
permissions: 0.832
ppc: 0.825
architecture: 0.824
KVM: 0.822
VMM: 0.808
hypervisor: 0.807
semantic: 0.807
debug: 0.806
x86: 0.805
assembly: 0.802
kernel: 0.790
device: 0.782
files: 0.768
socket: 0.753
network: 0.735
boot: 0.734
mistranslation: 0.667
i386: 0.653
--------------------
TCG: 0.932
arm: 0.825
architecture: 0.270
virtual: 0.169
hypervisor: 0.164
files: 0.082
user-level: 0.040
kernel: 0.027
semantic: 0.021
debug: 0.016
PID: 0.011
x86: 0.009
performance: 0.007
register: 0.006
device: 0.006
boot: 0.004
permissions: 0.003
peripherals: 0.002
socket: 0.001
VMM: 0.001
graphic: 0.001
assembly: 0.001
network: 0.001
ppc: 0.001
risc-v: 0.001
vnc: 0.001
mistranslation: 0.001
KVM: 0.000
i386: 0.000
QEMU-user doesn't report HWCAP2_MTE
Reproducible on ffa090bc56e73e287a63261e70ac02c0970be61a
Host Debian 5.10.24 x86_64 GNU
Configured with "configure --disable-system --enable-linux-user --static"
This one works and prints "OK" as expected:
clang tests/tcg/aarch64/mte-3.c -target aarch64-linux-gnu -fsanitize=memtag -march=armv8+memtag
qemu-aarch64 --cpu max -L /usr/aarch64-linux-gnu ./a.out && echo OK
This one fails and print "0":
cat mytest.c
#include <stdio.h>
#include <sys/auxv.h>
#ifndef HWCAP2_MTE
#define HWCAP2_MTE (1 << 18)
#endif
int main(int ac, char **av)
{
printf("%d\n", (int)(getauxval(AT_HWCAP2) & HWCAP2_MTE));
}
clang mytest.c -target aarch64-linux-gnu -fsanitize=memtag -march=armv8+memtag
qemu-aarch64 --cpu max -L /usr/aarch64-linux-gnu ./a.out
Actually if we make it like this:
#include <stdio.h>
#include <sys/auxv.h>
int main(int ac, char **av)
{
for (int i = 0; i < 32; ++i)
if ((int)(getauxval(AT_HWCAP2) & (1 << i)))
printf("%d\n", i);
}
clang mytest.c -target aarch64-linux-gnu -fsanitize=memtag -march=armv8+memtag
qemu-aarch64 --cpu max -L /usr/aarch64-linux-gnu ./a.out
I see only: HWCAP_FP HWCAP_CRC32 HWCAP_ATOMICS
So no HWCAP2_BTI as well.
Sorry, 0 7 8 should be "HWCAP2_DCPODP HWCAP2_FLAGM2 HWCAP2_FRINT"
Yep, there's a whole bunch that have been missed.
https://<email address hidden>/
This has missed 6.0, but should be acceptable to roll into 6.0.1.
Thanks for the quick fix!
On Tue, Apr 27, 2021 at 2:55 PM Richard Henderson <
<email address hidden>> wrote:
>
> https://<email address hidden>/
>
> This has missed 6.0, but should be acceptable to roll into 6.0.1.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1926044
>
> Title:
> QEMU-user doesn't report HWCAP2_MTE
>
> Status in QEMU:
> In Progress
>
> Bug description:
> Reproducible on ffa090bc56e73e287a63261e70ac02c0970be61a
>
> Host Debian 5.10.24 x86_64 GNU
>
> Configured with "configure --disable-system --enable-linux-user
> --static"
>
> This one works and prints "OK" as expected:
> clang tests/tcg/aarch64/mte-3.c -target aarch64-linux-gnu
> -fsanitize=memtag -march=armv8+memtag
> qemu-aarch64 --cpu max -L /usr/aarch64-linux-gnu ./a.out && echo OK
>
>
> This one fails and print "0":
> cat mytest.c
> #include <stdio.h>
> #include <sys/auxv.h>
>
> #ifndef HWCAP2_MTE
> #define HWCAP2_MTE (1 << 18)
> #endif
>
> int main(int ac, char **av)
> {
> printf("%d\n", (int)(getauxval(AT_HWCAP2) & HWCAP2_MTE));
> }
>
>
> clang mytest.c -target aarch64-linux-gnu -fsanitize=memtag
> -march=armv8+memtag
> qemu-aarch64 --cpu max -L /usr/aarch64-linux-gnu ./a.out
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/qemu/+bug/1926044/+subscriptions
>
Patch has been merged:
https://gitlab.com/qemu-project/qemu/-/commit/68948d18224b93361e28
|