aarch64: add everything except instructions#1418
Conversation
Based on disconnect3d/aarch64/skeleton.
|
See #1366 (comment). |
Otherwise, 'scripts/travis_test.sh' fails to work.
ehennenfent
left a comment
There was a problem hiding this comment.
Reviewed 17 of 18 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @nkaretnikov)
examples/script/aarch64/count_instructions.py, line 11 at r2 (raw file):
DIR = os.path.dirname(__file__) FILE = os.path.join(DIR, 'hello42')
Would consider renaming this file to 'hello42.py'
manticore/native/cpu/aarch64.py, line 280 at r2 (raw file):
# See 'UTS_MACHINE' and 'COMPAT_UTS_MACHINE' in the Linux kernel source. # https://stackoverflow.com/a/45125525 machine = 'aarch64'
Would prefer to switch this to an enum if possible
tests/native/test_aarch64cpu.py, line 8 at r2 (raw file):
from nose.tools import nottest from manticore.core.smtlib import *
In general we try to avoid import *, but since this is in a test, we can probably ignore the performance penalty
|
I'm so glad you suggested to rename the example script! I have done that and realized it's now broken. I don't get the same behavior as on a pre-rebase branch. I suspect something has changed in the syscall layer, investigating... UPD: Okay, I've figured it out. It's a change in @ehennenfent could you explain why this code was added? It wouldn't work for Armv7 either. The reason I thought of syscalls first is that the "Unimplemented system call" warning was added to FWIW, here are my old comments explaining how to run the examples: Note that you'll need to test on a branch with all the AArch64 changes present (such as the last PR or your own development branch). |
nkaretnikov
left a comment
There was a problem hiding this comment.
Reviewable status: 16 of 19 files reviewed, 3 unresolved discussions (waiting on @ehennenfent)
manticore/native/cpu/aarch64.py, line 280 at r2 (raw file):
Previously, ehennenfent (Eric Hennenfent) wrote…
Would prefer to switch this to an enum if possible
Me too, but I don't currently have any hardware or emulators that report anything other than aarch64 (LE).
So I'd rather not change this without testing. And there might be other places that just use aarch64 in the code.
tests/native/test_aarch64cpu.py, line 8 at r2 (raw file):
Previously, ehennenfent (Eric Hennenfent) wrote…
In general we try to avoid import *, but since this is in a test, we can probably ignore the performance penalty
Done.
examples/script/aarch64/count_instructions.py, line 11 at r2 (raw file):
Previously, ehennenfent (Eric Hennenfent) wrote…
Would consider renaming this file to 'hello42.py'
Done.
ehennenfent
left a comment
There was a problem hiding this comment.
That register number limit check was added here. It was to combat a bug we encountered when using different versions of capstone that had different maximum register numbers on x86. You're right that it will probably break other architectures. I'd suggest expanding this check to handle the various architectures. IE:
if (<arch> == x86 and reg_id >= X86_REG_ENDING) or
(<arch> == aarch64 and reg_id >= ARM64_REG_ENDING):
Just worry about correctly supporting x86 and aarch64 here and I'll make a note to go fix the other architectures after we merge. The correct REG_ENDING variables can be found in the *_const.py files here
Reviewed 3 of 3 files at r3.
Reviewable status:complete! all files reviewed, all discussions resolved
nkaretnikov
left a comment
There was a problem hiding this comment.
Done.
Reviewable status: 18 of 19 files reviewed, all discussions resolved (waiting on @ehennenfent)
ehennenfent
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r4.
Reviewable status:complete! all files reviewed, all discussions resolved
* master: (28 commits) AArch64: fix ldrb size (#1433) System Call Audit (#1384) ManticoreBase refactor (#1385) Add missing checks for ARM boundaries (#1429) aarch64: add instruction tests: T-U (#1423) aarch64: add instruction tests: M-S (#1422) aarch64: add instruction tests: C-L (#1421) aarch64: add instruction tests: A-B (#1420) aarch64: add everything except instructions (#1418) fixup: support ARM64 in '_reg_name' Revert "fixup: remove x86-specific code from '_reg_name'" review: avoid wildcard imports review: rename the file fixup: remove x86-specific code from '_reg_name' fixup: do not use relative imports Generates a more sensible symbolic default for constructor arguments (#1414) aarch64: add instructions aarch64: add everything except instructions Switches the Travis-CI badge from .org to .com (#1416) Performance optimization : use set instead of list (#1415) ...
Based on disconnect3d/aarch64/skeleton.
This change is