Re: git: e8988d60d24b - main - pci: expose intel_graphics_stolen as sysctl
- In reply to: Corvin Köhne : "git: e8988d60d24b - main - pci: expose intel_graphics_stolen as sysctl"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 27 Mar 2023 09:57:58 UTC
On Mon, 2023-03-27 at 09:41 +0000, Corvin Köhne wrote:
> The branch main has been updated by corvink:
>
> URL:
> https://cgit.FreeBSD.org/src/commit/?id=e8988d60d24b05e98919e912329880a54cdfdd70
>
> commit e8988d60d24b05e98919e912329880a54cdfdd70
> Author:    Corvin Köhne <corvink@FreeBSD.org>
> AuthorDate: 2023-03-27 08:21:37 +0000
> Commit:    Corvin Köhne <corvink@FreeBSD.org>
> CommitDate: 2023-03-27 09:40:49 +0000
>
> Â Â Â 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.
> ---
> Â sys/x86/pci/pci_early_quirks.c | 8 ++++++++
> Â 1 file changed, 8 insertions(+)
>
> 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
Reviewed by: manu
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39281
--
Kind regards,
Corvin