qemu/target/ppc
Laurent Vivier 4fff72185b target/ppc: fix build on ppc64 host
When I try to build a ppc64 target on a ppc64 host (gcc 8.1.1), I have:

.../target/ppc/int_helper.c: In function 'helper_vinsertb':
.../target/ppc/int_helper.c:1954:32: error: array subscript 18446744073709551608 is above array bounds of 'uint8_t[16]' {aka 'unsigned char[16]'} [-Werror=array-bounds]
         memmove(&r->u8[index], &b->u8[8 - sizeof(r->element)],              \
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../target/ppc/int_helper.c:1965:1: note: in expansion of macro 'VINSERT'

If we compare with the macro for ppc64le, we can see
sizeof(r->element[0]) should be used instead of sizeof(r->element).

And VINSERT uses only u8, u16, u32 and u64, so the maximum value
of sizeof(r->element[0]) is 8

Suggested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-07-07 12:12:27 +10:00
..
translate target/ppc: convert to DisasContextBase 2018-02-16 12:14:39 +11:00
arch_dump.c compiler: add a sizeof_field() macro 2018-06-27 13:01:40 +01:00
compat.c target/ppc: Allow cpu compatiblity checks based on type, not instance 2018-06-21 21:22:53 +10:00
cpu-models.c target/ppc: Add POWER9 DD2.0 model information 2017-10-17 10:34:00 +11:00
cpu-models.h target/ppc: Add POWER9 DD2.0 model information 2017-10-17 10:34:00 +11:00
cpu-qom.h target/ppc: Get rid of POWERPC_MMU_VER() macros 2018-04-27 18:05:22 +10:00
cpu.c target/ppc: support for 32-bit carry and overflow 2017-03-01 11:23:39 +11:00
cpu.h target/ppc: Remove POWERPC_EXCP_STCX 2018-07-03 09:56:52 +10:00
dfp_helper.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
excp_helper.c target/ppc: Add do_unaligned_access hook 2018-07-03 09:56:52 +10:00
fpu_helper.c fpu_helper.c: fix setting FPSCR[FI] bit 2018-07-03 09:56:52 +10:00
gdbstub.c ppc: Fix size of ppc64 xer register 2018-04-27 18:05:22 +10:00
helper_regs.h target/ppc: Include "exec/exec-all.h" which provides tlb_flush() 2018-05-31 19:12:13 +02:00
helper.h target/ppc: Use atomic cmpxchg for STQCX 2018-07-03 09:56:52 +10:00
int_helper.c target/ppc: fix build on ppc64 host 2018-07-07 12:12:27 +10:00
internal.h target/ppc: Add do_unaligned_access hook 2018-07-03 09:56:52 +10:00
kvm_ppc.h spapr: Don't rewrite mmu capabilities in KVM mode 2018-06-22 14:19:07 +10:00
kvm-stub.c openpic: move KVM-specific declarations into separate openpic_kvm.h file 2018-03-06 13:16:29 +11:00
kvm.c target/ppc/kvm: don't pass cpu to kvm_get_smmu_info() 2018-07-03 09:56:52 +10:00
machine.c ppc: Rename 2.13 machines to 3.0 2018-05-29 11:28:46 +01:00
Makefile.objs build: remove CONFIG_LIBDECNUMBER 2017-10-16 18:03:52 +02:00
mem_helper.c target/ppc: Use atomic cmpxchg for STQCX 2018-07-03 09:56:52 +10:00
mfrom_table_gen.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
mfrom_table.inc.c rename included C files to foo.inc.c, remove osdep.h 2018-05-11 14:33:40 +02:00
misc_helper.c target/ppc: Allow privileged access to SPR_PCR 2018-06-12 09:33:52 +10:00
mmu_helper.c hw/ppc: Use the IEC binary prefix definitions 2018-07-02 15:41:16 +02:00
mmu-book3s-v3.c Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00
mmu-book3s-v3.h target/ppc: add basic support for PTCR on POWER9 2018-05-04 09:56:27 +10:00
mmu-hash32.c target/ppc: Eliminate htab_base and htab_mask variables 2017-03-01 11:23:39 +11:00
mmu-hash32.h target/ppc: Manage external HPT via virtual hypervisor 2017-03-01 11:23:39 +11:00
mmu-hash64.c target/ppc: Add ppc_hash64_filter_pagesizes() 2018-06-22 14:19:07 +10:00
mmu-hash64.h target/ppc: Add ppc_hash64_filter_pagesizes() 2018-06-22 14:19:07 +10:00
mmu-radix64.c Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00
mmu-radix64.h target/ppc: Add debug function for radix mmu translation 2017-07-11 11:04:02 +10:00
monitor.c Use qemu_tolower() and qemu_toupper(), not tolower() and toupper() 2017-07-21 10:32:41 +01:00
timebase_helper.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
trace-events docs: fix broken paths to docs/devel/tracing.txt 2017-07-31 13:12:53 +03:00
translate_init.inc.c target/ppc: Add do_unaligned_access hook 2018-07-03 09:56:52 +10:00
translate.c target/ppc: Relax reserved bitmask of indexed store instructions 2018-07-03 11:13:08 +10:00
user_only_helper.c accel/tcg: add size paremeter in tlb_fill() 2018-01-25 16:02:24 +01:00