[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 11/12] accel/tcg: Replace target_ulong with vaddr in page_
From: |
Richard Henderson |
Subject: |
Re: [PATCH v3 11/12] accel/tcg: Replace target_ulong with vaddr in page_*() |
Date: |
Mon, 26 Jun 2023 15:59:37 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 |
On 6/21/23 15:56, Anton Johansson via wrote:
Use vaddr for guest virtual addresses for functions dealing with page
flags.
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/user-exec.c | 44 +++++++++++++++++-------------------
include/exec/cpu-all.h | 10 ++++----
include/exec/translate-all.h | 2 +-
3 files changed, 27 insertions(+), 29 deletions(-)
This causes other failures, such as
https://gitlab.com/rth7680/qemu/-/jobs/4540151776#L4468
qemu-hppa: ../accel/tcg/user-exec.c:490: page_set_flags: Assertion `last <=
GUEST_ADDR_MAX' failed.
which is caused by
#8 0x00005555556e5b77 in do_shmat (cpu_env=cpu_env@entry=0x555556274378,
shmid=54, shmaddr=<optimized out>, shmflg=0)
at ../src/linux-user/syscall.c:4598
4598 page_set_flags(raddr, raddr + shm_info.shm_segsz - 1,
4599 PAGE_VALID | PAGE_RESET | PAGE_READ |
4600 (shmflg & SHM_RDONLY ? 0 : PAGE_WRITE));
The host shm_info.shm_segsz is uint64_t, which means that the whole expression gets
converted to uint64_t. With this patch, it is not properly truncated to a guest address.
In this particular case, raddr is signed (abi_long), which is a mistake. Fixing that
avoids this particular error.
But since user-only is outside of the scope of this work, I'm going to drop this patch for
now.
r~
- [PATCH v3 01/12] accel: Replace target_ulong in tlb_*(), (continued)
- [PATCH v3 01/12] accel: Replace target_ulong in tlb_*(), Anton Johansson, 2023/06/21
- [PATCH v3 05/12] accel/tcg/cputlb.c: Widen addr in MMULookupPageData, Anton Johansson, 2023/06/21
- [PATCH v3 04/12] accel/tcg/cputlb.c: Widen CPUTLBEntry access functions, Anton Johansson, 2023/06/21
- [PATCH v3 03/12] target: Widen pc/cs_base in cpu_get_tb_cpu_state, Anton Johansson, 2023/06/21
- [PATCH v3 08/12] accel: Replace target_ulong with vaddr in probe_*(), Anton Johansson, 2023/06/21
- [PATCH v3 06/12] accel/tcg/cpu-exec.c: Widen pc to vaddr, Anton Johansson, 2023/06/21
- [PATCH v3 07/12] accel/tcg: Widen pc to vaddr in CPUJumpCache, Anton Johansson, 2023/06/21
- [PATCH v3 09/12] accel/tcg: Replace target_ulong with vaddr in *_mmu_lookup(), Anton Johansson, 2023/06/21
- [PATCH v3 10/12] accel/tcg: Replace target_ulong with vaddr in translator_*(), Anton Johansson, 2023/06/21
- [PATCH v3 11/12] accel/tcg: Replace target_ulong with vaddr in page_*(), Anton Johansson, 2023/06/21
- Re: [PATCH v3 11/12] accel/tcg: Replace target_ulong with vaddr in page_*(),
Richard Henderson <=
- [PATCH v3 12/12] cpu: Replace target_ulong with hwaddr in tb_invalidate_phys_addr(), Anton Johansson, 2023/06/21
- Re: [PATCH v3 00/12] Start replacing target_ulong with vaddr, Richard Henderson, 2023/06/23