blob: 6a374c42345cb20adf8c10ce177eced7b8163079 [file] [log] [blame]
sewardj4ec8a632005-05-11 23:37:18 +0000111 May 05
2~~~~~~~~~
sewardj0be26102005-05-14 11:18:31 +00003ToDo: vex-amd64: check above/below the line for reg-alloc
sewardj4ec8a632005-05-11 23:37:18 +00004
sewardj045a4052005-04-23 22:42:27 +0000523 Apr 05 (memcheck-on-amd64 notes)
6~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sewardj9b3328d2005-04-24 00:04:42 +00007* If a thread is given an initial stack with address range [lo .. hi],
njna60a7c12005-05-08 17:49:37 +00008 we need to tell memcheck that the area [lo - VGA_STACK_REDZONE_SZB
sewardj9b3328d2005-04-24 00:04:42 +00009 .. hi] is valid, rather than just [lo .. hi] as has been the case on
10 x86-only systems. However, am not sure where to look for the call
11 into memcheck that states the new stack area.
sewardj045a4052005-04-23 22:42:27 +000012
sewardj045a4052005-04-23 22:42:27 +000013
sewardj2c96ea52005-04-09 18:25:06 +0000149 Apr 05 (starting work on memcheck for 32/64-bit and big/little endian)
15~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
njn44acd3e2005-05-13 21:39:45 +000016* get rid of include/tool_asm.h. I think
17 this is left over from single-platform days, when it made
sewardj2c96ea52005-04-09 18:25:06 +000018 sense to have tool-helpers written in assembly. Looks like we
19 need to retain coregrind/core_asm.h, though.
20
njn44acd3e2005-05-13 21:39:45 +000021 [tool_asm.h will need to remain in some form -- there are still assembly
22 files that need to see VG_() and related macros. --njn]
njn7f7e7df2005-04-21 22:11:46 +000023
sewardj2c96ea52005-04-09 18:25:06 +000024
sewardj9926dce2005-03-23 13:31:48 +00002523 March 05
26~~~~~~~~~~~
27Do we still need ARCH_PTHREQ_RET (or *PTHREQ* for that matter) ?
28
sewardj21c25812005-03-11 03:07:23 +000029Notes pertaining to the 2.4.0 - 3.0 merge
30~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31As of 10 March (svn rev 3266, vex svn rev 1019) the merged code base
32can start and run programs with --tool=none. Both threaded and
33unthreaded programs appear to work (knode, opera, konqueror).
sewardjf15bba62005-03-02 14:22:49 +000034
sewardj21c25812005-03-11 03:07:23 +000035Known breakage is:
36
37* Basically only x86 works. I was part-way through getting amd64
38 to work when I stopped to do the merge. I think you can assume
39 amd64 is pretty much knackered right now.
40
41* No other tools work. Memcheck worked fine in 3.0 prior to the
42 merge but needs to have Jeremy's space-saving hacks folded in.
43 Also the leak checker improvements. Ditto addrcheck.
44 Cachegrind is broken because it is not Vex-aware, and Vex needs
45 to be changed to convey info on instruction boundaries to it.
46 Helgrind is not Vex aware. Also, Helgrind will not work because
47 thread-event-modelling does not work (see below). Memcheck
48 and Addrcheck could be made to work with minor effort, and
49 that should happen asap. Cachegrind also needs to be fixed
50 shortly.
51
52* Function wrapping a la 2.4.0 is disabled, and will likely remain
53 disabled for an extended period until I consider the software
54 engineering consequences of it, specifically if a cleaner
55 implementation is possible. Result of that is that thread-event
56 modelling and Helgrind are also disabled for that period.
57
sewardj21c25812005-03-11 03:07:23 +000058* signal contexts for x86 signal deliveries are partially broken. On
59 delivery of an rt-signal, a context frame is built, but only the 8
60 integer registers and %eflags are written into it, no SSE and no FP
61 state. Also, the vcpu state is restored on return to whatever it
62 was before the signal was delivered; it is not restored from the
63 sigcontext offered to the handler. That means handlers which
64 expect to be able to modify the machine state will not work.
65 This will be fixed; it requires a small amount of work on the
66 Vex side.
67
68* I got rid of extra UInt* flags arg for syscall pre wrappers,
69 so they can't add MayBlock after examining the args. Should
70 be reinstated. I commented out various *flags |= MayBlock"
71 so they can easily enough be put back in.
72
73* Tracking of device segments is somehow broken (I forget how)
74
sewardjd1212b92005-03-11 12:43:19 +000075* Core dumping is disabled (has been for a while in the 3.0 line)
76 because it needs to be factored per arch (or is it per arch+os).
77
sewardj21c25812005-03-11 03:07:23 +000078
79Other notes I made:
80
81* Check tests/filter_stderr_basic; I got confused whilst merging it
82
83* Dubious use of setjmp in run_thread_for_a_while -- I thought it
84 was only OK to use setjmp as the arg of an if: if (setjmp(...)) ...
85
86* EmWarn/Int confusion -- what type is it in the guest state?
87
88* Reinstate per-thread dispatch ctrs. First find out what the
89 rationale for per-thread counters is.
90
91* main: TL_(fini) is not given exitcode and it should be.
92
93* Prototype for VG_(_client_syscall) [note leading _] is in a
94 bad place.
95
96(It was a 3-way merge, using the most recent common ancestor
97 of the 2.4.0 and 3.0 lines:
98
99 cvs co -D "11/19/2004 17:45:00 GMT" valgrind
100
101 and the 2.4.0 line
102
103 obtained at Fri Mar 4 15:52:46 GMT 2005 by:
104 cvs co valgrind
105
106 and the 3.0 line, which is svn revision 3261.
107)
108
109
110Cleanup notes derived from making AMD64 work. JRS, started 2 March 05.
111~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sewardjf15bba62005-03-02 14:22:49 +0000112The following cleanups need to be done.
113
114AMD64 vsyscalls
115~~~~~~~~~~~~~~~
116The redirect mechanism should (could) be used to support vsyscalls on
117both amd64 and x86, by redirecting jumps to the vsyscall entry
118point(s) to appropriate helper stubs instead. There is no point in
119using the current x86 scheme of copying the trampoline code around the
120place and making the AT_SYSINFO entry point at it, as that mechanism
121does not work on amd64.
122
123On x86-linux, the vsyscall address is whatever the AT_SYSINFO entry
124says it is. Reroute all jumps to that to a suitable stub.
125
126On amd64, there are multiple vsyscall entry points at -10M +
1271024*vsyscall_no (currently there are only two). These each need to be
128redirected to suitable stubs which do normal syscalls instead.
129
130These redirects should be set up as part of platform-specific
131initialisation sequences. They should not be set up as at present in
132vg_symtab2.c. All this stuff should be within platform-specific
133startup code, and should not be visible in generic core service code.
134
135
136Redirection mechanism
137~~~~~~~~~~~~~~~~~~~~~
sewardj21c25812005-03-11 03:07:23 +0000138How this works is difficult to understand. This should be fixed. The
139list of unresolved redirections should be a seperate data structure
140from the currently active (addr, addr) mapping.
sewardjf15bba62005-03-02 14:22:49 +0000141
142There's a whole big #ifdef TEST section in vg_symtab2.c which has
143no apparent purpose.
144
sewardj6941a1a2005-03-02 16:01:23 +0000145The redirecting-symtab-loader seems like a good idea on the face
146of it: you can write functions whose name says, in effect
147 "i_am_a_replacement_for_FOO"
148and then all jumps/calls to FOO get redirected there. Problem is
149that nameing mechanism involves $ signs etc in symbol names, which
150makes it very fragile. TODO: (1) figure out if we still need
151this, and if so (2) fix.
152
sewardjf15bba62005-03-02 14:22:49 +0000153
154System call handlers
155~~~~~~~~~~~~~~~~~~~~
156The pre/post functions should be factored into: marshallers, which get
157the syscall args from wherever they live, and handlers proper, which
158do whatever pre/post checks/hanldling is needed. The handlers are
159more or less platform independent. The marshallers insulate the
160handlers from details of knowing how to get hold of syscall arg/result
161values given that different platforms use different and sometimes
162strange calling conventions.
163
164The syscall handlers assume that the result register (RES) does not
165overlap with any argument register (ARGn). They assume this by
166blithely referring to ARGn in the post-handlers. This should be fixed
167properly -- before the call, a copy of the args should be saved so
168they can be safely inspected after the call.
169
170The mechanisms by which a pre-handler can complete a syscall itself
171without handing it off to the kernel need to be cleaned up. The
172"Special" syscall designation no longer really makes sense (it never
173did) and should be removed.
174
sewardj6941a1a2005-03-02 16:01:23 +0000175Sockets: move the socketcall marshaller from vg_syscalls.c into
176x86-linux/syscalls.c; it is in the wrong place.
sewardjf15bba62005-03-02 14:22:49 +0000177