trace: fix misreporting of TCG access sizes for user-space
trace_mem_build_info expects a size_shift for its first argument. Fix it. Signed-off-by: Emilio G. Cota <cota@braap.org> Message-id: 1527028012-21888-2-git-send-email-cota@braap.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
00928a421d
commit
32c072341f
|
@ -33,20 +33,24 @@
|
||||||
#define SUFFIX q
|
#define SUFFIX q
|
||||||
#define USUFFIX q
|
#define USUFFIX q
|
||||||
#define DATA_TYPE uint64_t
|
#define DATA_TYPE uint64_t
|
||||||
|
#define SHIFT 3
|
||||||
#elif DATA_SIZE == 4
|
#elif DATA_SIZE == 4
|
||||||
#define SUFFIX l
|
#define SUFFIX l
|
||||||
#define USUFFIX l
|
#define USUFFIX l
|
||||||
#define DATA_TYPE uint32_t
|
#define DATA_TYPE uint32_t
|
||||||
|
#define SHIFT 2
|
||||||
#elif DATA_SIZE == 2
|
#elif DATA_SIZE == 2
|
||||||
#define SUFFIX w
|
#define SUFFIX w
|
||||||
#define USUFFIX uw
|
#define USUFFIX uw
|
||||||
#define DATA_TYPE uint16_t
|
#define DATA_TYPE uint16_t
|
||||||
#define DATA_STYPE int16_t
|
#define DATA_STYPE int16_t
|
||||||
|
#define SHIFT 1
|
||||||
#elif DATA_SIZE == 1
|
#elif DATA_SIZE == 1
|
||||||
#define SUFFIX b
|
#define SUFFIX b
|
||||||
#define USUFFIX ub
|
#define USUFFIX ub
|
||||||
#define DATA_TYPE uint8_t
|
#define DATA_TYPE uint8_t
|
||||||
#define DATA_STYPE int8_t
|
#define DATA_STYPE int8_t
|
||||||
|
#define SHIFT 0
|
||||||
#else
|
#else
|
||||||
#error unsupported data size
|
#error unsupported data size
|
||||||
#endif
|
#endif
|
||||||
|
@ -63,7 +67,7 @@ glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr)
|
||||||
#if !defined(CODE_ACCESS)
|
#if !defined(CODE_ACCESS)
|
||||||
trace_guest_mem_before_exec(
|
trace_guest_mem_before_exec(
|
||||||
ENV_GET_CPU(env), ptr,
|
ENV_GET_CPU(env), ptr,
|
||||||
trace_mem_build_info(DATA_SIZE, false, MO_TE, false));
|
trace_mem_build_info(SHIFT, false, MO_TE, false));
|
||||||
#endif
|
#endif
|
||||||
return glue(glue(ld, USUFFIX), _p)(g2h(ptr));
|
return glue(glue(ld, USUFFIX), _p)(g2h(ptr));
|
||||||
}
|
}
|
||||||
|
@ -87,7 +91,7 @@ glue(glue(cpu_lds, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr)
|
||||||
#if !defined(CODE_ACCESS)
|
#if !defined(CODE_ACCESS)
|
||||||
trace_guest_mem_before_exec(
|
trace_guest_mem_before_exec(
|
||||||
ENV_GET_CPU(env), ptr,
|
ENV_GET_CPU(env), ptr,
|
||||||
trace_mem_build_info(DATA_SIZE, true, MO_TE, false));
|
trace_mem_build_info(SHIFT, true, MO_TE, false));
|
||||||
#endif
|
#endif
|
||||||
return glue(glue(lds, SUFFIX), _p)(g2h(ptr));
|
return glue(glue(lds, SUFFIX), _p)(g2h(ptr));
|
||||||
}
|
}
|
||||||
|
@ -113,7 +117,7 @@ glue(glue(cpu_st, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr,
|
||||||
#if !defined(CODE_ACCESS)
|
#if !defined(CODE_ACCESS)
|
||||||
trace_guest_mem_before_exec(
|
trace_guest_mem_before_exec(
|
||||||
ENV_GET_CPU(env), ptr,
|
ENV_GET_CPU(env), ptr,
|
||||||
trace_mem_build_info(DATA_SIZE, false, MO_TE, true));
|
trace_mem_build_info(SHIFT, false, MO_TE, true));
|
||||||
#endif
|
#endif
|
||||||
glue(glue(st, SUFFIX), _p)(g2h(ptr), v);
|
glue(glue(st, SUFFIX), _p)(g2h(ptr), v);
|
||||||
}
|
}
|
||||||
|
@ -136,3 +140,4 @@ glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env,
|
||||||
#undef SUFFIX
|
#undef SUFFIX
|
||||||
#undef USUFFIX
|
#undef USUFFIX
|
||||||
#undef DATA_SIZE
|
#undef DATA_SIZE
|
||||||
|
#undef SHIFT
|
||||||
|
|
Loading…
Reference in a new issue