[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/39] target/arm: Don't allow Thumb Neon insns without FEATURE_NE
From: |
Peter Maydell |
Subject: |
[PULL 21/39] target/arm: Don't allow Thumb Neon insns without FEATURE_NEON |
Date: |
Mon, 4 May 2020 13:32:51 +0100 |
We were accidentally permitting decode of Thumb Neon insns even if
the CPU didn't have the FEATURE_NEON bit set, because the feature
check was being done before the call to disas_neon_data_insn() and
disas_neon_ls_insn() in the Arm decoder but was omitted from the
Thumb decoder. Push the feature bit check down into the called
functions so it is done for both Arm and Thumb encodings.
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden
---
target/arm/translate.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/target/arm/translate.c b/target/arm/translate.c
index e3fc7924428..4cf5267be00 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -3258,6 +3258,10 @@ static int disas_neon_ls_insn(DisasContext *s, uint32_t
insn)
TCGv_i32 tmp2;
TCGv_i64 tmp64;
+ if (!arm_dc_feature(s, ARM_FEATURE_NEON)) {
+ return 1;
+ }
+
/* FIXME: this access check should not take precedence over UNDEF
* for invalid encodings; we will generate incorrect syndrome information
* for attempts to execute invalid vfp/neon encodings with FP disabled.
@@ -5002,6 +5006,10 @@ static int disas_neon_data_insn(DisasContext *s,
uint32_t insn)
TCGv_ptr ptr1, ptr2, ptr3;
TCGv_i64 tmp64;
+ if (!arm_dc_feature(s, ARM_FEATURE_NEON)) {
+ return 1;
+ }
+
/* FIXME: this access check should not take precedence over UNDEF
* for invalid encodings; we will generate incorrect syndrome information
* for attempts to execute invalid vfp/neon encodings with FP disabled.
@@ -10948,10 +10956,6 @@ static void disas_arm_insn(DisasContext *s, unsigned
int insn)
if (((insn >> 25) & 7) == 1) {
/* NEON Data processing. */
- if (!arm_dc_feature(s, ARM_FEATURE_NEON)) {
- goto illegal_op;
- }
-
if (disas_neon_data_insn(s, insn)) {
goto illegal_op;
}
@@ -10959,10 +10963,6 @@ static void disas_arm_insn(DisasContext *s, unsigned
int insn)
}
if ((insn & 0x0f100000) == 0x04000000) {
/* NEON load/store. */
- if (!arm_dc_feature(s, ARM_FEATURE_NEON)) {
- goto illegal_op;
- }
-
if (disas_neon_ls_insn(s, insn)) {
goto illegal_op;
}
--
2.20.1
- [PULL 12/39] hw/arm: versal: Embed the UARTs into the SoC type, (continued)
- [PULL 12/39] hw/arm: versal: Embed the UARTs into the SoC type, Peter Maydell, 2020/05/04
- [PULL 13/39] hw/arm: versal: Embed the GEMs into the SoC type, Peter Maydell, 2020/05/04
- [PULL 14/39] hw/arm: versal: Embed the ADMAs into the SoC type, Peter Maydell, 2020/05/04
- [PULL 15/39] hw/arm: versal: Embed the APUs into the SoC type, Peter Maydell, 2020/05/04
- [PULL 16/39] hw/arm: versal: Add support for SD, Peter Maydell, 2020/05/04
- [PULL 17/39] hw/arm: versal: Add support for the RTC, Peter Maydell, 2020/05/04
- [PULL 19/39] hw/arm: versal-virt: Add support for the RTC, Peter Maydell, 2020/05/04
- [PULL 18/39] hw/arm: versal-virt: Add support for SD, Peter Maydell, 2020/05/04
- [PULL 20/39] target/arm/translate-vfp.inc.c: Remove duplicate simd_r32 check, Peter Maydell, 2020/05/04
- [PULL 22/39] target/arm: Add stubs for AArch32 Neon decodetree, Peter Maydell, 2020/05/04
- [PULL 21/39] target/arm: Don't allow Thumb Neon insns without FEATURE_NEON,
Peter Maydell <=
- [PULL 24/39] target/arm: Convert VCADD (vector) to decodetree, Peter Maydell, 2020/05/04
- [PULL 25/39] target/arm: Convert V[US]DOT (vector) to decodetree, Peter Maydell, 2020/05/04
- [PULL 23/39] target/arm: Convert VCMLA (vector) to decodetree, Peter Maydell, 2020/05/04
- [PULL 26/39] target/arm: Convert VFM[AS]L (vector) to decodetree, Peter Maydell, 2020/05/04
- [PULL 27/39] target/arm: Convert VCMLA (scalar) to decodetree, Peter Maydell, 2020/05/04
- [PULL 28/39] target/arm: Convert V[US]DOT (scalar) to decodetree, Peter Maydell, 2020/05/04
- [PULL 29/39] target/arm: Convert VFM[AS]L (scalar) to decodetree, Peter Maydell, 2020/05/04
- [PULL 30/39] target/arm: Convert Neon load/store multiple structures to decodetree, Peter Maydell, 2020/05/04
- [PULL 31/39] target/arm: Convert Neon 'load single structure to all lanes' to decodetree, Peter Maydell, 2020/05/04
- [PULL 34/39] target/arm: Convert Neon 3-reg-same logic ops to decodetree, Peter Maydell, 2020/05/04