Message ID | 20240826071641.2691374-3-manojvishy@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | vfio/iommu: Flag to allow userspace to set DMA buffers system cacheable | expand |
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index f5d9fd1f45bf..31dd6203db96 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -471,6 +471,9 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data, else if (prot & IOMMU_CACHE) pte |= (ARM_LPAE_MAIR_ATTR_IDX_CACHE << ARM_LPAE_PTE_ATTRINDX_SHIFT); + else if (prot & IOMMU_SYS_CACHE) + pte |= (ARM_LPAE_MAIR_ATTR_IDX_INC_OCACHE + << ARM_LPAE_PTE_ATTRINDX_SHIFT); } /*
This change introduces a user-accessible flag that allows controlling the system-level outer cache behavior for mapped buffers. By setting this flag, the page-level MAIR attribute will be forced to use the outer cache, potentially improving performance for frequently accessed data. Signed-off-by: Manoj Vishwanathan <manojvishy@google.com> --- drivers/iommu/io-pgtable-arm.c | 3 +++ 1 file changed, 3 insertions(+)