|
From: <sv...@va...> - 2012-07-24 20:24:46
|
philippe 2012-07-24 21:24:39 +0100 (Tue, 24 Jul 2012)
New Revision: 12778
Log:
Better document the limitation of gdbsrv for registers and flags values
During investigations of 303963, Josef found that flags are not always
up to date and that --vex-guest-max-insns=1 ensures flags values
are (more?) correct.
=> enhance the paragraph in the gdbserver limitations to reference
this option and give an idea of the performance impact of the other
options helping to increase the precision of registers and flags.
Modified files:
trunk/docs/xml/manual-core-adv.xml
Modified: trunk/docs/xml/manual-core-adv.xml (+18 -6)
===================================================================
--- trunk/docs/xml/manual-core-adv.xml 2012-07-24 20:47:46 +01:00 (rev 12777)
+++ trunk/docs/xml/manual-core-adv.xml 2012-07-24 21:24:39 +01:00 (rev 12778)
@@ -784,12 +784,24 @@
</listitem>
<listitem>
- <para>Registers values.</para>
- <para>When Valgrind gdbserver stops on an error, registers values
- might not be always up to date due to the optimisations done by
- the Valgrind core. The
- option <option>--vex-iropt-precise-memory-exns=yes</option>
- ensures precise registers values by disabling some optimisations.
+ <para>Processor registers and flags values.</para>
+ <para>When Valgrind gdbserver stops on an error, on a breakpoint
+ or when single stepping, registers and flags values might not be always
+ up to date due to the optimisations done by the Valgrind core.
+ Disabling some optimisations using the following options will increase
+ the precision of registers and flags values.
+ An idea of the performance impact for memcheck is given for each option.
+ <itemizedlist>
+ <listitem>
+ <option>--vex-iropt-precise-memory-exns=yes</option> (10% performance impact).
+ </listitem>
+ <listitem>
+ <option>--vex-guest-max-insns=1</option> (200% performance impact).
+ </listitem>
+ <listitem>
+ <option>--vgdb=full</option> (250% performance impact).
+ </listitem>
+ </itemizedlist>
</para>
</listitem>
|
|
From: Julian S. <js...@ac...> - 2012-07-25 07:28:13
|
On Tuesday, July 24, 2012, sv...@va... wrote: > philippe 2012-07-24 21:24:39 +0100 (Tue, 24 Jul 2012) > During investigations of 303963, Josef found that flags are not always > up to date and that --vex-guest-max-insns=1 ensures flags values > are (more?) correct. --vex-guest-max-insns=1 should give exact values for all registers, including flags. If not it's a bug in vex. The performance overhead is terrible, though, especially on targets that depend heavily on the IR optimiser for good performance (ARM, Thumb). I am a bit surprised that --vex-iropt-precise-memory-exns=yes does not give the required results, but maybe I mis-remember the details of how it works. Maybe what we need is a new flag --exact-register-values=no|yes that disables redundant-PUT removal in ir_opt. This should have a relatively small performance overhead and still give exact register values. (Trivial to do for 3.8.0). J |
|
From: Josef W. <Jos...@gm...> - 2012-07-25 10:47:17
|
Am 25.07.2012 09:22, schrieb Julian Seward: > I am a bit surprised that --vex-iropt-precise-memory-exns=yes does not > give the required results, but maybe I mis-remember the details of how > it works. From your other mail I understand that guest state is made up-to-date before memory accesses with --vex-iropt-precise-memory-exns=yes. Then it makes sense that it can go wrong with single-stepping. When investigating bug 303963, I checked flag register state after execution of the pcmpistri instruction, and I got suspicious as flags did not change at all. Even with --vex-iropt-precise-memory-exns=yes. > Maybe what we need is a new flag --exact-register-values=no|yes > that disables redundant-PUT removal in ir_opt. This should have a > relatively small performance overhead and still give exact register > values. (Trivial to do for 3.8.0). Sounds reasonable. So this would be a compromise between performance and correctness when you want consistent register guest state everytime, such as when single-stepping with vgdb... Josef > > J > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers > |
|
From: Julian S. <js...@ac...> - 2012-07-25 13:11:58
|
On Wednesday, July 25, 2012, Josef Weidendorfer wrote: > Am 25.07.2012 09:22, schrieb Julian Seward: > > I am a bit surprised that --vex-iropt-precise-memory-exns=yes does not > > give the required results, but maybe I mis-remember the details of how > > it works. > > From your other mail I understand that guest state is made up-to-date > before memory accesses with --vex-iropt-precise-memory-exns=yes. > Then it makes sense that it can go wrong with single-stepping. > When investigating bug 303963, I checked flag register state after > execution of the pcmpistri instruction, and I got suspicious as flags > did not change at all. Even with --vex-iropt-precise-memory-exns=yes. What I expect, w.r.t. the flag state, is that --vex-iropt-precise-memory-exns=yes does not make it correct, but --vex-guest-max-insns=1 does make it correct. So I am surprised to hear (in other mail from you) that it does not. > > Maybe what we need is a new flag --exact-register-values=no|yes > > that disables redundant-PUT removal in ir_opt. This should have a > > relatively small performance overhead and still give exact register > > values. (Trivial to do for 3.8.0). > > Sounds reasonable. So this would be a compromise between performance > and correctness when you want consistent register guest state everytime, > such as when single-stepping with vgdb... Yes, but it is a pretty good compromise. It should give precise register and flag values for all instructions (iiuc, #include <disclaimer.h>, etc etc) J |
|
From: Josef W. <Jos...@gm...> - 2012-07-25 12:02:56
|
Am 25.07.2012 13:18, schrieb Julian Seward: > What I expect, w.r.t. the flag state, is that > --vex-iropt-precise-memory-exns=yes does not make it correct, but > --vex-guest-max-insns=1 does make it correct. So I am surprised to > hear (in other mail from you) that it does not. Sorry. No surprise. With --vex-guest-max-insns=1 the flags were correct. Josef |