Skip to contentSkip to conversation

Add missing fp_access_check() to aarch64 crypto instructions

PATCH In review Nick Reilly 2 participants 2 messages Feb 17, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add missing fp_access_check() to aarch64 crypto instructions

The aarch64 crypto instructions for AES and SHA are missing the check for if the FPU is enabled.

---
 target/arm/translate-a64.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
target/arm/translate-a64.c +12 -0
index e61bbd6..8105e7e 100644
@@ -10929,6 +10929,10 @@ static void disas_crypto_aes(DisasContext *s, uint32_t insn)
         return;
     }
 
+    if (!fp_access_check(s)) {
+        return;
+    }
+
     /* Note that we convert the Vx register indexes into the
      * index within the vfp.regs[] array, so we can share the
      * helper with the AArch32 instructions.
@@ -10993,6 +10997,10 @@ static void disas_crypto_three_reg_sha(DisasContext *s, uint32_t insn)
         return;
     }
 
+    if (!fp_access_check(s)) {
+        return;
+    }
+
     tcg_rd_regno = tcg_const_i32(rd << 1);
     tcg_rn_regno = tcg_const_i32(rn << 1);
     tcg_rm_regno = tcg_const_i32(rm << 1);
@@ -11056,6 +11064,10 @@ static void disas_crypto_two_reg_sha(DisasContext *s, uint32_t insn)
         return;
     }
 
+    if (!fp_access_check(s)) {
+        return;
+    }
+
     tcg_rd_regno = tcg_const_i32(rd << 1);
     tcg_rn_regno = tcg_const_i32(rn << 1);
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 4 lines · Nick Reilly

The aarch64 crypto instructions for AES and SHA are missing the check for if the FPU is enabled.

Oops, nice catch. Applied to target-arm.next, thanks.

-- PMM