[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 11/21] accel/tcg: Move qemu_ram_addr_from_host_nofail to p
From: |
Alistair Francis |
Subject: |
Re: [PATCH v6 11/21] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c |
Date: |
Mon, 22 Aug 2022 09:34:39 +1000 |
On Fri, Aug 19, 2022 at 1:34 PM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> The base qemu_ram_addr_from_host function is already in
> softmmu/physmem.c; move the nofail version to be adjacent.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> include/exec/cpu-common.h | 1 +
> accel/tcg/cputlb.c | 12 ------------
> softmmu/physmem.c | 12 ++++++++++++
> 3 files changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
> index 2281be4e10..d909429427 100644
> --- a/include/exec/cpu-common.h
> +++ b/include/exec/cpu-common.h
> @@ -72,6 +72,7 @@ typedef uintptr_t ram_addr_t;
> void qemu_ram_remap(ram_addr_t addr, ram_addr_t length);
> /* This should not be used by devices. */
> ram_addr_t qemu_ram_addr_from_host(void *ptr);
> +ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr);
> RAMBlock *qemu_ram_block_by_name(const char *name);
> RAMBlock *qemu_ram_block_from_host(void *ptr, bool round_offset,
> ram_addr_t *offset);
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index 43bd65c973..80a3eb4f1c 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -1283,18 +1283,6 @@ void tlb_set_page(CPUState *cpu, target_ulong vaddr,
> prot, mmu_idx, size);
> }
>
> -static inline ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr)
> -{
> - ram_addr_t ram_addr;
> -
> - ram_addr = qemu_ram_addr_from_host(ptr);
> - if (ram_addr == RAM_ADDR_INVALID) {
> - error_report("Bad ram pointer %p", ptr);
> - abort();
> - }
> - return ram_addr;
> -}
> -
> /*
> * Note: tlb_fill() can trigger a resize of the TLB. This means that all of
> the
> * caller's prior references to the TLB table (e.g. CPUTLBEntry pointers)
> must
> diff --git a/softmmu/physmem.c b/softmmu/physmem.c
> index dc3c3e5f2e..d4c30e99ea 100644
> --- a/softmmu/physmem.c
> +++ b/softmmu/physmem.c
> @@ -2460,6 +2460,18 @@ ram_addr_t qemu_ram_addr_from_host(void *ptr)
> return block->offset + offset;
> }
>
> +ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr)
> +{
> + ram_addr_t ram_addr;
> +
> + ram_addr = qemu_ram_addr_from_host(ptr);
> + if (ram_addr == RAM_ADDR_INVALID) {
> + error_report("Bad ram pointer %p", ptr);
> + abort();
> + }
> + return ram_addr;
> +}
> +
> static MemTxResult flatview_read(FlatView *fv, hwaddr addr,
> MemTxAttrs attrs, void *buf, hwaddr len);
> static MemTxResult flatview_write(FlatView *fv, hwaddr addr, MemTxAttrs
> attrs,
> --
> 2.34.1
>
>
- [PATCH v6 01/21] linux-user/arm: Mark the commpage executable, (continued)
- [PATCH v6 01/21] linux-user/arm: Mark the commpage executable, Richard Henderson, 2022/08/18
- [PATCH v6 03/21] linux-user/x86_64: Allocate vsyscall page as a commpage, Richard Henderson, 2022/08/18
- [PATCH v6 05/21] linux-user: Clear translations and tb_jmp_cache on mprotect(), Richard Henderson, 2022/08/18
- [PATCH v6 04/21] linux-user: Honor PT_GNU_STACK, Richard Henderson, 2022/08/18
- [PATCH v6 06/21] tests/tcg/i386: Move smc_code2 to an executable section, Richard Henderson, 2022/08/18
- [PATCH v6 07/21] accel/tcg: Introduce is_same_page(), Richard Henderson, 2022/08/18
- [PATCH v6 09/21] accel/tcg: Unlock mmap_lock after longjmp, Richard Henderson, 2022/08/18
- [PATCH v6 11/21] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c, Richard Henderson, 2022/08/18
- Re: [PATCH v6 11/21] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c,
Alistair Francis <=
- [PATCH v6 13/21] accel/tcg: Add nofault parameter to get_page_addr_code_hostp, Richard Henderson, 2022/08/18
- [PATCH v6 15/21] accel/tcg: Remove translator_ldsw, Richard Henderson, 2022/08/18
- [PATCH v6 12/21] accel/tcg: Use probe_access_internal for softmmu get_page_addr_code_hostp, Richard Henderson, 2022/08/18
- [PATCH v6 10/21] accel/tcg: Make tb_htable_lookup static, Richard Henderson, 2022/08/18
- [PATCH v6 14/21] accel/tcg: Raise PROT_EXEC exception early, Richard Henderson, 2022/08/18
- [PATCH v6 18/21] target/s390x: Make translator stop before the end of a page, Richard Henderson, 2022/08/18