-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cryptest: armv7l: failed to generate expected vector load/store instructions #481
Comments
I believe this failure is common. When I see this one I usually ignore it. To say more, I would need to see the disassembly. You can produce the disassembly by hand:
The test is performed in Now, we perform the vector load
Its is also possible With that said, this looks wrong:
We should be at |
cryptest.sh still needs some tweaking from the recent changes
1aecb3d confirmed. Logs attached in #480 (comment). |
Here another example that causes the failures. Its called Multiple Register Transfer. You have one at offset 0x20, 0x3e, 0x4e, 0x5e, ... A single load instruction is actually executing multiple loads and incrementing pointers behind the scenes.
For whatever reason the compiler determined it was more profitable to perform the double-D loads rather than a 1-Q load. Or maybe NEON cannot load a Q register due to lack of instruction support. Or maybe they are the same loads, but the mnemonics are different depending on the version of Binutils. As I understand things, 2D = 1Q (and also 16B = 8S = 4W = 2D =1Q). For the load at 0x20, D20-21 is just Q10. They are just different views of the same register bank. Also see 1.3.2. NEON registers in the ARM ARM. I think we can safely ignore this one. I opened a question on Stack Overflow at Difference between vld1.32 {d20-d21} and vld1q q10?. |
The tests were already present; they just needed some tuning
I think Commit de8478af2ab5 cleared the issue. It did two things. First, it added |
cryptest-result_armv7l-rev4.txt Is it still safe to ignore? |
That's weird. Did you pull the latest? According to the objdump, the gadget is producing 6
The objdump also indicates 19
Both should succeed. |
Sorry, my mistake: I did pull latest but that was on a separate machine (which this machine then needed to then pull from).
But they do, don't they? This patch: diff --git a/cryptest.sh b/cryptest.sh
index 71bfaa5..4c1acbd 100755
--- a/cryptest.sh
+++ b/cryptest.sh
@@ -1308,6 +1308,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0")) ]
if [[ ("$HAVE_ARMV8A") ]]; then
# ARIA::UncheckedKeySet: 8 vld1q.32
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c 'vld')
+ echo "ARIA::UncheckedKeySet: 8 vld1q.32 - our count: " $COUNT
if [[ ("$COUNT" -lt "8") ]]; then
FAILED=1
echo "ERROR: failed to generate NEON load instructions" | tee -a "$TEST_RESULTS"
@@ -1315,6 +1316,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0")) ]
else # ARMv7
# ARIA::UncheckedKeySet: 6 vld1.32 {d1,d2}
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'vld1.32[[:space:]]*{')
+ echo "ARIA::UncheckedKeySet: 6 vld1.32 {d1,d2} - our count: " $COUNT
if [[ ("$COUNT" -lt "6") ]]; then
FAILED=1
echo "ERROR: failed to generate NEON load instructions" | tee -a "$TEST_RESULTS"
@@ -1324,6 +1326,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0")) ]
if [[ ("$HAVE_ARMV8A") ]]; then
# ARIA::UncheckedKeySet: 20 vstr1q.32
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c 'vst')
+ echo "ARIA::UncheckedKeySet: 20 vstr1q.32 - our count: " $COUNT
if [[ ("$COUNT" -lt "20") ]]; then
FAILED=1
echo "ERROR: failed to generate NEON store instructions" | tee -a "$TEST_RESULTS"
@@ -1331,6 +1334,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0")) ]
else
# ARIA::UncheckedKeySet: 16 vstr1.32 {d1,d2}
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'vst1.32[[:space:]]*{')
+ echo "ARIA::UncheckedKeySet: 16 vstr1.32 {d1,d2} - our count: " $COUNT
if [[ ("$COUNT" -lt "16") ]]; then
FAILED=1
echo "ERROR: failed to generate NEON store instructions" | tee -a "$TEST_RESULTS" with: produces:
|
Does that mean |
No, not that I can see.
And we don't. The |
Ack. Try Commit 5b12be29e673. |
👍 thanks @noloader, should we close as resolved? |
Yeah, I think we are OK. I tested locally on my BananaPi (ARMv7-a) and CubieTruck (ARMv7-a), and my HiKey (ARMv8-a). Previously I was just testing under my BananaPi. I don't know why my BananaPi was returning success when you witnessed failures. |
Thank you for testing 😄
I look forward to getting my hands on one. |
cryptest-result_armv7l-rev4.txt
Referencing #480. Possibly related to monero-project/kovri#699?
The text was updated successfully, but these errors were encountered: