blob: a2f21118d0f6f472e593a82c332f64cf6425d8d9 (
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
|
architecture: 0.835
x86: 0.829
device: 0.776
graphic: 0.745
files: 0.722
register: 0.719
kernel: 0.702
assembly: 0.701
performance: 0.701
network: 0.686
arm: 0.668
PID: 0.667
ppc: 0.660
i386: 0.659
vnc: 0.644
risc-v: 0.639
socket: 0.611
TCG: 0.604
mistranslation: 0.593
hypervisor: 0.582
user-level: 0.569
KVM: 0.567
permissions: 0.553
semantic: 0.514
boot: 0.511
peripherals: 0.496
debug: 0.492
VMM: 0.489
virtual: 0.395
--------------------
x86: 0.969
assembly: 0.761
i386: 0.286
debug: 0.083
user-level: 0.055
register: 0.050
TCG: 0.046
files: 0.038
semantic: 0.034
PID: 0.024
virtual: 0.012
device: 0.012
kernel: 0.010
performance: 0.008
hypervisor: 0.007
peripherals: 0.006
architecture: 0.005
risc-v: 0.004
VMM: 0.004
KVM: 0.003
boot: 0.003
network: 0.003
permissions: 0.002
graphic: 0.001
socket: 0.001
vnc: 0.001
mistranslation: 0.001
ppc: 0.001
arm: 0.000
Intel BLSI CF computation bug
Description of problem:
CF flag computation of BLSI instruction is wrong. It seems #1370 was not completely fixed.
Steps to reproduce:
1. Compile `example.c` using this command: `gcc -o example.bin example.c`. My gcc version is 12.3.0, but other versions may work.
```
int main() {
__asm__ (
"movq $0x1, %r8\n"
"mov $0xedbf530a, %r9\n"
"push $0x1\n"
"popf\n"
"blsi %r9d, %r8d\n"
"pushf\n"
"pop %rax\n"
"pop %rbp\n"
"ret\n"
);
return 0;
}
```
2. Run `./example.bin`. Then check the return code using `echo $?`. It should be 3.
```
$ ./example.bin
$ echo $?
3
```
3. Run `./qemu-x86_64 ./example.bin`. Then check the return code using `echo $?`. It should be 2.
```
$ ./qemu-x86_64 ./example.bin
$ echo $?
2
```
The return code of `./example.bin` contains the value of the `RFLAGS` register after executing the `BLSI` instruction.
Additional information:
|