Skip to content

Add probabilistic brute force allocator for DMA blocks >2MiB#12

Open
pudelkoM wants to merge 7 commits into
emmericp:masterfrom
pudelkoM:fancy-mmap
Open

Add probabilistic brute force allocator for DMA blocks >2MiB#12
pudelkoM wants to merge 7 commits into
emmericp:masterfrom
pudelkoM:fancy-mmap

Conversation

@pudelkoM
Copy link
Copy Markdown
Contributor

This PoC works as follows:

  1. Reserve target area to map into
  2. Allocate pool of 32 hugepages
  3. Order them by their physical addresses
  4. Remap them into the target area; this also unmaps the pages of it
  5. Check if we find a contiguous block of required size in the target area

This approach is not very magical to someone who understands paging, but still adds a fair amount of code (We could replace the existing dma_allocate function, as this implementation can of course also serve requests <2MiB).

In my initial tests it did not even fail once for allocations up to 16 pages (32MiB) on a system with 512 total pages.

ackxolotl added a commit to ackxolotl/iommu-leaks that referenced this pull request Jan 18, 2021
Implements a memory allocator for physically and virtually contiguous
memory using "normal" sized (i.e. not huge) pages. Implementation based
on emmericp/ixy#12.
ackxolotl added a commit to ackxolotl/iommu-leaks that referenced this pull request Jan 18, 2021
Implements a memory allocator for physically and virtually contiguous
memory using "normal" sized (i.e. not huge) pages. Implementation based
on emmericp/ixy#12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant