Xen Test Framework
Debug register and control tests

The following general tests are implemented:

  1. Xen, before 46029da12e failed to initialise the guests debug registers correctly. On hardware which supports Restricted Transactional Memory, this becomes visible, as %dr6.rtm appears asserted (clear, for backwards compatibility) despite an RTM #DE not having occurred.

The following PV tests are implemented:

  1. Xen, between 65e3554908 (Introduced in Xen 4.5) and adf8feba1a (Fixed in Xen 4.11) had a bug whereby some writes to %dr7 didn't take immediate effect.

    In practice, this renders guest debugging useless, as the guest kernels context switch of %dr7 fails to take effect until the next full vcpu reschedule.

  2. Xen, before f539ae2706 (Xen 4.11) had a bug whereby a write which cleared %dr7.L/G would leave stale IO shadow state visible in later reads of %dr7.

    Unfortunately, that changeset introduced a second bug, fixed by 237c31b5a1 (Xen 4.11), which caused an attempt to set up an IO breakpoint with %cr4.DE clear to clobber an already configured state, despite the update failing.

See also
tests/debug-regs/main.c