Hi, > > Add "e820_add_entry(start, size, E820_RESERVED)" calls in qemu. > > Could you please point me at the correct file/function to add > the relevant block into?
There are already calls (in hw/i386/pc.c I think) already, adding entries for RAM. I'd try to place the code nearby, especially as you might change the ram code too to avoid ram being allocated for the reserved areas. > > Also make sure the firmware doesn't use those ranges, which may need > > firmware patching. At least seabios should happily add those > > reservations to the e820 map, but will not look at them otherwise, so > > you could end up with pci bars being mapped within the reserved > > regions. > > Are you saying that seabios will find reserved areas in the e820 > map and despite that map a BAR into a reserved block? It just copies over the entries, from qemu firmware interface to guest ram, so the OS (linux/windows/whatever) can see the reservations. > That's pretty > broken... There was no need so far to implement something more advanced in seabios. Another option is using coreboot as firmware. coreboot resource management is alot more powerful. It has to run on real hardware not only qemu, so it needs to be able to deal with all sorts of quirks. It should handle this just fine and place all pci bars outside the reservations. > > The linux kernel might fix it up at boot though. > > If you mean inside the VM, Linux-on-Linux isn't my intended use case, > though. Might be useful for testing though as you can easily check stuff in the kernel boot log and /proc/iomem. cheers, Gerd