diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-05-21 21:21:26 +0200 |
|---|---|---|
| committer | Christian Krinitsin <mail@krinitsin.com> | 2025-05-21 21:21:26 +0200 |
| commit | 4b927bc37359dec23f67d3427fc982945f24f404 (patch) | |
| tree | 245449ef9146942dc7fffd0235b48b7e70a00bf2 /gitlab/issues/target_missing/host_missing/accel_missing/2157.toml | |
| parent | aa8bd79cec7bf6790ddb01d156c2ef2201abbaab (diff) | |
| download | emulator-bug-study-4b927bc37359dec23f67d3427fc982945f24f404.tar.gz emulator-bug-study-4b927bc37359dec23f67d3427fc982945f24f404.zip | |
add gitlab issues in toml format
Diffstat (limited to 'gitlab/issues/target_missing/host_missing/accel_missing/2157.toml')
| -rw-r--r-- | gitlab/issues/target_missing/host_missing/accel_missing/2157.toml | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gitlab/issues/target_missing/host_missing/accel_missing/2157.toml b/gitlab/issues/target_missing/host_missing/accel_missing/2157.toml new file mode 100644 index 00000000..9beb7682 --- /dev/null +++ b/gitlab/issues/target_missing/host_missing/accel_missing/2157.toml @@ -0,0 +1,51 @@ +id = 2157 +title = "qemu-user fails to run 32-bit x86 binaries on hosts with a page size > 4KB" +state = "closed" +created_at = "2024-02-09T12:51:33.431Z" +closed_at = "2024-03-05T11:17:44.326Z" +labels = ["Closed::Fixed", "linux-user"] +url = "https://gitlab.com/qemu-project/qemu/-/issues/2157" +host-os = "ALT Linux sisyphus" +host-arch = "LoongArch, ARM64" +qemu-version = "8.2.0" +guest-os = "Linux userspace emulation" +guest-arch = "32-bit x86" +description = """`qemu-i386` refuses to run 32-bit x86 binaries on hosts with a page size > 4KB +(such as LoongArch, ppc64le, arm64 with 3 level page tables).""" +reproduce = """1. Compile x86 binary which makes a single exit(0) syscall: + ``` + cat > exit0.S << EOF + #include <sys/syscall.h> + .text + .global _start + _start: + movl $__NR_exit, %eax + movl $0, %ebx + int $0x80 + EOF + i586-linux-gnu-gcc -nostdlib -static -no-pie -o exit0 exit0.S + ``` + Alternatively one might compile it on a x86 host: + ``` + gcc -m32 -nostdlib -static -no-pie -o exit0 exit0.S + ``` + and transfer the `exit0` binary to ppc64/LoongArch/arm64 system + + 2. Run the `exit0` binary with `qemu-i386` + ``` + qemu-i386-static ./exit0 + ``` + + #""" +additional = """`.text` segment of (32-bit) x86 binaries is typically aligned at 4KB: +``` +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD 0x000000 0x08048000 0x08048000 0x00100 0x00100 R 0x1000 + LOAD 0x001000 0x08049000 0x08049000 0x0000c 0x0000c R E 0x1000 + NOTE 0x0000b4 0x080480b4 0x080480b4 0x0004c 0x0004c R 0x4 + GNU_PROPERTY 0x0000d8 0x080480d8 0x080480d8 0x00028 0x00028 R 0x4 +``` + +Thus on a host with a page size being 64 KB (ppc64, arm64 with 3 level page tables) or 16 KB (LoongArch) +alignment requirements in [pbg_dynamic](https://gitlab.com/qemu-project/qemu/-/blob/master/linux-user/elfload.c?ref_type=heads#L3020) can not be satisfied.""" |