Mailing List Archive

option for memory backed by hugepages?
I need to guarantee that allocating 2MB using mmap() with the
MAP_HUGETLB flag on a HVM will get a contiguous 2MB huge page in system
memory.  HAP is enabled.  This is for some specialized hardware that
requires 2MB of contiguous DRAM, and it will not function properly if
the allocated memory uses 4KB pages that appear contiguous in virtual
space but are not physically contiguous in system DRAM.

It functions correctly running in a non-virtualized host environment if
a sufficient number of huge pages is reserved in /proc/sys/vm/nr_hugepages.

There is a qemu configuration option for guest memory to be backed by
huge pages:

  <memoryBacking>
    <hugepages/>
  </memoryBacking>

I have confirmed that contiguous 2MB pages are allocated in system
physical memory with mmap() and MAP_HUGETLB on a guest VM if the qemu
guest's memory is configured to be backed by hugepages.

Is there a similar mechanism in Xen that will guarantee that a HVM will
get a contiguous 2MB huge page in system DRAM?

John


--
john@wilkes.com <mailto:john@wilkes.com>