On 03/12/2017 04:30 AM, Helge Deller wrote:
Add the missing defines and for TARGET_MAP_STACK and TARGET_MAP_HUGETLB
for alpha, mips, ppc and x86, and fix the mmap_flags translation table
to translate those flags between host and target architecture.

Signed-off-by: Helge Deller <del...@gmx.de>

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index cec8428..03ed370 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5875,6 +5875,8 @@ static bitmask_transtbl mmap_flags_tbl[] = {
        { TARGET_MAP_LOCKED, TARGET_MAP_LOCKED, MAP_LOCKED, MAP_LOCKED },
         { TARGET_MAP_NORESERVE, TARGET_MAP_NORESERVE, MAP_NORESERVE,
           MAP_NORESERVE },
+       { TARGET_MAP_STACK, TARGET_MAP_STACK, MAP_STACK, MAP_STACK },
+       { TARGET_MAP_HUGETLB, TARGET_MAP_HUGETLB, MAP_HUGETLB, MAP_HUGETLB },

I don't see any point in this. First, MAP_STACK is ignored by the kernel, and has been for some time. Second, the size of huge pages varies widely between different targets, and we're not really able to map the sizes between guest and host.

I suppose we could pass it through and get lucky when the sizes do match. But if they don't, is it better to succeed with small tlb entries or fail with -EINVAL?


r~

Reply via email to