freebsd-dev/sys/i386/include
John Baldwin c45cbc7a1f Don't reset memory attributes when mapping physical addresses for ACPI.
Previously, AcpiOsMemory was using pmap_mapbios which would always map
the requested address Write-Back (WB).  For several AMD Ryzen laptops,
the BIOS uses AcpiOsMemory to directly access the PCI MCFG region in
order to access PCI config registers.  This has the side effect of
remapping the MCFG region in the direct map as WB instead of UC
hanging the laptops during boot.

On the one laptop I examined in detail, the _PIC global method used to
switch from 8259A PICs to I/O APICs uses a pair of PCI config space
registers at offset 0x84 in the device at 0:0:0 to as a pair of
address/data registers to access an indirect register in the chipset
and clear a single bit to switch modes.

To fix, alter the semantics of pmap_mapbios() such that it does not
modify the attributes of any existing mappings and instead uses the
existing attributes.  If a new mapping is created, this new mapping
uses WB (the default memory attribute).

Special thanks to the gentleman whose name I don't have who brought
two affected laptops to the hacker lounge at BSDCan.  Direct access to
the affected systems permitted finding the root cause within an hour
or so.

PR:		231760, 236899
Reviewed by:	kib, alc
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D20327
2019-08-03 01:36:05 +00:00
..
pc i386 4/4G split. 2018-04-13 20:30:49 +00:00
xen
_align.h
_bus.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
_inttypes.h
_limits.h
_stdint.h
_types.h
acpica_machdep.h
apm_bios.h
apm_segments.h
asm.h Remove lint support from system headers and MD x86 headers. 2017-11-23 11:40:16 +00:00
asmacros.h Fix recent breakages of kernel profiling, mostly on i386 (high resolution 2018-06-02 04:25:09 +00:00
atomic.h Implement missing atomic_fcmpset_XXX() support for i386. 2018-08-09 11:30:13 +00:00
bootinfo.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
bus_dma.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
bus.h
clock.h re-synchronize TSC-s on SMP systems after resume, if necessary 2018-05-25 07:33:20 +00:00
counter.h i386: Do not ever store to other-CPU counter64 slot. 2019-02-03 21:28:58 +00:00
cpu.h Add a custom implementation of cpu_lock_delay() for x86. 2018-11-05 22:54:03 +00:00
cpufunc.h Provide convenience C wrappers for RDPKRU and WRPKRU instructions. 2019-02-19 19:17:20 +00:00
cputypes.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
cserial.h Fix misspellings of transmitter/transmitted 2018-08-10 20:37:32 +00:00
db_machdep.h Cleanups related to debug exceptions on x86. 2018-05-22 00:45:00 +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 sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
elf.h
endian.h
exec.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
fdt.h
float.h
floatingpoint.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
frame.h i386 4/4G split. 2018-04-13 20:30:49 +00:00
gdb_machdep.h amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits 2018-03-06 14:28:37 +00:00
ieeefp.h Resolve conflicts between macros in fenv.h and ieeefp.h 2018-05-31 20:22:47 +00:00
if_wl_wavelan.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
in_cksum.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
intr_machdep.h Merge amd64 and i386 <machine/intr_machdep.h> headers. 2018-08-20 12:31:39 +00:00
ioctl_bt848.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
ioctl_meteor.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
iodev.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
kdb.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
limits.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
md_var.h i386: Merge PAE and non-PAE pmaps into same kernel. 2019-01-30 02:07:13 +00:00
memdev.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
metadata.h
minidump.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
mp_watchdog.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
nexusvar.h
npx.h Remove unused error return from API that cannot fail 2018-02-23 20:15:19 +00:00
ofw_machdep.h
param.h i386: Merge PAE and non-PAE pmaps into same kernel. 2019-01-30 02:07:13 +00:00
pcb_ext.h Remove dead declaration. 2018-05-11 20:47:45 +00:00
pcb.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
pci_cfgreg.h
pcpu.h Mitigations for Microarchitectural Data Sampling. 2019-05-14 17:02:20 +00:00
perfmon.h
pmap_base.h Don't reset memory attributes when mapping physical addresses for ACPI. 2019-08-03 01:36:05 +00:00
pmap_nopae.h i386 PAE: avoid atomic for pte_store() where possible. 2019-02-26 09:45:44 +00:00
pmap_pae.h i386 PAE: avoid atomic for pte_store() where possible. 2019-02-26 09:45:44 +00:00
pmap.h Add kernel support for Intel userspace protection keys feature on 2019-02-20 09:51:13 +00:00
pmc_mdep.h hwpmc: ABI fixes 2018-06-04 02:05:48 +00:00
ppireg.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
proc.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
procctl.h amd64 KPTI: add control from procctl(2). 2019-03-16 11:44:33 +00:00
profile.h Oops, the last minute reduction in the clobber list for i386 2018-06-02 09:59:27 +00:00
psl.h
ptrace.h
pvclock.h
reg.h
reloc.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
resource.h
runq.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
segments.h i386 4/4G split. 2018-04-13 20:30:49 +00:00
setjmp.h
sf_buf.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
sigframe.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
signal.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
smapi.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
smp.h x86: improve reservation of AP trampoline memory 2018-04-05 14:39:51 +00:00
speaker.h
specialreg.h
stack.h
stdarg.h
sysarch.h
timerreg.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
trap.h
tss.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
ucontext.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
vdso.h
vm86.h i386: Merge PAE and non-PAE pmaps into same kernel. 2019-01-30 02:07:13 +00:00
vm.h sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
vmparam.h i386: Merge PAE and non-PAE pmaps into same kernel. 2019-01-30 02:07:13 +00:00