qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* linux-user cannot allocate stack memory on riscv64 host due to non-zero guest_base
@ 2024-06-25 11:37 Andreas Schwab
  2024-06-25 15:47 ` Richard Henderson
  0 siblings, 1 reply; 18+ messages in thread
From: Andreas Schwab @ 2024-06-25 11:37 UTC (permalink / raw)
  To: qemu-devel

When running qemu-riscv64 on a riscv64 host executing a ET_EXEC riscv64
binary it cannot allocate memory for the stack:

$ qemu-riscv64 -d page ./hello.riscv64
host mmap_min_addr=0x10000
Locating guest address space @ 0x3ee000
page layout changed following mmap
start            end              size             prot
0000000000010000-0000000000013000 0000000000003000 ---
page layout changed following mmap
start            end              size             prot
0000000000010000-0000000000011000 0000000000001000 r-x
0000000000011000-0000000000013000 0000000000002000 ---
page layout changed following mmap
start            end              size             prot
0000000000010000-0000000000011000 0000000000001000 r-x
0000000000011000-0000000000013000 0000000000002000 rw-
mmap stack: Cannot allocate memory

The issue is that guest_base is non-zero, which turns the target_mmap
call with zero base in setup_arg_pages into a host mmap call with
non-zero base.  On other hosts like x86_64 or aarch64, guest_base
remains zero and the issue does not occur.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-07-02 14:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-25 11:37 linux-user cannot allocate stack memory on riscv64 host due to non-zero guest_base Andreas Schwab
2024-06-25 15:47 ` Richard Henderson
2024-06-26  8:23   ` Andreas Schwab
2024-06-26 15:48     ` Richard Henderson
2024-06-26 15:54       ` Warner Losh
2024-06-27  7:54         ` Andreas Schwab
2024-06-27 14:14           ` Warner Losh
2024-06-27 14:26             ` Andreas Schwab
2024-06-27 14:55               ` Peter Maydell
2024-07-01 14:02                 ` Andreas Schwab
2024-07-01 16:05                   ` Richard Henderson
2024-07-02  8:09                     ` Andreas Schwab
2024-07-02 14:13                       ` Richard Henderson
2024-07-02 14:18                         ` Andreas Schwab
2024-07-02 14:18                       ` Richard Henderson
2024-07-02 14:39                         ` Andreas Schwab
2024-07-02 14:45                           ` Richard Henderson
2024-07-02 13:37                     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).