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
Unknown Object (File)
Mon, May 6, 2:25 PM
Unknown Object (File)
Mon, May 6, 2:25 PM
Unknown Object (File)
Mon, May 6, 2:25 PM
Unknown Object (File)
Mon, May 6, 2:25 PM
Unknown Object (File)
Mon, May 6, 2:11 PM
Unknown Object (File)
Jan 2 2024, 8:25 PM
Unknown Object (File)
Jan 2 2024, 8:25 PM
Unknown Object (File)
Jan 2 2024, 8:25 PM
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 Not Applicable
Unit
Tests Not Applicable

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
81
87

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