blob: 1f69dce84821f5ee5a8fd9922e380f5c33bb70e7 [file] [log] [blame]
sewardjf0c12502014-01-12 12:54:00 +00001
sewardj383d5d32014-01-13 11:50:17 +00002Status
3~~~~~~
sewardjf0c12502014-01-12 12:54:00 +00004
sewardj383d5d32014-01-13 11:50:17 +00005As of Jan 2014 the trunk contains a port to AArch64 ARMv8 -- loosely,
6the 64-bit ARM architecture. Currently it supports integer and FP
sewardjfc073c32014-01-15 14:30:24 +00007instructions and can run almost anything generated by gcc-4.8.2 -O2.
sewardj383d5d32014-01-13 11:50:17 +00008The port is under active development.
sewardjf0c12502014-01-12 12:54:00 +00009
sewardj263298b2014-03-18 23:03:38 +000010Current limitations, as of mid-March 2014.
sewardjf0c12502014-01-12 12:54:00 +000011
sewardj3690e682014-02-21 14:54:51 +000012* limited support of vector (SIMD) instructions. Initial target is
13 support for instructions created by gcc-4.8.2 -O3 (via vectorisation).
14 This is mostly complete.
sewardj383d5d32014-01-13 11:50:17 +000015
philippe3ef45eb2014-02-12 00:02:05 +000016* Integration with the built in GDB server:
sewardj3690e682014-02-21 14:54:51 +000017 - basically works but breakpoints may be problematic (unclear)
philippe7c2800a2014-02-12 20:48:18 +000018 Use --vgdb=full to bypass the problem.
philippe3ef45eb2014-02-12 00:02:05 +000019 - still to do:
philippe7c2800a2014-02-12 20:48:18 +000020 arm64 xml register description files (allowing shadow registers
21 to be looked at).
philippe3ef45eb2014-02-12 00:02:05 +000022 ptrace invoker : currently disabled for both arm and arm64
23 cpsr transfer to/from gdb to be looked at (see also arm equivalent code)
sewardj383d5d32014-01-13 11:50:17 +000024
sewardj3690e682014-02-21 14:54:51 +000025* limited syscall support
26
sewardj383d5d32014-01-13 11:50:17 +000027There has been extensive testing of the baseline simulation of integer
28and FP instructions. Memcheck is also believed to work, at least for
29small examples. Other tools appear to at least not crash when running
30/bin/date.
31
sewardj263298b2014-03-18 23:03:38 +000032Enough syscalls and instructions are supported for substantial
33programs to work. Firefox 26 is able to start up and quit. The noise
34level from Memcheck is low enough to make it practical to use for real
35debugging.
sewardj3690e682014-02-21 14:54:51 +000036
sewardj383d5d32014-01-13 11:50:17 +000037
38Building
39~~~~~~~~
40
41You could probably build it directly on a target OS, using the normal
42non-cross scheme
43
44 ./autogen.sh ; ./configure --prefix=.. ; make ; make install
45
46Development so far was however done by cross compiling, viz:
47
48 export CC=aarch64-linux-gnu-gcc
49 export LD=aarch64-linux-gnu-ld
50 export AR=aarch64-linux-gnu-ar
51
52 ./autogen.sh
53 ./configure --prefix=`pwd`/Inst --host=aarch64-unknown-linux \
54 --enable-only64bit
55 make -j4
56 make -j4 install
57
58Doing this assumes that the install path (`pwd`/Inst) is valid on
59both host and target, which isn't normally the case. To avoid
60this limitation, do instead:
61
62 ./configure --prefix=/install/path/on/target \
63 --host=aarch64-unknown-linux \
64 --enable-only64bit
65 make -j4
66 make -j4 install DESTDIR=/a/temp/dir/on/host
67 # and then copy the contents of DESTDIR to the target.
68
69See README.android for more examples of cross-compile building.
70
71
72Implementation tidying-up/TODO notes
73~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sewardjf0c12502014-01-12 12:54:00 +000074
75UnwindStartRegs -- what should that contain?
76
77
sewardjf0c12502014-01-12 12:54:00 +000078vki-arm64-linux.h: vki_sigaction_base
sewardjf0c12502014-01-12 12:54:00 +000079I really don't think that __vki_sigrestore_t sa_restorer
80should be present. Adding it surely puts sa_mask at a wrong
81offset compared to (kernel) reality. But not having it causes
82compilation of m_signals.c to fail in hard to understand ways,
83so adding it temporarily.
84
85
86m_trampoline.S: what's the unexecutable-insn value? 0xFFFFFFFF
87is there at the moment, but 0x00000000 is probably what it should be.
88Also, fix indentation/tab-vs-space stuff
89
90
91./include/vki/vki-arm64-linux.h: uses __uint128_t. Should change
92it to __vki_uint128_t, but what's the defn of that?
93
94
sewardjf0c12502014-01-12 12:54:00 +000095m_debuginfo/priv_storage.h: need proper defn of DiCfSI
96
97
98readdwarf.c: is this correct?
99#elif defined(VGP_arm64_linux)
100# define FP_REG 29 //???
101# define SP_REG 31 //???
102# define RA_REG_DEFAULT 30 //???
103
104
105vki-arm64-linux.h:
106re linux-3.10.5/include/uapi/asm-generic/sembuf.h
107I'd say the amd64 version has padding it shouldn't have. Check?
108
109
sewardjf0c12502014-01-12 12:54:00 +0000110syswrap-linux.c run_a_thread_NORETURN assembly sections
111seems like tst->os_state.exitcode has word type
112in which case the ppc64_linux use of lwz to read it, is wrong
113
114
sewardjf0c12502014-01-12 12:54:00 +0000115syswrap-linux.c ML_(do_fork_clone)
116assuming that VGP_arm64_linux is the same as VGP_arm_linux here
117
118
sewardjf0c12502014-01-12 12:54:00 +0000119dispatch-arm64-linux.S: FIXME: set up FP control state before
120entering generated code. Also fix screwy indentation.
121
sewardj383d5d32014-01-13 11:50:17 +0000122
sewardjf0c12502014-01-12 12:54:00 +0000123dispatcher-ery general: what's a good (predictor-friendly) way to
124branch to a register?
125
126
sewardjf0c12502014-01-12 12:54:00 +0000127in vki-arm64-scnums.h
128//#if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
129Probably want to reenable that and clean up accordingly
130
131
sewardjf0c12502014-01-12 12:54:00 +0000132putIRegXXorZR: figure out a way that the computed value is actually
133used, so as to keep any memory reads that might generate it, alive.
134(else the simulation can lose exceptions). At least, for writes to
135the zero register generated by loads .. or .. can anything other
136integer instructions, that write to a register, cause exceptions?
137
138
sewardjf0c12502014-01-12 12:54:00 +0000139loads/stores: generate stack alignment checks as necessary
140
141
sewardjf0c12502014-01-12 12:54:00 +0000142fix barrier insns: ISB, DMB
143
144
sewardjf0c12502014-01-12 12:54:00 +0000145fix atomic loads/stores
146
147
sewardjf0c12502014-01-12 12:54:00 +0000148FMADD/FMSUB/FNMADD/FNMSUB: generate and use the relevant fused
149IROps so as to avoid double rounding
150
151
sewardjf0c12502014-01-12 12:54:00 +0000152ARM64Instr_Call getRegUsage: re-check relative to what
153getAllocableRegs_ARM64 makes available
154
155
sewardjf0c12502014-01-12 12:54:00 +0000156Make dispatch-arm64-linux.S save any callee-saved Q regs
157I think what is required is to save D8-D15 and nothing more than that.
158
159
sewardjf0c12502014-01-12 12:54:00 +0000160wrapper for __NR3264_fstat -- correct?
161
162
sewardj383d5d32014-01-13 11:50:17 +0000163PRE(sys_clone): get rid of references to vki_modify_ldt_t and the
164definition of it in vki-arm64-linux.h. Ditto for 32 bit arm.
sewardjf0c12502014-01-12 12:54:00 +0000165
166
167sigframe-arm64-linux.c: build_sigframe: references to nonexistent
168siguc->uc_mcontext.trap_no, siguc->uc_mcontext.error_code have been
169replaced by zero. Also in synth_ucontext.
170
171
sewardjf0c12502014-01-12 12:54:00 +0000172m_debugger.c:
173uregs.pstate = LibVEX_GuestARM64_get_nzcv(vex); /* is this correct? */
174Is that remotely correct?
175
176
sewardjf0c12502014-01-12 12:54:00 +0000177host_arm64_defs.c: emit_ARM64INstr:
178ARM64in_VDfromX and ARM64in_VQfromXX: use simple top-half zeroing
179MOVs to vector registers instead of INS Vd.D[0], Xreg, to avoid false
180dependencies on the top half of the register. (Or at least check
sewardj383d5d32014-01-13 11:50:17 +0000181the semantics of INS Vd.D[0] to see if it zeroes out the top.)
sewardjf0c12502014-01-12 12:54:00 +0000182
183
184preferredVectorSubTypeFromSize: review perf effects and decide
185on a types-for-subparts policy
186
187
sewardjf0c12502014-01-12 12:54:00 +0000188fold_IRExpr_Unop: add a reduction rule for this
1891Sto64(CmpNEZ64( Or64(GET:I64(1192),GET:I64(1184)) ))
190vis 1Sto64(CmpNEZ64(x)) --> CmpwNEZ64(x)
191
192
sewardjf0c12502014-01-12 12:54:00 +0000193check insn selection for memcheck-only primops:
194Left64 CmpwNEZ64 V128to64 V128HIto64 1Sto64 CmpNEZ64 CmpNEZ32
195widen_z_8_to_64 1Sto32 Left32 32HLto64 CmpwNEZ32 CmpNEZ8
196
197
sewardjf0c12502014-01-12 12:54:00 +0000198isel: get rid of various cases where zero is put into a register
199and just use xzr instead. Especially for CmpNEZ64/32. And for
200writing zeroes into the CC thunk fields.
201
202
sewardjf0c12502014-01-12 12:54:00 +0000203/* Keep this list in sync with that in iselNext below */
204/* Keep this list in sync with that for Ist_Exit above */
205uh .. they are not in sync
206
207
sewardjf0c12502014-01-12 12:54:00 +0000208very stupid:
209imm64 x23, 0xFFFFFFFFFFFFFFA0
21017 F4 9F D2 F7 FF BF F2 F7 FF DF F2 F7 FF FF F2
211
212
sewardjf0c12502014-01-12 12:54:00 +0000213valgrind.h: fix VALGRIND_ALIGN_STACK/VALGRIND_RESTORE_STACK,
214also add CFI annotations
sewardjfdaf9e42014-01-13 00:18:51 +0000215
216
sewardjfdaf9e42014-01-13 00:18:51 +0000217could possibly bring r29 into use, which be useful as it is
218callee saved
sewardj383d5d32014-01-13 11:50:17 +0000219
220
221ubfm/sbfm etc: special case cases that are simple shifts, as iropt
222can't always simplify the general-case IR to a shift in such cases.
sewardj1cd6c902014-02-05 11:02:34 +0000223
224
225LDP,STP (immediate, simm7) (FP&VEC)
226should zero out hi parts of dst registers in the LDP case
227
228
229DUP insns: use Iop_Dup8x16, Iop_Dup16x8, Iop_Dup32x4
230rather than doing it "by hand"
231
232
233Any place where ZeroHI64ofV128 is used in conjunction with
234FP vector IROps: find a way to make sure that arithmetic on
235the upper half of the values is "harmless."
236
237
238math_MINMAXV: use real Iop_Cat{Odd,Even}Lanes ops rather than
239inline scalar code
sewardj3690e682014-02-21 14:54:51 +0000240
241
242chainXDirect_ARM64: use direct jump forms when possible