Page MenuHomeFreeBSD

bhyve: read out graphics stolen memory address and size
ClosedPublic

Authored by corvink on May 10 2023, 12:45 PM.
Tags
None
Referenced Files
F102610457: D40039.diff
Thu, Nov 14, 6:38 PM
F102597451: D40039.id121844.diff
Thu, Nov 14, 2:20 PM
F102597229: D40039.id123314.diff
Thu, Nov 14, 2:16 PM
F102553366: D40039.diff
Wed, Nov 13, 11:32 PM
Unknown Object (File)
Wed, Oct 23, 10:20 AM
Unknown Object (File)
Sep 27 2024, 7:52 AM
Unknown Object (File)
Sep 24 2024, 10:43 AM
Unknown Object (File)
Sep 24 2024, 8:45 AM
Subscribers

Details

Summary
This is the first step to emulate the graphics stolen memory register.

Note that the graphics stolen memory is somehow confusing. On the one
hand the Intel Open Source HD Graphics Programmers' Reference Manual
states that it's only GPU accessible. As the CPU can't access the area,
the guest shouldn't need it. On the other hand, the Intel GOP driver
refuses to work properly, if it's not set to a proper address.

Intel itself maps it into the guest by EPT [1]. At the moment, we're not
aware of any situation where this EPT mapping is required, so we don't
do it yet.

Intel also states that the Windows driver for Tiger Lake reads the
address of the graphics stolen memory [2]. As the GVT-d code doesn't
support Tiger Lake in it's first implementation, we can't check how it
behaves. We should keep an eye on it.

[1]
https://github.com/projectacrn/acrn-hypervisor/blob/e28d6fbfdfd556ff1bc3ff330e41d4ddbaa0f897/devicemodel/hw/pci/passthrough.c#L655-L657
[2]
https://github.com/projectacrn/acrn-hypervisor/blob/e28d6fbfdfd556ff1bc3ff330e41d4ddbaa0f897/devicemodel/hw/pci/passthrough.c#L626-L629

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 51439
Build 48330: arc lint + arc unit

Event Timeline

It's required to properly emulate the graphics stolen memory register. Therefore, this is the first patch require to do so.

corvink retitled this revision from bhyve: protect graphics stolen memory register to bhyve: read out graphics stolen memory address and size.
corvink edited the summary of this revision. (Show Details)
markj added inline comments.
usr.sbin/bhyve/pci_gvt-d.c
33
63

errno can be clobbered by the warnx() call above. I think it's enough to just return -1. Then you don't need errno.h.

This revision is now accepted and ready to land.May 11 2023, 2:46 PM