]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[uaccess] Allow for coherent DMA mapping of the 32-bit address space
authorMichael Brown <mcb30@ipxe.org>
Fri, 4 Jul 2025 12:29:44 +0000 (13:29 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 4 Jul 2025 15:10:51 +0000 (16:10 +0100)
commitc21443f0b9a4dee56ab0f47b096540d6443cda9f
tree186e939f7d92bda33a80e95596f0afe0507d3a22
parentd75d10df16964f4bf93cbaa083efc8bee313281a
[uaccess] Allow for coherent DMA mapping of the 32-bit address space

On platforms where DMA devices are not in the same coherency domain as
the CPU cache, it is necessary to create page table entries where the
translations are marked as uncacheable.

We choose to place iPXE within the low 4GB of memory (since 32-bit DMA
devices are still reasonably common even on systems with 64-bit CPUs).
We therefore need to cover only the low 4GB of memory with these page
table entries.

Update virt_to_phys() to allow for the existence of such a mapping,
assuming that iPXE itself will always reside within the top 4GB of the
64-bit virtual address space (and therefore that the DMA mapping must
lie somewhere below this in the negative virtual address space).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/virt_offset.h