[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL for-2.10 3/3] tcg: Increase minimum alignment from tc
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL for-2.10 3/3] tcg: Increase minimum alignment from tcg_malloc to 8 |
Date: |
Thu, 3 Aug 2017 22:28:27 -0700 |
For a 64-bit ILP32 host, aligning to sizeof(long) is not enough.
Guess the minimum for any host is 8, as that covers uint64_t.
Qemu doesn't use a host long double or host vectors, except in
extremely limited circumstances.
Fixes a bus error for a sparc v8plus host.
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/tcg.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tcg/tcg.h b/tcg/tcg.h
index da78721a0d..17b7750ee6 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -762,7 +762,10 @@ static inline void *tcg_malloc(int size)
{
TCGContext *s = &tcg_ctx;
uint8_t *ptr, *ptr_end;
- size = (size + sizeof(long) - 1) & ~(sizeof(long) - 1);
+
+ /* ??? This is a weak placeholder for minimum malloc alignment. */
+ size = QEMU_ALIGN_UP(size, 8);
+
ptr = s->pool_cur;
ptr_end = ptr + size;
if (unlikely(ptr_end > s->pool_end)) {
--
2.13.3
- [Qemu-devel] [PATCH for-2.11 0/8] tcg/s390 improvments, Richard Henderson, 2017/08/04
- [Qemu-devel] [PULL for-2.10 2/3] target/s390x: Fix CSST for 16-byte store, Richard Henderson, 2017/08/04
- [Qemu-devel] [PULL for-2.10 1/3] tcg/arm: Fix runtime overalignment test, Richard Henderson, 2017/08/04
- [Qemu-devel] [PATCH 1/8] tcg/s390: Fully convert tcg_target_op_def, Richard Henderson, 2017/08/04
- [Qemu-devel] [PATCH 2/8] tcg/s390: Merge cmpi facilities check to tcg_target_op_def, Richard Henderson, 2017/08/04
- [Qemu-devel] [PULL for-2.10 3/3] tcg: Increase minimum alignment from tcg_malloc to 8,
Richard Henderson <=
- [Qemu-devel] [PATCH 4/8] tcg/s390: Merge add2i facilities check to tcg_target_op_def, Richard Henderson, 2017/08/04
- [Qemu-devel] [PATCH 3/8] tcg/s390: Merge muli facilities check to tcg_target_op_def, Richard Henderson, 2017/08/04
- [Qemu-devel] [PATCH 5/8] tcg/s390: Merge ori+xori facilities check to tcg_target_op_def, Richard Henderson, 2017/08/04
- [Qemu-devel] [PATCH 6/8] tcg/s390: Use distinct-operands facility, Richard Henderson, 2017/08/04
- [Qemu-devel] [PATCH 7/8] tcg/s390: Use load-on-condition-2 facility, Richard Henderson, 2017/08/04
- [Qemu-devel] [PATCH 8/8] tcg/s390: Use slbgr for setcond le and leu, Richard Henderson, 2017/08/04
- Re: [Qemu-devel] [PATCH for-2.11 0/8] tcg/s390 improvments, no-reply, 2017/08/04
- Re: [Qemu-devel] [PATCH for-2.11 0/8] tcg/s390 improvments, no-reply, 2017/08/04