diff options
author | Corvin Köhne <corvink@FreeBSD.org> | 2023-03-27 08:21:37 +0000 |
---|---|---|
committer | Corvin Köhne <corvink@FreeBSD.org> | 2023-03-27 09:40:49 +0000 |
commit | e8988d60d24b05e98919e912329880a54cdfdd70 (patch) | |
tree | f10ca6f63f70f330e1a3333ccf1f8aed91f5f5fc | |
parent | 48d70503bcae816eea6109c30ba79261eb47c9d0 (diff) | |
download | src-e8988d60d24b05e98919e912329880a54cdfdd70.tar.gz src-e8988d60d24b05e98919e912329880a54cdfdd70.zip |
pci: expose intel_graphics_stolen as sysctl
The Intel graphics stolen memory is used by the Intel GOP driver on
boot. When using bhyve with GPU passthrough, it's also used by the guest
GOP driver at guest boot. For that reason, bhyve needs to know the
address and size of this region to inform the guest about this region.
Exposing the variables as sysctl allows bhyve to easily read them.
-rw-r--r-- | sys/x86/pci/pci_early_quirks.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/x86/pci/pci_early_quirks.c b/sys/x86/pci/pci_early_quirks.c index b9de1d78e022..7eb3fcd91927 100644 --- a/sys/x86/pci/pci_early_quirks.c +++ b/sys/x86/pci/pci_early_quirks.c @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/bus.h> #include <sys/kernel.h> +#include <sys/sysctl.h> + #include <vm/vm.h> /* XXX: enable this once the KPI is available */ /* #include <x86/physmem.h> */ @@ -56,6 +58,12 @@ struct pci_device_id { */ vm_paddr_t intel_graphics_stolen_base = 0; vm_paddr_t intel_graphics_stolen_size = 0; +SYSCTL_U64(_hw, OID_AUTO, intel_graphics_stolen_base, CTLFLAG_RD, + &intel_graphics_stolen_base, 0, + "Base address of the intel graphics stolen memory."); +SYSCTL_U64(_hw, OID_AUTO, intel_graphics_stolen_size, CTLFLAG_RD, + &intel_graphics_stolen_size, 0, + "Size of the intel graphics stolen memory."); /* * Intel early quirks functions |