Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

pudelkoM
Copy link
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