[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 20/27] linux-user/nios2: Map a real kuser page
From: |
Peter Maydell |
Subject: |
Re: [PULL 20/27] linux-user/nios2: Map a real kuser page |
Date: |
Mon, 10 Jan 2022 13:22:25 +0000 |
On Thu, 6 Jan 2022 at 11:01, Laurent Vivier <laurent@vivier.eu> wrote:
>
> From: Richard Henderson <richard.henderson@linaro.org>
>
> The first word of page1 is data, so the whole thing
> can't be implemented with emulation of addresses.
> Use init_guest_commpage for the allocation.
>
> Hijack trap number 16 to implement cmpxchg.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
> Message-Id: <20211221025012.1057923-5-richard.henderson@linaro.org>
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
> linux-user/elfload.c | 50 ++++++++++++++++++++++++++++++++++++-
> linux-user/nios2/cpu_loop.c | 50 ++++++++++++++++++++-----------------
> target/nios2/translate.c | 9 -------
> 3 files changed, 76 insertions(+), 33 deletions(-)
Hi; on my local Linux box clang complains about this code:
> @@ -2374,6 +2420,8 @@ static void pgb_static(const char *image_name,
> abi_ulong orig_loaddr,
> } else {
> offset = -(HI_COMMPAGE & -align);
> }
> + } else if (LO_COMMPAGE) {
> + loaddr = MIN(loaddr, LO_COMMPAGE & -align);
> }
>
> addr = pgb_find_hole(loaddr, hiaddr - loaddr, align, offset);
../../linux-user/elfload.c:2423:16: error: converting the result of
'<<' to a boolean always evaluates to true
[-Werror,-Wtautological-constant-compare]
} else if (LO_COMMPAGE) {
^
../../linux-user/elfload.c:1102:22: note: expanded from macro 'LO_COMMPAGE'
#define LO_COMMPAGE TARGET_PAGE_SIZE
^
/mnt/nvmedisk/linaro/qemu-for-merges/include/exec/cpu-all.h:231:31:
note: expanded from macro 'TARGET_PAGE_SIZE'
#define TARGET_PAGE_SIZE (1 << TARGET_PAGE_BITS)
^
1 error generated.
Using "if (LO_COMMPAGE != 0)" shuts the compiler up.
This is with clang version 10.0.0-4ubuntu1.
-- PMM
- [PULL 06/27] linux-user: Remove TARGET_SIGSTKSZ, (continued)
- [PULL 06/27] linux-user: Remove TARGET_SIGSTKSZ, Laurent Vivier, 2022/01/06
- [PULL 14/27] linux-user: add sched_getattr support, Laurent Vivier, 2022/01/06
- [PULL 01/27] qemu-binfmt-conf.sh: fix -F option, Laurent Vivier, 2022/01/06
- [PULL 12/27] target/sh4: Implement prctl_unalign_sigbus, Laurent Vivier, 2022/01/06
- [PULL 18/27] linux-user/nios2: Fixes for signal frame setup, Laurent Vivier, 2022/01/06
- [PULL 15/27] linux-user: call set/getscheduler set/getparam directly, Laurent Vivier, 2022/01/06
- [PULL 22/27] linux-user/nios2: Fix sigmask in setup_rt_frame, Laurent Vivier, 2022/01/06
- [PULL 26/27] linux-user: netlink: Add IFLA_VFINFO_LIST, Laurent Vivier, 2022/01/06
- [PULL 09/27] linux-user: Add code for PR_GET/SET_UNALIGN, Laurent Vivier, 2022/01/06
- [PULL 20/27] linux-user/nios2: Map a real kuser page, Laurent Vivier, 2022/01/06
- Re: [PULL 20/27] linux-user/nios2: Map a real kuser page,
Peter Maydell <=
- [PULL 02/27] linux-user/hexagon: Use generic target_stat64 structure, Laurent Vivier, 2022/01/06
- [PULL 16/27] linux-user/syscall.c: fix missed flag for shared memory in open_self_maps, Laurent Vivier, 2022/01/06
- [PULL 27/27] linux-user: netlink: update IFLA_BRPORT entries, Laurent Vivier, 2022/01/06
- [PULL 07/27] linux-user: Split out do_prctl and subroutines, Laurent Vivier, 2022/01/06
- [PULL 25/27] linux-user: netlink: update IFLA entries, Laurent Vivier, 2022/01/06
- [PULL 21/27] linux-user/nios2: Fix EA vs PC confusion, Laurent Vivier, 2022/01/06
- [PULL 08/27] linux-user: Disable more prctl subcodes, Laurent Vivier, 2022/01/06
- [PULL 19/27] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE, Laurent Vivier, 2022/01/06
- [PULL 23/27] linux-user/nios2: Use set_sigmask in do_rt_sigreturn, Laurent Vivier, 2022/01/06
- [PULL 24/27] linux-user/syscall.c: malloc to g_try_malloc, Laurent Vivier, 2022/01/06