Re: [OVMF] resource assignment fails for passthrough PCI GPU


Gerd Hoffmann <kraxel@...>
 

Hi,

Thanks, yeah - now that I read the code comments that is clear (as
clear as it can be w/ my low level of base knowledge). In the commit you
mention Gerd (CC'd) had suggested a heuristic-based approach for
sizing the aperture. When you say "PCPU address width" - is that a
function of the available physical bits? IOW, would that approach
allow OVMF to automatically grow the aperture to the max ^2 supported
by the host CPU?
Yes. You can see it as "address sizes" in /proc/cpuinfo

Problem is this isn't reliable in virtual machines. qemu reports 40
bits physical even in case the host supports less. Intel hardware often
has 36 or 39 bits (depending on age). So if edk2 would go with the 40
bits (=> 1TB physical address space), then reserve -- for example --
topmost 25% of that (everything above 768 MB) for I/O things would
simply not work on a host with 39 (or less) bits physical address space
because the 64bit PCI bars would not be addressable by the CPU.

So edk2 tries to be as conservative as possible by default ...

cheers,
Gerd

Join discuss@edk2.groups.io to automatically receive all group messages.