Created attachment 143131 [details]
My guest is seeing the attached bug and call trace during boot. Kernel 4.20.2-200, also an issue on 4.19 series. 4.18 is similar with the older drm_ prefixed version of the function.
Use a Q35 VM configuration with the assigned GPU downstream of an emulated PCIe root port as a workaround. The driver assumes this configuration, presumably it's the only one that exists on bare metal, and reads from the upstream device without checking that it is actually present.
Created attachment 143133 [details] [review]
Does this patch fix it? dGPUs are always add in cards, so they always plug into an upstream port on bare metal. The driver needs to query the upstream port to determine what pcie gen speeds and lanes are available on the platform so that the driver can properly adjust them at runtime to save power.
Thank you both for the responses.
I can confirm using the Q35 machine type does not see this issue.
I'm rebuilding a kernel today to test the patch and will report back.
I can confirm the attached patch does fix the issue for i440FX.