linux-user: Clarify error on failure to map guest address space
cover linux-user: Clarify error on failure to map guest address space
Hello,
This series is a couple of trivial improvements to the error message from linux-user's ELF loader when it fails to mmap() the guest's address space. Both issues caused me brief confusion when trying to sort myself out after hitting https://gitlab.com/qemu-project/qemu/-/issues/447
I've build tested the two as a sanity check.
Cheers,
Andrew
Andrew Jeffery (2):
linux-user: elfload: s/min_mmap_addr/mmap_min_addr/
linux-user: elfload: Specify -R is an option for qemu-user binaries
linux-user/elfload.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.39.2
PATCH 1/2 linux-user: elfload: s/min_mmap_addr/mmap_min_addr/
As-is the error message can cause some confusion as the mentioned sysctl attribute name is wrong:
https://www.kernel.org/doc/html/latest/admin-guide/sysctl/vm.html#mmap-min-addr
--- linux-user/elfload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/elfload.c +1 -1
@@ -2771,7 +2771,7 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,if (addr ==MAP_FAILED || addr != test) {error_report ("Unable to reserve 0x%lx bytes of virtual address " "space at %p (%s) for use as guest address space (check your " -"virtual memory ulimit setting, min_mmap_addr or reserve less " +"virtual memory ulimit setting, mmap_min_addr or reserve less " "using -R option)" , reserved_va, test,strerror (errno));exit (EXIT_FAILURE ); }
Signature · 1 line
2.39.2
PATCH 2/2 linux-user: elfload: Specify -R is an option for qemu-user binaries
In reply to Andrew JefferyGiven several different concepts are suggested for investigation, let's not confuse e.g. ulimit's -R with what was actually intended.
--- linux-user/elfload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
linux-user/elfload.c +2 -1
@@ -2772,7 +2772,8 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,error_report ("Unable to reserve 0x%lx bytes of virtual address " "space at %p (%s) for use as guest address space (check your " "virtual memory ulimit setting, mmap_min_addr or reserve less " -"using -R option)" , reserved_va, test,strerror (errno)); +"using qemu-user's -R option)" , + reserved_va, test,strerror (errno));exit (EXIT_FAILURE ); }
Signature · 1 line
2.39.2
Quoted 7 lines · Andrew Jeffery
Hello,
This series is a couple of trivial improvements to the error message from linux-user's ELF loader when it fails to
mmap()the guest's address space. Both issues caused me brief confusion when trying to sort myself out after hitting https://gitlab.com/qemu-project/qemu/-/issues/447I've build tested the two as a sanity check.
Ping? That seems like some nice rewording, but not my area..
Thanks!
/mjt