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