On Wed, Feb 27, 2008 at 01:33:25AM +0100, Andrea Arcangeli wrote:> Hello,> > this patch allows to prevent linux from using the ram below> PHYSICAL_START.> > The "reserved RAM" can be mapped by virtualization software with to> create a 1:1 mapping between guest physical (bus) address and host> physical (bus) address. This will allow pci passthrough with DMA for> the guest with current production hardware that misses VT-d. The only> detail to take care of is the ram marked "reserved RAM failed". The> virtualization software must create for the guest an e820 map that> only includes the "reserved RAM" regions but if the guest touches> memory with guest physical address in the "reserved RAM failed" ranges> (linux guest will do that even if the ram isn't present in the e820> map), it should provide that as ram and map it with a not-ident> mapping. This should allow any linux kernel to run fine with pci> passthrough and hopefully any other OS too with all VT enabled> hardware.> > (the virtualization software should do if (pfn_valid(gfn))> get_page(pfn_to_page(gfn)) instead of get_user_pages and equivalent> check in the release path)> > The trampoline page marked as "reserved RAM failed" can be easily> relocated near 640k with an incremental patch to avoid an e820 hole at> 0x6000 if any bootloader or OS gets confused.> > The end of the patch are just bugfixes. However the limit of the> reserved ram is 1G... this can also be relaxed with an incremental> patch later on if needed (currently 1G is enough). Perhaps this has> other usages.> > Let me know if this can be merged, thanks!>

I don't know much about pci passthrough thing, but in a nutshell itlooks like you just want a way to reserve memory in host which is notused by host and then also reserve a virtual range in host where youcan create another set of mapping for that reserved memory?

Can't you just provide a command line parameter to reserve a sectionof memory, the way crashkernel=X@Y parameter does?