Implement VDSO for x86_64-linux-user
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest14 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | linux-user: Handle filesz < memsz for any PT_LOAD segment.linux-user/ | +55 | 0 replies | |
| 1/14 | linux-user: Handle filesz < memsz for any PT_LOAD segment.linux-user/ | +55 | 0 replies | |
| 2/14 | Add more DT_* and AT_* constants to qemu's copy of elf.h.elf.h linux-user/ | +44 | 0 replies | |
| 2/14 | Add more DT_* and AT_* constants to qemu's copy of elf.h.elf.h linux-user/ | +44 | 0 replies | |
| 3/14 | linux-user: Reindent elfload.c.linux-user/ | +301 | 0 replies | |
| 3/14 | linux-user: Reindent elfload.c.linux-user/ | +301 | 0 replies | |
| 4/14 | linux-user: Reduce lseek+reads while loading elf files.linux-user/ linux-user/ linux-user/ | +58 | 0 replies | |
| 4/14 | linux-user: Reduce lseek+reads while loading elf files.linux-user/ linux-user/ linux-user/ | +58 | 0 replies | |
| 5/14 | linux-user: Fix ELF_DATA for Alpha.linux-user/ | +1 | 0 replies | |
| 5/14 | linux-user: Fix ELF_DATA for Alpha.linux-user/ | +1 | 0 replies | |
| 6/14 | linux-user: Clean up byte-swapping in elfload.c.linux-user/ | +48 | 0 replies | |
| 6/14 | linux-user: Clean up byte-swapping in elfload.c.linux-user/ | +48 | 0 replies | |
| 7/14 | linux-user: Load symbols from the interpreter.linux-user/ | +101 | 0 replies | |
| 7/14 | linux-user: Load symbols from the interpreter.linux-user/ | +101 | 0 replies | |
| 8/14 | linux-user: Improve consistency checking in elf headers.linux-user/ | +33 | 0 replies | |
| 8/14 | linux-user: Improve consistency checking in elf headers.linux-user/ | +33 | 0 replies | |
| 9/14 | linux-user: Put the stack guard page at the top.linux-user/ | +16 | 0 replies | |
| 9/14 | linux-user: Put the stack guard page at the top.linux-user/ | +16 | 0 replies | |
| 10/14 | linux-user: Remove partial support for a.out interpreters.linux-user/ | +9 | 0 replies | |
| 10/14 | linux-user: Remove partial support for a.out interpreters.linux-user/ | +9 | 0 replies | |
| 11/14 | linux-user: Extract load_elf_image from load_elf_interp.linux-user/ | +167 | 0 replies | |
| 11/14 | linux-user: Extract load_elf_image from load_elf_interp.linux-user/ | +167 | 0 replies | |
| 12/14 | linux-user: Re-use load_elf_image for the main binary.linux-user/ | +53 | 2 replies | |
| 12/14 | linux-user: Re-use load_elf_image for the main binary.linux-user/ | +56 | 0 replies | |
| 13/14 | linux-user: Build vdso for x64.Makefile pc-bios/ pc-bios/ +2 more | +190 | 0 replies | |
| 13/14 | linux-user: Build vdso for x64.Makefile pc-bios/ pc-bios/ +2 more | +190 | 0 replies | |
| 14/14 | linux-user: Load a VDSO for x86-64.linux-user/ | +193 | 0 replies | |
| 14/14 | linux-user: Load a VDSO for x86-64.linux-user/ | +193 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [PATCH 00/14] Implement VDSO for x86_64-linux-user
To do this in any clean sort of way, I rewrote a substantial portion of elfload.c. Doing otherwise would have wound up with 3 entirely separate bits of code to load an elf image.
The first patch seems out of order, since I did this work on a branch that already contained some previously submitted fixes for Alpha.
The third patch is *only* white-space changes. There were too many functions that I was touching that were improperly indented for qemu's style. Fixing this once at the beginning minimizes the irrelevant whitespace changes that emacs autoindent would have introduced when moving code around later.
The patch sequence has been tested at each point with all of the targets in linux-user-test-0.3.
Since that doesn't actually test gettimeofday, I also tested the final result against a small program that simply reads and prints the timeval with the system glibc, and examining the logs to verify that we do in fact call the __vdso_getttimeofday in the loaded vdso. I didn't test with the linux-user-test-0.3 image because I have no way of properly linking with that library, and programs linked against my system glibc crash when run vs the uClibc library.
I'll admit that the Makefiles aren't quite right for building the VDSO. I couldn't quite figure out what needed to be done. The binary image included in patch 13 is exactly what you'd get with the link command included in the pc-bios/Makefile, provided that you can get that link command executed. I'd appreciate some help with this point.
Finally, do be aware that I was not able to use qemu_find_file to load the vdso image, since that function is only built for system builds, and I'd rather this patch sequence be independent of cleanups involving vl.c. ;-) As a short-term hack, I always load the vdso image from the install directory. Which does mean that x86-64 emulation will not currently work from the build directory alone.
r~
Richard Henderson (14):
linux-user: Handle filesz < memsz for any PT_LOAD segment. Add more DT_* and AT_* constants to qemu's copy of elf.h.
linux-user: Reindent elfload.c.
linux-user: Reduce lseek+reads while loading elf files.
linux-user: Fix ELF_DATA for Alpha.
linux-user: Clean up byte-swapping in elfload.c.
linux-user: Load symbols from the interpreter.
linux-user: Improve consistency checking in elf headers.
linux-user: Put the stack guard page at the top.
linux-user: Remove partial support for a.out interpreters.
linux-user: Extract load_elf_image from load_elf_interp.
linux-user: Re-use load_elf_image for the main binary.
linux-user: Build vdso for x64.
linux-user: Load a VDSO for x86-64.
Makefile | 3 +- elf.h | 44 ++ linux-user/elfload.c | 1683 +++++++++++++++++++++------------------------ linux-user/linuxload.c | 17 +- linux-user/qemu.h | 7 +- pc-bios/Makefile | 5 + pc-bios/vdso-linux-x64.S | 102 +++ pc-bios/vdso-linux-x64.ld | 81 +++ pc-bios/vdso-linux-x64.so | Bin 0 -> 7515 bytes 9 files changed, 1037 insertions(+), 905 deletions(-) create mode 100644 pc-bios/vdso-linux-x64.S create mode 100644 pc-bios/vdso-linux-x64.ld create mode 100755 pc-bios/vdso-linux-x64.so