[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 1/5] cputlb: Disable __always_inline__ without optimization
From: |
David Hildenbrand |
Subject: |
Re: [RFC v2 1/5] cputlb: Disable __always_inline__ without optimization |
Date: |
Thu, 19 Sep 2019 16:36:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 18.09.19 20:02, Richard Henderson wrote:
> This forced inlining can result in missing symbols,
> which makes a debugging build harder to follow.
>
> Reported-by: Peter Maydell <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> include/qemu/compiler.h | 11 +++++++++++
> accel/tcg/cputlb.c | 4 ++--
> 2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index 09fc44cca4..d6d400c523 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -170,6 +170,17 @@
> # define QEMU_NONSTRING
> #endif
>
> +/*
> + * Forced inlining may be desired to encourage constant propagation
> + * of function parameters. However, it can also make debugging harder,
> + * so disable it for a non-optimizing build.
> + */
> +#if defined(__OPTIMIZE__) && __has_attribute(always_inline)
> +#define QEMU_ALWAYS_INLINE __attribute__((always_inline))
> +#else
> +#define QEMU_ALWAYS_INLINE
> +#endif
> +
> /* Implement C11 _Generic via GCC builtins. Example:
> *
> * QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x)
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index abae79650c..2222b87764 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -1281,7 +1281,7 @@ static void *atomic_mmu_lookup(CPUArchState *env,
> target_ulong addr,
> typedef uint64_t FullLoadHelper(CPUArchState *env, target_ulong addr,
> TCGMemOpIdx oi, uintptr_t retaddr);
>
> -static inline uint64_t __attribute__((always_inline))
> +static inline uint64_t QEMU_ALWAYS_INLINE
> load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
> uintptr_t retaddr, MemOp op, bool code_read,
> FullLoadHelper *full_load)
> @@ -1530,7 +1530,7 @@ tcg_target_ulong helper_be_ldsl_mmu(CPUArchState *env,
> target_ulong addr,
> * Store Helpers
> */
>
> -static inline void __attribute__((always_inline))
> +static inline void QEMU_ALWAYS_INLINE
> store_helper(CPUArchState *env, target_ulong addr, uint64_t val,
> TCGMemOpIdx oi, uintptr_t retaddr, MemOp op)
> {
>
Reviewed-by: David Hildenbrand <address@hidden>
--
Thanks,
David / dhildenb
- [Qemu-devel] [RFC v2 0/5] Move notdirty handling to cputlb, Richard Henderson, 2019/09/18
- [Qemu-devel] [RFC v2 1/5] cputlb: Disable __always_inline__ without optimization, Richard Henderson, 2019/09/18
- Re: [RFC v2 1/5] cputlb: Disable __always_inline__ without optimization,
David Hildenbrand <=
- [Qemu-devel] [RFC v2 2/5] cputlb: Replace switches in load/store_helper with callback, Richard Henderson, 2019/09/18
- [Qemu-devel] [RFC v2 4/5] exec: Adjust notdirty tracing, Richard Henderson, 2019/09/18
- [Qemu-devel] [RFC v2 5/5] cputlb: Move NOTDIRTY handling from I/O path to TLB path, Richard Henderson, 2019/09/18
- [Qemu-devel] [RFC v2 3/5] cputlb: Introduce TLB_BSWAP, Richard Henderson, 2019/09/18
- Re: [Qemu-devel] [RFC v2 0/5] Move notdirty handling to cputlb, no-reply, 2019/09/19