[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 32/52] cputlb: cast size_t to target_ulong before usi
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PULL 32/52] cputlb: cast size_t to target_ulong before using for address masks |
Date: |
Fri, 7 Jun 2019 10:05:31 +0100 |
While size_t is defined to happily access the biggest host object this
isn't the case when generating masks for 64 bit guests on 32 bit
hosts. Otherwise we end up truncating the address when we fall back to
our unaligned helper.
Fixes: https://bugs.launchpad.net/qemu/+bug/1831545
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Tested-by: Andrew Randrianasulu <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index b796ab1cbe..8f814a1a2c 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1306,7 +1306,7 @@ load_helper(CPUArchState *env, target_ulong addr,
TCGMemOpIdx oi,
uint64_t r1, r2;
unsigned shift;
do_unaligned_access:
- addr1 = addr & ~(size - 1);
+ addr1 = addr & ~((target_ulong)size - 1);
addr2 = addr1 + size;
r1 = full_load(env, addr1, oi, retaddr);
r2 = full_load(env, addr2, oi, retaddr);
--
2.20.1
- [Qemu-devel] [PULL 03/52] tests/docker: Update the Fedora image to Fedora 30, (continued)
- [Qemu-devel] [PULL 03/52] tests/docker: Update the Fedora image to Fedora 30, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 06/52] .travis.yml: bump gcc sanitiser job to gcc-9, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 02/52] qemu-io-cmds: use clock_gettime for benchmarking, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 07/52] .travis.yml: add clang ubsan job, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 10/52] tests/vm: Fix build-centos docker-based tests run, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 11/52] tests/vm: Add missing variables on help, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 17/52] tests/vm: proper guest shutdown, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 42/52] gdbstub: Implement write memory (M pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 51/52] gdbstub: Clear unused variables in gdb_handle_packet, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 20/52] tests/vm: serial console support helpers, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 32/52] cputlb: cast size_t to target_ulong before using for address masks,
Alex Bennée <=
- [Qemu-devel] [PULL 15/52] tests/vm: use ssh with pty unconditionally, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 30/52] tests/tcg/x86_64: add a PVH crt.o for x86_64 system tests, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 23/52] tests/vm: netbsd autoinstall, using serial console, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 26/52] semihosting: split console_out into string and char versions, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 45/52] gdbstub: Implement read all registers (g pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 29/52] tests/tcg: clean-up VPATH/TESTS for i386, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 40/52] gdbstub: Implement set register (P pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 18/52] tests/vm: add vm-boot-{ssh, serial}-<guest> targets, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 43/52] gdbstub: Implement read memory (m pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 13/52] tests/vm: python3 fixes, Alex Bennée, 2019/06/07