|
From: Philippe W. <phi...@sk...> - 2016-11-17 20:01:10
|
On Thu, 2016-11-17 at 11:25 -0800, Carl E. Love wrote:
> I have put debug statements into this code for both the inner and outer
> valgrind trees. The value returned by VG_MINIMAL_SETJMP() is 1 for the
> outer Valgrind and thus have_isa_2_07 is set to False. For the inner
> valgrind, the return value is 0 and we do not change have_isa_2_07.
>
> I have studied up a little on the setjump/longjump stuff. At this point,
> I don't know why they don't seem to work in the inner Valgrind. I was
> wondering if anyone had any insight it doesn't work on the inner?
I am guessing that VG_MINIMAL_SETJMP is in fact working.
I am guessing that the difference is:
* the outer checks that a capability is (or is not) supported by
trying an instruction.
If the instruction is not supported, a LONGJMP will happen.
On Power 7, that is what happens in the outer, as the outer runs
on the real (hw) cpu.
* When the inner runs, it runs on the CPU simulated by the outer.
Now, if the outer just executes this instruction without checking
the hw cap of the physical cpu (and runs the IR code retranslated
in other instructions), then the inner believes it is on a different
cpu than the hw cpu.
More generally, we might improve on the way to control the virtual
cpu provided by valgrind.
For example, we might imagine to have some command line flags
to specify what 'hw features' to simulate.
Of course, when translating to real instructions, only the really
available hw instructions can be generated (which means that it might
not be possible to accept all instructions in the virtual cpu).
Philippe
|