qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: Add TARGET_MAP_STACK and TARGET_MAP


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] linux-user: Add TARGET_MAP_STACK and TARGET_MAP_HUGETLB for all remaining architectures
Date: Sun, 12 Mar 2017 07:53:18 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

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 <address@hidden>

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

[Prev in Thread] Current Thread [Next in Thread]