mirror of
https://github.com/ipxe/ipxe
synced 2025-12-13 15:31:42 +03:00
[iobuf] Ensure I/O buffer data sits within unshared cachelines
On platforms where DMA devices are not in the same coherency domain as the CPU cache, we must ensure that DMA I/O buffers do not share cachelines with other data. Align the start and end of I/O buffers to IOB_ZLEN, which is larger than any cacheline size we expect to encounter. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -15,11 +15,15 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
#include <ipxe/dma.h>
|
||||
|
||||
/**
|
||||
* Minimum I/O buffer length
|
||||
* Minimum I/O buffer length and alignment
|
||||
*
|
||||
* alloc_iob() will round up the allocated length to this size if
|
||||
* necessary. This is used on behalf of hardware that is not capable
|
||||
* of auto-padding.
|
||||
*
|
||||
* This length must be at least as large as the largest cacheline size
|
||||
* that we expect to encounter, to allow for platforms where DMA
|
||||
* devices are not in the same coherency domain as the CPU cache.
|
||||
*/
|
||||
#define IOB_ZLEN 128
|
||||
|
||||
|
||||
Reference in New Issue
Block a user