IO Remap Host PCI Memory into FVP

I am trying to remap Linux Host PCI memory into a FVP [0] running Linux in non-secure world.

As far as I am concerned, there is no official way to achieve this, so my experiments have attempted this as follows:

  • On the FVP in non-secure world kernel, allocate some pages
  • Identify these pages on the host in the address space of the FVP
  • Remap host resources into the FVP at the right offsets
  • Make sure that accesses are not cached within the FVP

I am currently facing some issues with this approach. As it turns out, the FVP does not contiguously allocate pages in its host address space. They are next to each other, however, there seem to be small holes, presumably for internal bookkeeping. If this is always the case, this approach does not work, or is limited to the size of the existing contiguous chunk.

Do you have some pointers on how I could solve this?

  • In particular, is there a way I can make the FVP allocate a big chunk of contiguous host memory which it then maps in the address space of the guest?
  • Would 64K granules help to increase the FVP internal continuous chunks? (e.g. running the FVP with -C cluster0.has_64k_granule=1 and compiling the kernel with 64K pages)
  • Is a completely different approach more fruitful? Perhaps using FVP debug options and gdb.

Many thanks for any pointers or thoughts.

  • [0] FVP_Base_RevC-2xAEMvA_11.20