Conceptual
Login

DMA Masks: How Many Address Bits a Device Can Reach

Not every device can reach every address: an older card may only be able to put 32 bits of address on the bus, so it cannot touch memory above four gigabytes. A DMA mask is how a driver tells the kernel how wide its device's addressing is, so the kernel only ever hands it buffers it can actually reach. Set it wrong or skip it, and on a large machine your driver works for a while and then mysteriously corrupts memory once an allocation lands too high.

Questions this Concept answers

  • Why does a missing or wrong DMA mask often show up only on machines with a lot of memory?