opnsense-src/sys/conf
Konstantin Belousov 6bc6a54280 Add pci_early function to detect Intel stolen memory.
On some Intel devices BIOS does not properly reserve memory (called
"stolen memory") for the GPU.  If the stolen memory is claimed by the
OS, functions that depend on stolen memory (like frame buffer
compression) can't be used.

A function called pci_early_quirks that is called before the virtual
memory system is started was added. In Linux, this PCI early quirks
function iterates through all PCI slots to check for any device that
require quirks.  While this more generic solution is preferable I only
ported the Intel graphics specific parts because I think my
implementation would be too similar to Linux GPL'd solution after
looking at the Linux code too much.

The code regarding Intel graphics stolen memory was ported from
Linux. In the case of Intel graphics stolen memory this
pci_early_quirks will read the stolen memory base and size from north
bridge registers.  The values are stored in global variables that is
later read by linuxkpi_gplv2. Linuxkpi stores these values in a
Linux-specific structure that is read by the drm driver.

Relevant linuxkpi code is here:
https://github.com/FreeBSDDesktop/kms-drm/blob/drm-v4.16/linuxkpi/gplv2/src/linux_compat.c#L37

For now, only amd64 arch is suppor ted since that is the only arch
supported by the new drm drivers. I was told that Intel GPUs are
always located on 0:2:0 so these values are hard coded for now.

Note that the structure and early execution of the detection code is
not required in its current form, but we expect that the code will be
added shortly which fixes the potential BIOS bugs by reserving the
stolen range in phys_avail[].  This must be done as early as possible
to avoid conflicts with the potential usage of the memory in kernel.

Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Reviewed by:	bwidawsk, imp
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D16719
Differential revision:	https://reviews.freebsd.org/D17775
2018-10-31 23:17:00 +00:00
..
config.mk Reduce overhead for simple 'make -V' lookups by avoiding 'find sys/'. 2018-03-10 02:09:36 +00:00
dtb.mk dtb: aarch64 uses vendor subdirectories, handle that 2018-08-23 13:23:54 +00:00
files Redo r339563: Remove joy(4) driver. 2018-10-26 16:03:30 +00:00
files.amd64 Add pci_early function to detect Intel stolen memory. 2018-10-31 23:17:00 +00:00
files.arm amd64: implement memcmp in assembly 2018-09-27 14:05:44 +00:00
files.arm64 amd64: implement memcmp in assembly 2018-09-27 14:05:44 +00:00
files.i386 Remove adv(4) and adw(4) 2018-10-22 02:34:47 +00:00
files.mips amd64: implement memcmp in assembly 2018-09-27 14:05:44 +00:00
files.powerpc amd64: implement memcmp in assembly 2018-09-27 14:05:44 +00:00
files.riscv Add support for the UART device found in lowRISC system-on-a-chip. 2018-10-12 15:19:41 +00:00
files.sparc64 Update to Zstandard 1.3.7 2018-10-22 18:29:12 +00:00
kern.mk Enable 'C'-compressed ISA extension. 2018-09-03 14:43:16 +00:00
kern.opts.mk Now that we've branched, turn off building DRM and DRM2 by default. 2018-10-20 19:18:30 +00:00
kern.post.mk Only invoke 'ls' if the local modules directory exists. 2018-10-30 18:20:34 +00:00
kern.pre.mk Add kernel ifunc support on arm64. 2018-10-01 18:51:08 +00:00
kmod.mk Use OBJS_DEPEND_GUESS for forced opt_global.h dependency. 2018-07-04 00:18:36 +00:00
kmod_syms.awk
kmod_syms_prefix.awk Add the infrastructure to support loading multiple versions of TCP 2017-06-08 20:41:28 +00:00
ldscript.amd64 amd64: tweak the read_frequently section 2018-05-18 07:31:26 +00:00
ldscript.arm
ldscript.arm64
ldscript.i386 i386 4/4G split. 2018-04-13 20:30:49 +00:00
ldscript.mips
ldscript.mips.cfe
ldscript.mips.mips64
ldscript.mips.octeon1
ldscript.powerpc
ldscript.powerpc64 powerpc64: Align frequently used/exclusive data on cacheline boundaries 2018-08-19 19:00:44 +00:00
ldscript.powerpcspe
ldscript.riscv
ldscript.sparc64
Makefile.amd64 Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Makefile.arm Only build the cache handling code we need when building the arm ELF 2018-07-28 12:50:09 +00:00
Makefile.arm64 Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Makefile.i386 Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Makefile.mips Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Makefile.powerpc Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Makefile.riscv Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Makefile.sparc64 Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
makeLINT.mk Remove the mlx5 driver from LINT kernel config for 32-bit PPC 2018-05-30 02:26:36 +00:00
makeLINT.sed
newvers.sh - Update head to 13.0-CURRENT. 2018-10-19 00:37:47 +00:00
NOTES Redo r339563: Remove joy(4) driver. 2018-10-26 16:03:30 +00:00
options Introduce an EXPERIMENTAL option for both src.conf(5) and the kernel. 2018-10-30 15:46:30 +00:00
options.amd64 Finish COMPAT_AOUT support for amd64. It wasn't in any amd64 or MI 2018-06-02 06:40:15 +00:00
options.arm Remove now the cow unused CPU_ARM9 and CPU_FA526 options. These are for 2018-07-28 11:00:45 +00:00
options.arm64 Enable UART support for Xilinx Ultrascale+ SoCs 2018-07-13 19:54:22 +00:00
options.i386 Remove SVR4 (System V Release 4) binary compatibility support. 2017-02-28 05:14:42 +00:00
options.mips Add SMP support for BERI CPU. 2018-04-12 17:43:19 +00:00
options.powerpc Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
options.riscv o Add driver for PLIC (Platform-Level Interrupt Controller) device. 2018-06-12 17:45:15 +00:00
options.sparc64
systags.sh sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
WITHOUT_SOURCELESS
WITHOUT_SOURCELESS_HOST
WITHOUT_SOURCELESS_UCODE Remove adv(4) and adw(4) 2018-10-22 02:34:47 +00:00