freebsd-dev/sys/x86
John Baldwin 9e2154ff1c Cleanups related to debug exceptions on x86.
- Add constants for fields in DR6 and the reserved fields in DR7.  Use
  these constants instead of magic numbers in most places that use DR6
  and DR7.
- Refer to T_TRCTRAP as "debug exception" rather than a "trace trap"
  as it is not just for trace exceptions.
- Always read DR6 for debug exceptions and only clear TF in the flags
  register for user exceptions where DR6.BS is set.
- Clear DR6 before returning from a debug exception handler as
  recommended by the SDM dating all the way back to the 386.  This
  allows debuggers to determine the cause of each exception.  For
  kernel traps, clear DR6 in the T_TRCTRAP case and pass DR6 by value
  to other parts of the handler (namely, user_dbreg_trap()).  For user
  traps, wait until after trapsignal to clear DR6 so that userland
  debuggers can read DR6 via PT_GETDBREGS while the thread is stopped
  in trapsignal().

Reviewed by:	kib, rgrimes
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D15189
2018-05-22 00:45:00 +00:00
..
acpica Add Intel Spec Store Bypass Disable control. 2018-05-21 21:08:19 +00:00
bios sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00
cpufreq cpufreq: Remove error-prone table terminators in favor of automatic sizing 2018-04-14 03:15:05 +00:00
include Cleanups related to debug exceptions on x86. 2018-05-22 00:45:00 +00:00
iommu Don't include DMAR map entry zone items in kernel dumps. 2018-02-18 16:03:50 +00:00
isa ANSIfy sys/x86 2018-03-17 01:40:09 +00:00
pci Add ISA PNP tables to ISA drivers. Fix a few incidental comments. 2018-01-29 00:22:30 +00:00
x86 Add Intel Spec Store Bypass Disable control. 2018-05-21 21:08:19 +00:00
xen Fix PCID+PTI pmap operations on Xen/HVM. 2018-05-19 20:28:59 +00:00