ferros
ferros copied to clipboard
Track paddr in all untypeds, not just device
Currently device untypeds track paddr in their MemoryKind. Move this up to {W}Untyped so it applies to all untypeds, and add a public paddr
method to obtain the information.
Rationale: We need the physical address of regular memory to set up dma transfers. We currently get this by asking the kernel about a page address. This is not ideal because it's another syscall that's not necessarily needed. There are also cases where we might want to reason about general untypeds with knowledge of their physical address before we turn them into pages, perhaps to take advantage of platform NUMA characteristics.
This change also cleans up some General/Device memory distinctions, making the code a bit easier to understand.
Anti-Rationale: the kernel is tracking this and making it available, so we shouldn't re-track it ourselves.