freebsd-dev/sys/amd64
Bruce Evans ff17a6773e Don't access the reserved registers %dr4 and %dr5 on i386.
On the original i386, %dr[4-5] were unimplemented but not very clearly
reserved, so debuggers read them to print them.  i386 was still doing
this.

On the original athlon64, %dr[4-5] are documented as reserved but are
aliased to %dr[6-7] unless CR4_DE is set, when accessing them traps.

On 2 of my systems, accessing %dr[4-5] trapped sometimes.  On my Haswell
system, the apparent randomness was because the boot CPU starts with
CR4_DE set while all other CPUs start with CR4_DE clear.  FreeBSD
doesn't support the data breakpoints enabled by CR4_DE and it never
changes this flag, so the flag remains different across CPUs and
the behaviour seemed inconsistent except while booting when the CPU
doesn't change.

The invalid accesses broke:
- read access for printing the registers in ddb "show watches" on CPUs
  with CR4_DE set
- read accesses in fill_dbregs() on CPUs with CR4_DE set.  This didn't
  implement panic(3) since the user case always skipped %dr[4-5].
- write accesses in set_dbregs().  This also didn't affect userland.
  When it didn't trap, the aliasing made it fragile.

Don't print the dummy (zero) values of %dr[4-5] in "show watches" for
i386 or amd64.  Fix style bugs near this printing.

amd64 also has space in the dbregs struct for the reserved %dr[8-15]
and already didn't print the dummy values for these, and never accessed
any of the 10 reserved debug registers.

Remove cpufuncs for making the invalid accesses.  Even amd64 had these.
2017-03-17 13:49:05 +00:00
..
acpica sys/amd64: Small spelling fixes. 2016-05-03 22:13:04 +00:00
amd64 Don't access the reserved registers %dr4 and %dr5 on i386. 2017-03-17 13:49:05 +00:00
cloudabi32 Catch up with changes to structure member names. 2017-01-17 22:05:52 +00:00
cloudabi64 Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
conf Remove i915drm and radeondrm from NOTES and conf. 2017-03-12 00:52:16 +00:00
ia32 Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
include Don't access the reserved registers %dr4 and %dr5 on i386. 2017-03-17 13:49:05 +00:00
linux Reduce code duplication between MD Linux code by moving SYSV IPC 64-bit 2017-03-07 17:07:16 +00:00
linux32 Reduce code duplication between MD Linux code by moving SYSV IPC 64-bit 2017-03-07 17:07:16 +00:00
pci Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
vmm Hide the AMD MONITORX/MWAITX capability. 2017-03-16 03:21:42 +00:00
Makefile Bring the tags and links entries for amd64 up to date. 2015-10-27 22:59:24 +00:00