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