freebsd-nq/sys/i386/include
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
..
pc
xen
_align.h
_bus.h
_inttypes.h
_limits.h
_stdint.h
_types.h
acpica_machdep.h
apm_bios.h
apm_segments.h
asm.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
asmacros.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
atomic.h For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE 2017-02-03 12:51:40 +00:00
bootinfo.h
bus_dma.h
bus.h
clock.h
counter.h
cpu.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
cpufunc.h Don't access the reserved registers %dr4 and %dr5 on i386. 2017-03-17 13:49:05 +00:00
cputypes.h Remove 'cpu' and 'cpu_class' on amd64. 2016-09-15 17:05:54 +00:00
cserial.h Fix improper use of "its". 2016-11-08 23:59:41 +00:00
db_machdep.h Determine the operand/address size of %cs in a new function 2016-09-25 16:30:29 +00:00
dump.h
efi.h Fix building on i386 and arm. But 'public domain' headers on the files 2016-10-13 06:56:23 +00:00
elan_mmcr.h
elf.h
endian.h
exec.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
fdt.h
float.h
floatingpoint.h
frame.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
gdb_machdep.h
ieeefp.h
if_wl_wavelan.h
in_cksum.h
intr_machdep.h
ioctl_bt848.h
ioctl_meteor.h
iodev.h
kdb.h
limits.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
md_var.h Remove 'cpu' and 'cpu_class' on amd64. 2016-09-15 17:05:54 +00:00
memdev.h
metadata.h
minidump.h
mp_watchdog.h
nexusvar.h
npx.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
ofw_machdep.h
param.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
pcaudioio.h
pcb_ext.h
pcb.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
pci_cfgreg.h
pcpu.h Implement get_pcpu() for i386 and use it to replace pcpu_find(curcpu) 2017-01-29 16:54:55 +00:00
perfmon.h
pmap.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
pmc_mdep.h
ppireg.h
proc.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
profile.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
psl.h
ptrace.h
pvclock.h
reg.h
reloc.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
resource.h
runq.h
segments.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
setjmp.h
sf_buf.h
sigframe.h
signal.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
smapi.h
smp.h
speaker.h
specialreg.h
stack.h
stdarg.h
sysarch.h
timerreg.h
trap.h
tss.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
ucontext.h
varargs.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
vdso.h
vm86.h
vm.h
vmparam.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
xbox.h