blob: 73249b93c5f072a366bd3d4deb1d8d7c550513fb (
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
|
x86 user: icebp/int1 raises wrong signal
Description of problem:
This is a relatively minor inaccuracy. When `icebp` (`F1`) is executed, it raises `SIGILL` in QEMU, where the behavior on baremetal Linux (on an old Intel Core i5-430m) is to raise `SIGTRAP`.
Specifically, on the architectural level, `icebp` raises `#DB` without affecting `dr6`.
This also happens on an AArch64 host.
```
$ ./icebp
Trace/breakpoint trap
$ qemu-x86_64 ./icebp
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Illegal instruction
```
Steps to reproduce:
1. Compile this file using `gcc -nostdlib -static icebp.S -o icebp`, optionally with `-m32` to test i386
```
.globl _start
_start:
.byte 0xF1 // gas doesn't assemble this instruction opcode but it disassembles it
#ifdef __x86_64__
mov $60, %eax
syscall
#else
mov $1, %eax
int $0x80
#endif
```
2. Run on baremetal. Notice how it raises `SIGTRAP` according to the shell job control message
3. Run on qemu-user. Notice how it raises `SIGILL`.
|