| Summary: | s390x: Valgrind cannot start qemu-kvm when "sysctl vm.allocate_pgste=0" | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Andreas Arnez <arnez> |
| Component: | general | Assignee: | Andreas Arnez <arnez> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | mark, tom |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Build with -Wl,--s390-pgste if the linker supports it | ||
|
Description
Andreas Arnez
2023-06-13 13:22:22 UTC
Does the kernel provide an API to allow user space to activate this? If it doesn't then there isn't much valgrind can do, other than provide an option to add that ELF section to the valgrind binary, which would then mean all valgrind use would have it activated. (In reply to Tom Hughes from comment #1) > Does the kernel provide an API to allow user space to activate this? The only APIs are running with systctl vm.allocate_psgte=1 systemwide, so all processes run with 4K page tables, or adding the (empty) PT_S390_PGSTE phdr segment to the process. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=23fefe119ceb5fb0c7d3321010620010a4eddb18 > If it doesn't then there isn't much valgrind can do, other than provide an > option to add that ELF section to the valgrind binary, which would then mean > all valgrind use would have it activated. Yeah. Although slightly wasteful just adding PT_S390_PGSTE to valgrind seems the simplest workaround (it just means there are 4K page tables are always used). This is the configure check that qemu used to add it: https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg04363.html Created attachment 159694 [details]
Build with -Wl,--s390-pgste if the linker supports it
This patch should enable building with -Wl,--s390-pgste. I've tested that the Valgrind tools are actually built with that flag on a system where the linker supports this. Note that I have *not* tested running qemu-kvm yet. Also, I'd appreciate if someone with more autoconf knowledge could review this.
The new configure check and tool ldflags addition look good to me. (In reply to Mark Wielaard from comment #4) > The new configure check and tool ldflags addition look good to me. Thanks for checking! I pushed this now. |