The value in DR6 (the debug status register) in a process being traced using ptrace is intermittently reported to be an inconsistent value.<br />
<br />
We see three manifestations of this problem, let's call them A, B and C. In A, DR6 in a tracee in a VM reliably reports that no watchpoints have fired, despite a watchpoint having been set and a SIGTRAP having been observed by the debugger. In B, DR6 in a tracee in a VM reliably reports that the watchpoint 0 has fired, regardless of which watchpoint was requested to be set in DR7 (the debug control register). (In this case, the single-step flag is also set, meaning that the contents of DR6 are 0x4001.) In C, DR6 in the *host* system *intermittently* behaves according to manifestation B.<br />
<br />
We can reproduce this problem reliably on our AMD system. We don't see the problem on Intel, and we don't see the problem before the VMs have been started.<br />
<br />
In an attempt to fix the problem, we've applied some patches to KVM and rebuilt/reloaded the kvm.ko and kvm-amd.ko modules.<br />
<br />
The following patch fixes manifestation A:<br />
<br />
<a href="http://markmail.org/message/7kt2gufxre3wgonz">http://markmail.org/message/7kt2gufxre3wgonz</a> [<a href="http://markmail.org/message/7kt2gufxre3wgonz" target="_blank">^</a>]<br />
<br />
And the following patch fixes manifestation B:<br />
<br />
<a href="http://markmail.org/message/wdgqjpabvqekqspl">http://markmail.org/message/wdgqjpabvqekqspl</a> [<a href="http://markmail.org/message/wdgqjpabvqekqspl" target="_blank">^</a>]<br />
<br />
However, having applied these, the problem is fixed in the VMs, but not in the host system, which exhibits the bug in the same way as before (manifestation C).
↧