Skip to content

RFC enabling graphics memory dma remapping

Zhenyu Wang lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4explicit export current graphics dmar statusdrivers/pci/intel-iommu.c include/linux/dmar.h+22 -20 replies
1/4explicit export current graphics dmar statusdrivers/pci/intel-iommu.c include/linux/dmar.h+22 -25 replies
2/4Add generic support for graphics dma remappingdrivers/char/agp/agp.h drivers/char/agp/backend.c drivers/char/agp/generic.c +1 more+55 -10 replies
2/4Add generic support for graphics dma remappingdrivers/char/agp/agp.h drivers/char/agp/backend.c drivers/char/agp/generic.c +1 more+54 -10 replies
3/4intel_agp: add support for graphics dma remapping on G33drivers/char/agp/Kconfig drivers/char/agp/intel-agp.c+141 -50 replies
3/4intel_agp: add support for graphics dma remapping on G33drivers/char/agp/Kconfig drivers/char/agp/intel-agp.c+141 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/4] enabling graphics memory dma remapping

Intel IOMMU (a.k.a VT-d) is under rapid deployment on desktop and mobile platforms. As platform provides multiple dma remap engines for devices like those lives on south bridge (net, sound, etc.), and we also have one engine specific to graphics device.

If this engine is functioning, the access to graphics memory routine is to first look up in GART table, which return virtual dma address that will further be route to graphics DMAR engine, which then looking up DMAR table to get real physical address.

Current intel iommu function in kernel is providing a graphics workaround kernel config (CONFIG_DMAR_GFX_WA) to make a 1:1 mapping initialization for graphics device, so what we fill in GART table got from agpgart page alloc is identical to virtual dma address in DMAR table. No change needs to be made for graphics driver.

Following patches try to add dma remapping function to agpgart module, so we won't depend on intel iommu graphics workaround. As DMAR is only available on x86_64 now, so these patches can only work for x86_64 system.

Here're three patches below:

- intel_iommu-explicit-export-current-graphics-dmar-status.patch

This exports current status of graphics dma remap engine, which depends on current platform iommu support, kernel config or runtime config. This info will be used in agp module for detect whether we should do remapping or not.

- AGP-Add-generic-support-for-graphics-dma-remapping.patch

This adds new hooks into agp bridge driver to do map/unmap when bind/unbind memory into GART table. The aim is to provide generic interfaces to let driver implement hardware specific operations.

- AGP-intel_agp-add-support-for-graphics-dma-remapping.patch

This implements graphics dma remapping support in intel_agp module, current only desktop chipset G33 series can use it.

Thanks.