Remix.run Logo
jolmg 11 hours ago

Thought there were cases where other devices could have direct access to RAM (e.g. DMA, PCIe controllers outside the CPU, etc.). Wonder how that works in conjunction.

wmf 11 hours ago | parent | next [-]

The encryption/decryption is done in the memory controller so it doesn't matter where the access is coming from.

porridgeraisin 10 hours ago | parent | prev [-]

There are many ways it can work depending on the cpu:

1. No dma, instead you use bounce buffers and the cpu manually encrypts and decrypts on behalf of the pcie

2. The IOMMU sets certain pages as unencrypted and ensures the pcie only accesses those pages and that part of ram alone is now not encrypted.

3. Newer pcie devices use the TDISP(handshake) and IDE(aes gcm hardware module related stuff) protocols to do encrypted communication with the CPUs PCIe root hub, where this functionality is called TIO i.e trusted io on amd and TX connect on intel. As far as nvidia GPUs go which is where I have used this, H100 onwards have the feature. Only server xeons and turins etc support this feature on the cpu side. I think some server SSDs do too. Here you get full encryption full DMA at full bandwidth.