OSDN Git Service

target/arm: Add MO_128 entry to pred_esz_masks[]
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 18 Jul 2022 10:01:44 +0000 (11:01 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 26 Jul 2022 12:38:23 +0000 (13:38 +0100)
commitfca75f60abbf2a7f88264977ff0bb3ff4285989c
tree8553cbb11bddc23d6972feb481f5ed9dfbfc86a5
parent02b7035d15726b68bb94f12e2e0d92087da34708
target/arm: Add MO_128 entry to pred_esz_masks[]

In commit 7390e0e9ab8475, we added support for SME loads and stores.
Unlike SVE loads and stores, these include handling of 128-bit
elements.  The SME load/store functions call down into the existing
sve_cont_ldst_elements() function, which uses the element size MO_*
value as an index into the pred_esz_masks[] array.  Because this code
path now has to handle MO_128, we need to add an extra element to the
array.

This bug was spotted by Coverity because it meant we were reading off
the end of the array.

Resolves: Coverity CID 14905391490541149054314905441490545,
 1490546149054814905491490550149055114905551490557,
 1490558149056014905611490563
Fixes: 7390e0e9ab8475 ("target/arm: Implement SME LD1, ST1")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220718100144.3248052-1-peter.maydell@linaro.org
target/arm/cpu.h
target/arm/translate-sve.c