freebsd-dev/sys
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
..
amd64 Don't reset memory attributes when mapping physical addresses for ACPI. 2019-08-03 01:36:05 +00:00
arm Remove gzip'ed a.out support. 2019-07-30 05:13:16 +00:00
arm64 Because of AArch64's weak memory consistency model, we need to include a 2019-08-02 22:36:42 +00:00
bsm
cam Reenable UNMAP support on ramdisks by default. 2019-07-27 18:07:46 +00:00
cddl Allow Kernel to link in both legacy libkern/zlib and new sys/contrib/zlib, 2019-08-01 06:35:33 +00:00
compat Make randomized stack gap between strings and pointers to argv/envs. 2019-07-31 20:23:10 +00:00
conf This adds the third step in getting BBR into the tree. BBR and 2019-08-01 14:17:31 +00:00
contrib MFC after: 3 days 2019-08-02 22:58:45 +00:00
crypto aesni(4): Fix trivial type typo 2019-05-27 00:47:51 +00:00
ddb ddb show proc typo 2019-06-22 05:35:23 +00:00
dev Decode few more NVMe log pages. 2019-08-02 20:16:21 +00:00
dts dtso: allwinner: Add an overlay for H3 i2c0 2019-07-20 17:42:46 +00:00
fs Try to decrease the number of bugs in unionfs after the VV_TEXT flag removal. 2019-08-01 14:40:37 +00:00
gdb
geom gnop: style nits 2019-07-31 17:51:06 +00:00
gnu
i386 Don't reset memory attributes when mapping physical addresses for ACPI. 2019-08-03 01:36:05 +00:00
isa
kern Set ISOPEN in namei flags when opening executable interpreters. 2019-08-03 01:02:52 +00:00
kgssapi Make the warning intervals for deprecated crypto algorithms tunable. 2019-06-11 23:00:55 +00:00
libkern Allow Kernel to link in both legacy libkern/zlib and new sys/contrib/zlib, 2019-08-01 06:35:33 +00:00
mips Avoid relying on header pollution from sys/refcount.h. 2019-07-29 20:26:01 +00:00
modules Allow Kernel to link in both legacy libkern/zlib and new sys/contrib/zlib, 2019-08-01 06:35:33 +00:00
net iflib: Prevent kernel panic caused by loading driver with a specific interrupt configuration 2019-08-01 17:37:25 +00:00
net80211 Enhance the comment ieee80211_add_channel() to avoid a 2019-06-10 14:31:18 +00:00
netgraph
netinet Fix !INET build. 2019-08-02 22:43:09 +00:00
netinet6 frag6.c: make compile with gcc 2019-08-02 11:05:00 +00:00
netipsec netipsec key_register: check for M_NOWAIT alloc failure 2019-06-25 15:43:52 +00:00
netpfil pf: zero (another) output buffer in pfioctl 2019-07-31 16:58:09 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Fix prio vs. nonprio tagged traffic in RDMACM 2019-06-04 06:21:31 +00:00
opencrypto Allow Kernel to link in both legacy libkern/zlib and new sys/contrib/zlib, 2019-08-01 06:35:33 +00:00
powerpc powerpc/powernv: Only clear EEH freeze for some errors 2019-08-01 03:59:25 +00:00
riscv riscv: Fix copyin/copyout 2019-07-29 14:59:14 +00:00
rpc Avoid relying on header pollution from sys/refcount.h. 2019-07-29 20:26:01 +00:00
security
sparc64 Don't pass error from syscallenter() to syscallret(). 2019-07-15 21:25:16 +00:00
sys Allow Kernel to link in both legacy libkern/zlib and new sys/contrib/zlib, 2019-08-01 06:35:33 +00:00
teken
tests
tools Add SDIO support. 2019-06-08 16:26:56 +00:00
ufs When updating the user or group disk quotas for the return of inodes or 2019-07-31 22:44:58 +00:00
vm Centralize the logic in vfs_vmio_unwire() and sendfile_free_page(). 2019-07-29 22:01:28 +00:00
x86 PR: 239143 2019-07-14 21:08:54 +00:00
xdr
xen
Makefile