[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/16] cputlb: Disable __always_inline__ without optimization
From: |
Richard Henderson |
Subject: |
[PULL 02/16] cputlb: Disable __always_inline__ without optimization |
Date: |
Wed, 25 Sep 2019 11:45:34 -0700 |
This forced inlining can result in missing symbols,
which makes a debugging build harder to follow.
Reviewed-by: Alex Bennée <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: David Hildenbrand <address@hidden>
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..20780e722d 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__)
+#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)
{
--
2.17.1
- [PULL 00/16] tcg patch queue, Richard Henderson, 2019/09/25
- [PULL 01/16] exec: Use TARGET_PAGE_BITS_MIN for TLB flags, Richard Henderson, 2019/09/25
- [PULL 02/16] cputlb: Disable __always_inline__ without optimization,
Richard Henderson <=
- [PULL 03/16] qemu/compiler.h: Add qemu_build_not_reached, Richard Henderson, 2019/09/25
- [PULL 04/16] cputlb: Use qemu_build_not_reached in load/store_helpers, Richard Henderson, 2019/09/25
- [PULL 05/16] cputlb: Split out load/store_memop, Richard Henderson, 2019/09/25
- [PULL 06/16] cputlb: Introduce TLB_BSWAP, Richard Henderson, 2019/09/25
- [PULL 07/16] exec: Adjust notdirty tracing, Richard Henderson, 2019/09/25
- [PULL 09/16] cputlb: Move NOTDIRTY handling from I/O path to TLB path, Richard Henderson, 2019/09/25
- [PULL 08/16] cputlb: Move ROM handling from I/O path to TLB path, Richard Henderson, 2019/09/25
- [PULL 11/16] cputlb: Merge and move memory_notdirty_write_{prepare, complete}, Richard Henderson, 2019/09/25
- [PULL 12/16] cputlb: Handle TLB_NOTDIRTY in probe_access, Richard Henderson, 2019/09/25
- [PULL 10/16] cputlb: Partially inline memory_region_section_get_iotlb, Richard Henderson, 2019/09/25